|
|
|
@ -2,6 +2,7 @@ import 'dart:io';
|
|
|
|
|
|
|
|
|
|
import 'package:car_customer_app/config/customer_dependencies.dart';
|
|
|
|
|
import 'package:car_customer_app/config/customer_routes.dart';
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
import 'package:mc_common_app/repositories/branch_repo.dart';
|
|
|
|
|
import 'package:mc_common_app/repositories/chat_repo.dart';
|
|
|
|
|
import 'package:mc_common_app/repositories/appointment_repo.dart';
|
|
|
|
@ -62,67 +63,69 @@ Future<void> main() async {
|
|
|
|
|
injector.get<Location>().handleLocationPermission();
|
|
|
|
|
});
|
|
|
|
|
CustomerAppRoutes.routes.addAll(AppRoutes.routes);
|
|
|
|
|
initializeDateFormatting().then((_) => runApp(
|
|
|
|
|
MultiProvider(
|
|
|
|
|
providers: <SingleChildWidget>[
|
|
|
|
|
ChangeNotifierProvider<BaseVM>(
|
|
|
|
|
create: (_) => BaseVM(),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<DashboardVmCustomer>(
|
|
|
|
|
create: (_) => DashboardVmCustomer(
|
|
|
|
|
commonServices: injector.get<CommonAppServices>(),
|
|
|
|
|
userRepo: injector.get<UserRepo>(),
|
|
|
|
|
),
|
|
|
|
|
initializeDateFormatting().then(
|
|
|
|
|
(_) => runApp(
|
|
|
|
|
MultiProvider(
|
|
|
|
|
providers: <SingleChildWidget>[
|
|
|
|
|
ChangeNotifierProvider<BaseVM>(
|
|
|
|
|
create: (_) => BaseVM(),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<DashboardVmCustomer>(
|
|
|
|
|
create: (_) => DashboardVmCustomer(
|
|
|
|
|
commonServices: injector.get<CommonAppServices>(),
|
|
|
|
|
userRepo: injector.get<UserRepo>(),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<UserVM>(
|
|
|
|
|
create: (_) => UserVM(
|
|
|
|
|
userRepo: injector.get<UserRepo>(),
|
|
|
|
|
commanServices: injector.get<CommonAppServices>(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<UserVM>(
|
|
|
|
|
create: (_) => UserVM(
|
|
|
|
|
userRepo: injector.get<UserRepo>(),
|
|
|
|
|
commanServices: injector.get<CommonAppServices>(),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<AdVM>(
|
|
|
|
|
create: (_) => AdVM(
|
|
|
|
|
commonServices: injector.get<CommonAppServices>(),
|
|
|
|
|
commonRepo: injector.get<CommonRepo>(),
|
|
|
|
|
adsRepo: injector.get<AdsRepo>(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<AdVM>(
|
|
|
|
|
create: (_) => AdVM(
|
|
|
|
|
commonServices: injector.get<CommonAppServices>(),
|
|
|
|
|
commonRepo: injector.get<CommonRepo>(),
|
|
|
|
|
adsRepo: injector.get<AdsRepo>(),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<AppointmentsVM>(
|
|
|
|
|
create: (_) => AppointmentsVM(
|
|
|
|
|
appointmentRepo: injector.get<AppointmentRepo>(),
|
|
|
|
|
commonServices: injector.get<CommonAppServices>(),
|
|
|
|
|
commonRepo: injector.get<CommonRepo>(),
|
|
|
|
|
branchRepo: injector.get<BranchRepo>(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<AppointmentsVM>(
|
|
|
|
|
create: (_) => AppointmentsVM(
|
|
|
|
|
appointmentRepo: injector.get<AppointmentRepo>(),
|
|
|
|
|
commonServices: injector.get<CommonAppServices>(),
|
|
|
|
|
commonRepo: injector.get<CommonRepo>(),
|
|
|
|
|
branchRepo: injector.get<BranchRepo>(),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<PaymentVM>(
|
|
|
|
|
create: (_) => PaymentVM(
|
|
|
|
|
paymentService: injector.get<PaymentService>(),
|
|
|
|
|
paymentRepo: injector.get<PaymentsRepo>(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<PaymentVM>(
|
|
|
|
|
create: (_) => PaymentVM(
|
|
|
|
|
paymentService: injector.get<PaymentService>(),
|
|
|
|
|
paymentRepo: injector.get<PaymentsRepo>(),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<ChatVM>(
|
|
|
|
|
create: (_) => ChatVM(
|
|
|
|
|
chatRepo: injector.get<ChatRepo>(),
|
|
|
|
|
requestRepo: injector.get<RequestRepo>(),
|
|
|
|
|
commonServices: injector.get<CommonAppServices>(),
|
|
|
|
|
)),
|
|
|
|
|
ChangeNotifierProvider<RequestsVM>(
|
|
|
|
|
create: (_) => RequestsVM(
|
|
|
|
|
requestRepo: injector.get<RequestRepo>(),
|
|
|
|
|
commonServices: injector.get<CommonAppServices>(),
|
|
|
|
|
commonRepo: injector.get<CommonRepo>(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<ChatVM>(
|
|
|
|
|
create: (_) => ChatVM(
|
|
|
|
|
chatRepo: injector.get<ChatRepo>(),
|
|
|
|
|
requestRepo: injector.get<RequestRepo>(),
|
|
|
|
|
commonServices: injector.get<CommonAppServices>(),
|
|
|
|
|
)),
|
|
|
|
|
ChangeNotifierProvider<RequestsVM>(
|
|
|
|
|
create: (_) => RequestsVM(
|
|
|
|
|
requestRepo: injector.get<RequestRepo>(),
|
|
|
|
|
commonServices: injector.get<CommonAppServices>(),
|
|
|
|
|
commonRepo: injector.get<CommonRepo>(),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<SettingOptionsVM>(
|
|
|
|
|
create: (_) => SettingOptionsVM(
|
|
|
|
|
settingOptionsRepo: injector.get<SettingOptionsRepo>(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ChangeNotifierProvider<SettingOptionsVM>(
|
|
|
|
|
create: (_) => SettingOptionsVM(
|
|
|
|
|
settingOptionsRepo: injector.get<SettingOptionsRepo>(),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
child: MyApp(),
|
|
|
|
|
).setupLocale(),
|
|
|
|
|
));
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
child: MyApp(),
|
|
|
|
|
).setupLocale(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// todo terminal command to generate translation files
|
|
|
|
@ -136,6 +139,10 @@ class MyApp extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
SystemChrome.setPreferredOrientations([
|
|
|
|
|
DeviceOrientation.portraitUp,
|
|
|
|
|
DeviceOrientation.portraitDown,
|
|
|
|
|
]);
|
|
|
|
|
return Sizer(
|
|
|
|
|
builder: (context, orientation, deviceType) {
|
|
|
|
|
injector.get<AppState>().setAppType(AppType.customer);
|
|
|
|
@ -160,3 +167,12 @@ class MyApp extends StatelessWidget {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Latitude: 24.708741, Longitude: 46.6657643,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Longitude=24.708741&Latitude=46.6657643
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//update I/flutter ( 5035): │ "latitude": "37.421998",
|
|
|
|
|
// I/flutter ( 5035): │ "longitude": "-122.0839",
|
|
|
|
|