mark attendance counter & ios nfc fixed 1.0

development_mirza
Sikander Saleem 3 years ago
parent 39240b734e
commit 6e409c77a0

@ -325,7 +325,6 @@ class Utils {
} }
static void readNFc({required Function(String) onRead}) { static void readNFc({required Function(String) onRead}) {
var instance = NfcManager.instance;
NfcManager.instance.startSession(onDiscovered: (NfcTag tag) async { NfcManager.instance.startSession(onDiscovered: (NfcTag tag) async {
print(tag.data); print(tag.data);

@ -28,9 +28,7 @@ Logger logger = Logger(
class MyHttpOverrides extends HttpOverrides { class MyHttpOverrides extends HttpOverrides {
@override @override
HttpClient createHttpClient(SecurityContext? context) { HttpClient createHttpClient(SecurityContext? context) {
return super.createHttpClient(context) return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
..badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
} }
} }
@ -86,11 +84,9 @@ class MyApp extends StatelessWidget {
DeviceType deviceType, DeviceType deviceType,
) { ) {
PostParamsModel? obj = AppState().postParamsObject; PostParamsModel? obj = AppState().postParamsObject;
obj?.languageID = obj?.languageID = EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2;
EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2;
AppState().setPostParamsModel(obj!); AppState().setPostParamsModel(obj!);
List<LocalizationsDelegate<dynamic>> delegates = List<LocalizationsDelegate<dynamic>> delegates = context.localizationDelegates;
context.localizationDelegates;
// delegates.add(GlobalMaterialLocalizations.delegate); // delegates.add(GlobalMaterialLocalizations.delegate);
delegates.add( delegates.add(
MonthYearPickerLocalizations.delegate, MonthYearPickerLocalizations.delegate,

@ -143,7 +143,7 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
Utils.readNFc(onRead: (String nfcId) async { Utils.readNFc(onRead: (String nfcId) async {
Utils.showLoading(context); Utils.showLoading(context);
try { try {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 2, nfcValue: nfcId ?? "", isGpsRequired: isNfcLocationEnabled, lat: lat, long: lng); GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 2, nfcValue: nfcId, isGpsRequired: isNfcLocationEnabled, lat: lat, long: lng);
bool status = await model.fetchAttendanceTracking(context); bool status = await model.fetchAttendanceTracking(context);
Utils.hideLoading(context); Utils.hideLoading(context);
showMDialog( showMDialog(

Loading…
Cancel
Save