fixed button

pull/157/head
Fatimah.Alshammari 4 months ago
parent b5753769b7
commit 69666a6f6c

@ -72,6 +72,7 @@ import 'package:local_auth/local_auth.dart';
import 'package:logger/web.dart'; import 'package:logger/web.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../features/monthly_reports/monthly_reports_repo.dart';
import '../features/qr_parking/qr_parking_view_model.dart'; import '../features/qr_parking/qr_parking_view_model.dart';
import '../presentation/health_calculators_and_converts/health_calculator_view_model.dart'; import '../presentation/health_calculators_and_converts/health_calculator_view_model.dart';
@ -290,11 +291,11 @@ class AppDependencies {
getIt.registerLazySingleton<MyInvoicesViewModel>(() => MyInvoicesViewModel(myInvoicesRepo: getIt(), errorHandlerService: getIt(), navServices: getIt())); getIt.registerLazySingleton<MyInvoicesViewModel>(() => MyInvoicesViewModel(myInvoicesRepo: getIt(), errorHandlerService: getIt(), navServices: getIt()));
getIt.registerLazySingleton<MonthlyReportViewModel>(() => MonthlyReportViewModel(errorHandlerService: getIt(), monthlyReportRepo: getIt())); getIt.registerLazySingleton<MonthlyReportViewModel>(() => MonthlyReportViewModel(errorHandlerService: getIt(), monthlyReportRepo: getIt()));
getIt.registerLazySingleton<MyInvoicesViewModel>(() => MyInvoicesViewModel( // getIt.registerLazySingleton<MyInvoicesViewModel>(() => MyInvoicesViewModel(
myInvoicesRepo: getIt(), // myInvoicesRepo: getIt(),
errorHandlerService: getIt(), // errorHandlerService: getIt(),
navServices: getIt(), // navServices: getIt(),
)); // ));
getIt.registerLazySingleton<HealthTrackersViewModel>(() => HealthTrackersViewModel(healthTrackersRepo: getIt(), errorHandlerService: getIt())); getIt.registerLazySingleton<HealthTrackersViewModel>(() => HealthTrackersViewModel(healthTrackersRepo: getIt(), errorHandlerService: getIt()));
getIt.registerLazySingleton<ActivePrescriptionsViewModel>( getIt.registerLazySingleton<ActivePrescriptionsViewModel>(
() => ActivePrescriptionsViewModel( () => ActivePrescriptionsViewModel(
@ -302,13 +303,13 @@ class AppDependencies {
activePrescriptionsRepo: getIt() activePrescriptionsRepo: getIt()
), ),
); );
getIt.registerFactory<QrParkingViewModel>( // getIt.registerFactory<QrParkingViewModel>(
() => QrParkingViewModel( // () => QrParkingViewModel(
qrParkingRepo: getIt<QrParkingRepo>(), // qrParkingRepo: getIt<QrParkingRepo>(),
errorHandlerService: getIt<ErrorHandlerService>(), // errorHandlerService: getIt<ErrorHandlerService>(),
cacheService: getIt<CacheService>(), // cacheService: getIt<CacheService>(),
), // ),
); // );
} }
} }

@ -10,6 +10,7 @@ import 'package:provider/provider.dart';
import '../../features/qr_parking/qr_parking_view_model.dart'; import '../../features/qr_parking/qr_parking_view_model.dart';
import '../../theme/colors.dart'; import '../../theme/colors.dart';
import '../../widgets/appbar/app_bar_widget.dart'; import '../../widgets/appbar/app_bar_widget.dart';
import '../../widgets/buttons/custom_button.dart';
import '../../widgets/routes/custom_page_route.dart'; import '../../widgets/routes/custom_page_route.dart';
@ -110,32 +111,42 @@ class _ParkingPageState extends State<ParkingPage> {
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
height: 56, height: 56,
child: ElevatedButton( child: CustomButton(
style: ElevatedButton.styleFrom( text: "Read Barcodes".needTranslation,
onPressed: () => _readQR(context), // ALWAYS non-null
isDisabled: vm.isLoading, // control disabled state here
backgroundColor: AppColors.primaryRedColor, backgroundColor: AppColors.primaryRedColor,
shape: RoundedRectangleBorder( borderColor: AppColors.primaryRedColor,
borderRadius: BorderRadius.circular(10),
),
),
onPressed: vm.isLoading ? null : () => _readQR(context),
child: vm.isLoading
? const SizedBox(
width: 22,
height: 22,
child: CircularProgressIndicator(
strokeWidth: 2,
color: Colors.white,
),
)
: const Text(
"Read Barcodes",
style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, )
),
), // ElevatedButton(
), // style: ElevatedButton.styleFrom(
// backgroundColor: AppColors.primaryRedColor,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// ),
// ),
// onPressed: vm.isLoading ? null : () => _readQR(context),
// child: vm.isLoading
// ? const SizedBox(
// width: 22,
// height: 22,
// child: CircularProgressIndicator(
// strokeWidth: 2,
// color: Colors.white,
// ),
// )
// : const Text(
// "Read Barcodes",
// style: TextStyle(
// fontSize: 18,
// fontWeight: FontWeight.bold,
// color: Colors.white,
// ),
// ),
// ),
), ),
), ),
), ),

@ -9,6 +9,7 @@ import 'package:hmg_patient_app_new/features/qr_parking/models/qr_parking_respon
import '../../features/qr_parking/qr_parking_view_model.dart'; import '../../features/qr_parking/qr_parking_view_model.dart';
import '../../theme/colors.dart'; import '../../theme/colors.dart';
import '../../widgets/appbar/app_bar_widget.dart'; import '../../widgets/appbar/app_bar_widget.dart';
import '../../widgets/buttons/custom_button.dart';
import '../../widgets/chip/app_custom_chip_widget.dart'; import '../../widgets/chip/app_custom_chip_widget.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -184,23 +185,34 @@ class _ParkingSlotState extends State<ParkingSlot> {
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
height: 48.h, height: 48.h,
child: ElevatedButton( child:CustomButton(
style: ElevatedButton.styleFrom( text: "Get Direction".needTranslation,
backgroundColor: AppColors.primaryRedColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
onPressed: _openDirection, onPressed: _openDirection,
child: Text( backgroundColor: AppColors.primaryRedColor,
"Get Direction".needTranslation, borderColor: AppColors.primaryRedColor,
style: TextStyle( textColor: AppColors.whiteColor,
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: AppColors.whiteColor, borderRadius: 10,
), )
),
), // ElevatedButton(
// style: ElevatedButton.styleFrom(
// backgroundColor: AppColors.primaryRedColor,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// ),
// ),
// onPressed: _openDirection,
// child: Text(
// "Get Direction".needTranslation,
// style: TextStyle(
// fontSize: 18,
// fontWeight: FontWeight.bold,
// color: AppColors.whiteColor,
// ),
// ),
// ),
), ),
// const Spacer(), // const Spacer(),

@ -77,7 +77,7 @@ dependencies:
amazon_payfort: ^1.1.4 amazon_payfort: ^1.1.4
network_info_plus: ^6.1.4 network_info_plus: ^6.1.4
flutter_nfc_kit: ^3.6.0 flutter_nfc_kit: ^3.6.0
barcode_scan2: ^4.5.1 barcode_scan2: ^4.6.0
keyboard_actions: ^4.2.0 keyboard_actions: ^4.2.0
path_provider: ^2.0.8 path_provider: ^2.0.8
open_filex: ^4.7.0 open_filex: ^4.7.0

Loading…
Cancel
Save