feat: Add recommended tasks for next sprint to improve coding practices in mobile applications

This commit is contained in:
Achintha Isuru
2026-02-01 14:03:43 -05:00
parent 9f8b60d571
commit 00999503e1
5 changed files with 324 additions and 55 deletions

View File

@@ -12,6 +12,7 @@ import 'package:client_hubs/client_hubs.dart' as client_hubs;
import 'package:client_create_order/client_create_order.dart'
as client_create_order;
import 'package:firebase_core/firebase_core.dart';
import 'package:krow_core/core.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
@@ -54,34 +55,38 @@ class AppWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BlocProvider<core_localization.LocaleBloc>(
create: (BuildContext context) =>
Modular.get<core_localization.LocaleBloc>(),
child:
BlocBuilder<
core_localization.LocaleBloc,
core_localization.LocaleState
>(
builder:
(BuildContext context, core_localization.LocaleState state) {
return core_localization.TranslationProvider(
child: MaterialApp.router(
debugShowCheckedModeBanner: false,
title: "Krow Client",
theme: UiTheme.light,
routerConfig: Modular.routerConfig,
locale: state.locale,
supportedLocales: state.supportedLocales,
localizationsDelegates:
const <LocalizationsDelegate<dynamic>>[
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
),
);
},
),
return WebMobileFrame(
appName: 'KROW Client\nApplication',
logo: Image.asset('assets/logo.png'),
child: BlocProvider<core_localization.LocaleBloc>(
create: (BuildContext context) =>
Modular.get<core_localization.LocaleBloc>(),
child:
BlocBuilder<
core_localization.LocaleBloc,
core_localization.LocaleState
>(
builder:
(BuildContext context, core_localization.LocaleState state) {
return core_localization.TranslationProvider(
child: MaterialApp.router(
debugShowCheckedModeBanner: false,
title: "Krow Client",
theme: UiTheme.light,
routerConfig: Modular.routerConfig,
locale: state.locale,
supportedLocales: state.supportedLocales,
localizationsDelegates:
const <LocalizationsDelegate<dynamic>>[
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
),
);
},
),
),
);
}
}

View File

@@ -8,6 +8,7 @@ import 'package:flutter_modular/flutter_modular.dart';
import 'package:staff_authentication/staff_authentication.dart'
as staff_authentication;
import 'package:staff_main/staff_main.dart' as staff_main;
import 'package:krow_core/core.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
@@ -34,33 +35,37 @@ class AppWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BlocProvider<core_localization.LocaleBloc>(
create: (BuildContext context) =>
Modular.get<core_localization.LocaleBloc>(),
child:
BlocBuilder<
core_localization.LocaleBloc,
core_localization.LocaleState
>(
builder:
(BuildContext context, core_localization.LocaleState state) {
return core_localization.TranslationProvider(
child: MaterialApp.router(
title: "KROW Staff",
theme: UiTheme.light,
routerConfig: Modular.routerConfig,
locale: state.locale,
supportedLocales: state.supportedLocales,
localizationsDelegates:
const <LocalizationsDelegate<dynamic>>[
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
),
);
},
),
return WebMobileFrame(
appName: 'KROW Staff\nApplication',
logo: Image.asset('assets/logo.png'),
child: BlocProvider<core_localization.LocaleBloc>(
create: (BuildContext context) =>
Modular.get<core_localization.LocaleBloc>(),
child:
BlocBuilder<
core_localization.LocaleBloc,
core_localization.LocaleState
>(
builder:
(BuildContext context, core_localization.LocaleState state) {
return core_localization.TranslationProvider(
child: MaterialApp.router(
title: "KROW Staff",
theme: UiTheme.light,
routerConfig: Modular.routerConfig,
locale: state.locale,
supportedLocales: state.supportedLocales,
localizationsDelegates:
const <LocalizationsDelegate<dynamic>>[
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
),
);
},
),
),
);
}
}