Compare commits

..

No commits in common. 'bb7c05493a91dd3b7e4ff589fea390a7817b96dd' and 'e9d3b3680a25723b9a4ea6808ce8fc62b198d8c4' have entirely different histories.

@ -19,7 +19,7 @@ abstract class ApiClient {
Future<void> post( Future<void> post(
String endPoint, { String endPoint, {
required Map<String, dynamic> body, required dynamic body,
required Function(dynamic response, int statusCode, {int? messageStatus, String? errorMessage}) onSuccess, required Function(dynamic response, int statusCode, {int? messageStatus, String? errorMessage}) onSuccess,
required Function(String error, int statusCode, {int? messageStatus, Failure? failureType}) onFailure, required Function(String error, int statusCode, {int? messageStatus, Failure? failureType}) onFailure,
bool isAllowAny, bool isAllowAny,

@ -75,7 +75,6 @@ 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';
@ -306,13 +305,5 @@ class AppDependencies {
activePrescriptionsRepo: getIt() activePrescriptionsRepo: getIt()
), ),
); );
getIt.registerFactory<QrParkingViewModel>(
() => QrParkingViewModel(
qrParkingRepo: getIt<QrParkingRepo>(),
errorHandlerService: getIt<ErrorHandlerService>(),
cacheService: getIt<CacheService>(),
),
);
} }
} }

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

@ -9,7 +9,6 @@ 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';
@ -185,34 +184,23 @@ class _ParkingSlotState extends State<ParkingSlot> {
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
height: 48.h, height: 48.h,
child:CustomButton( child: ElevatedButton(
text: "Get Direction".needTranslation, style: ElevatedButton.styleFrom(
backgroundColor: AppColors.primaryRedColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
onPressed: _openDirection, onPressed: _openDirection,
backgroundColor: AppColors.primaryRedColor, child: Text(
borderColor: AppColors.primaryRedColor, "Get Direction".needTranslation,
textColor: AppColors.whiteColor, style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
borderRadius: 10, color: AppColors.whiteColor,
) ),
),
// 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(),

@ -126,18 +126,17 @@ class AppRoutes {
return HealthTrackerDetailPage( return HealthTrackerDetailPage(
trackerType: args ?? HealthTrackerTypeEnum.bloodSugar, trackerType: args ?? HealthTrackerTypeEnum.bloodSugar,
); );
},
monthlyReports: (context) => ChangeNotifierProvider( // monthlyReports: (context) => ChangeNotifierProvider(
create: (_) => MonthlyReportsViewModel( // create: (_) => MonthlyReportsViewModel(
monthlyReportsRepo: getIt<MonthlyReportsRepo>(), // monthlyReportsRepo: getIt<MonthlyReportsRepo>(),
errorHandlerService: getIt<ErrorHandlerService>(), // errorHandlerService: getIt<ErrorHandlerService>(),
), // ),
child: const MonthlyReportsPage(), // child: const MonthlyReportsPage(),
), // ),
qrParking: (context) => ChangeNotifierProvider<QrParkingViewModel>( // qrParking: (context) => ChangeNotifierProvider<QrParkingViewModel>(
create: (_) => getIt<QrParkingViewModel>(), // create: (_) => getIt<QrParkingViewModel>(),
child: const ParkingPage(), // child: const ParkingPage(),
),} },
}; };
} }

@ -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.6.0 barcode_scan2: ^4.5.1
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