Merge branch 'master' into development_aamir

# Conflicts:
#	lib/classes/notifications.dart
merge-requests/142/head
Aamir Muhammad 3 years ago
commit 75eab961ce

@ -520,6 +520,6 @@
"noUpcoming": "لا يوجد قادم", "noUpcoming": "لا يوجد قادم",
"fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية", "fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية",
"noWinner": "حزين! لم يفز أحد اليوم.", "noWinner": "حزين! لم يفز أحد اليوم.",
"myTeam" : "فريقي" "myTeam" : "فريقي",
"youCanPlayDemo": "لكن يمكنك لعب العرض" "youCanPlayDemo": "لكن يمكنك لعب العرض"
} }

@ -520,6 +520,6 @@
"noUpcoming": "There is no upcoming", "noUpcoming": "There is no upcoming",
"fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.", "fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.",
"noWinner": "Sad! No one won today.", "noWinner": "Sad! No one won today.",
"myTeam" : "My Team" "myTeam" : "My Team",
"youCanPlayDemo": "But you can play demo" "youCanPlayDemo": "But you can play demo"
} }

@ -6,15 +6,15 @@ import 'dart:ui';
import 'package:easy_localization/easy_localization.dart' show AssetLoader; import 'package:easy_localization/easy_localization.dart' show AssetLoader;
class CodegenLoader extends AssetLoader { class CodegenLoader extends AssetLoader{
const CodegenLoader(); const CodegenLoader();
@override @override
Future<Map<String, dynamic>> load(String fullPath, Locale locale) { Future<Map<String, dynamic>> load(String fullPath, Locale locale ) {
return Future.value(mapLocales[locale.toString()]); return Future.value(mapLocales[locale.toString()]);
} }
static const Map<String, dynamic> ar_SA = { static const Map<String,dynamic> ar_SA = {
"mohemm": "Mohemm", "mohemm": "Mohemm",
"english": "English", "english": "English",
"arabic": "عربي", "arabic": "عربي",
@ -444,7 +444,11 @@ class CodegenLoader extends AssetLoader {
"CorrectAddress": "تصحيح أو تعديل هذا العنوان", "CorrectAddress": "تصحيح أو تعديل هذا العنوان",
"SelectChangeWantToMake": " حدد نوع التغيير الذي تريد القيام به.", "SelectChangeWantToMake": " حدد نوع التغيير الذي تريد القيام به.",
"profile": { "profile": {
"reset_password": {"label": "Reset Password", "username": "Username", "password": "password"}, "reset_password": {
"label": "Reset Password",
"username": "Username",
"password": "password"
},
"profileCompletionPer": "استكمال الملف الشخصي", "profileCompletionPer": "استكمال الملف الشخصي",
"completeProfile": "الملف الشخصي الكامل", "completeProfile": "الملف الشخصي الكامل",
"personalInformation": "معلومات شخصية", "personalInformation": "معلومات شخصية",
@ -466,7 +470,10 @@ class CodegenLoader extends AssetLoader {
"gender": { "gender": {
"male": "Hi man ;) ", "male": "Hi man ;) ",
"female": "Hello girl :)", "female": "Hello girl :)",
"with_arg": {"male": "Hi man ;) {}", "female": "Hello girl :) {}"} "with_arg": {
"male": "Hi man ;) {}",
"female": "Hello girl :) {}"
}
}, },
"reset_locale": "إعادة ضبط اللغة", "reset_locale": "إعادة ضبط اللغة",
"chat": "دردشة", "chat": "دردشة",
@ -489,7 +496,7 @@ class CodegenLoader extends AssetLoader {
"gameTime": "وقت اللعب:", "gameTime": "وقت اللعب:",
"joinMarathon": "انضم إلى ماراثون", "joinMarathon": "انضم إلى ماراثون",
"joinDemoMarathon": "انضم إلى الماراثون التجريبي", "joinDemoMarathon": "انضم إلى الماراثون التجريبي",
"demo":"تجريبي", "demo": "تجريبي",
"minutes": "الدقائق", "minutes": "الدقائق",
"seconds": "ثواني", "seconds": "ثواني",
"note": "ملحوظة:", "note": "ملحوظة:",
@ -529,9 +536,10 @@ class CodegenLoader extends AssetLoader {
"noUpcoming": "لا يوجد قادم", "noUpcoming": "لا يوجد قادم",
"fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية", "fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية",
"noWinner": "حزين! لم يفز أحد اليوم.", "noWinner": "حزين! لم يفز أحد اليوم.",
"myTeam": "فريقي",
"youCanPlayDemo": "لكن يمكنك لعب العرض" "youCanPlayDemo": "لكن يمكنك لعب العرض"
}; };
static const Map<String, dynamic> en_US = { static const Map<String,dynamic> en_US = {
"mohemm": "Mohemm", "mohemm": "Mohemm",
"english": "English", "english": "English",
"arabic": "عربي", "arabic": "عربي",
@ -961,7 +969,11 @@ class CodegenLoader extends AssetLoader {
"CorrectAddress": "Correct or amend this address", "CorrectAddress": "Correct or amend this address",
"SelectChangeWantToMake": "Select the type of change you want to make", "SelectChangeWantToMake": "Select the type of change you want to make",
"profile": { "profile": {
"reset_password": {"label": "Reset Password", "username": "Username", "password": "password"}, "reset_password": {
"label": "Reset Password",
"username": "Username",
"password": "password"
},
"profileCompletionPer": "Profile Completion", "profileCompletionPer": "Profile Completion",
"completeProfile": "Complete Profile", "completeProfile": "Complete Profile",
"personalInformation": "Personal Information", "personalInformation": "Personal Information",
@ -983,7 +995,10 @@ class CodegenLoader extends AssetLoader {
"gender": { "gender": {
"male": "Hi man ;) ", "male": "Hi man ;) ",
"female": "Hello girl :)", "female": "Hello girl :)",
"with_arg": {"male": "Hi man ;) {}", "female": "Hello girl :) {}"} "with_arg": {
"male": "Hi man ;) {}",
"female": "Hello girl :) {}"
}
}, },
"reset_locale": "Reset Language", "reset_locale": "Reset Language",
"chat": "Chat", "chat": "Chat",
@ -995,11 +1010,11 @@ class CodegenLoader extends AssetLoader {
"gameTime": "Game Time:", "gameTime": "Game Time:",
"joinMarathon": "Join Marathon", "joinMarathon": "Join Marathon",
"joinDemoMarathon": "Join Demo Marathon", "joinDemoMarathon": "Join Demo Marathon",
"demo":"Demo", "demo": "Demo",
"minutes": "Minutes", "minutes": "Minutes",
"seconds": "Seconds", "seconds": "Seconds",
"note": "Note:", "note": "Note:",
"demoMarathonNoteP1": "You can play the demo_questions_marathon.json Marathon to learn how it works. You can join the Marathon", "demoMarathonNoteP1": "You can play the demo Marathon to learn how it works. You can join the Marathon",
"demoMarathonNoteP2": "5 Minutes", "demoMarathonNoteP2": "5 Minutes",
"demoMarathonNoteP3": "before the actual time.", "demoMarathonNoteP3": "before the actual time.",
"sponsoredBy": "Sponsored By:", "sponsoredBy": "Sponsored By:",
@ -1046,8 +1061,8 @@ class CodegenLoader extends AssetLoader {
"noUpcoming": "There is no upcoming", "noUpcoming": "There is no upcoming",
"fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.", "fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.",
"noWinner": "Sad! No one won today.", "noWinner": "Sad! No one won today.",
"myTeam": "My Team",
"youCanPlayDemo": "But you can play demo" "youCanPlayDemo": "But you can play demo"
};
}; static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US};
static const Map<String, Map<String, dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US};
} }

@ -506,7 +506,7 @@ abstract class LocaleKeys {
static const noUpcoming = 'noUpcoming'; static const noUpcoming = 'noUpcoming';
static const fakeLocation = 'fakeLocation'; static const fakeLocation = 'fakeLocation';
static const noWinner = 'noWinner'; static const noWinner = 'noWinner';
static const youCanPlayDemo = 'youCanPlayDemo';
static const myTeam = 'myTeam'; static const myTeam = 'myTeam';
static const youCanPlayDemo = 'youCanPlayDemo';
} }

@ -7,6 +7,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/api/dashboard_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
@ -43,7 +44,7 @@ class DashboardScreen extends StatefulWidget {
} }
} }
class _DashboardScreenState extends State<DashboardScreen> { class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingObserver {
late DashboardProviderModel data; late DashboardProviderModel data;
late MarathonProvider marathonProvider; late MarathonProvider marathonProvider;
late ChatProviderModel cProvider; late ChatProviderModel cProvider;
@ -55,6 +56,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addObserver(this);
super.initState(); super.initState();
scheduleMicrotask(() { scheduleMicrotask(() {
data = Provider.of<DashboardProviderModel>(context, listen: false); data = Provider.of<DashboardProviderModel>(context, listen: false);
@ -65,8 +67,27 @@ class _DashboardScreenState extends State<DashboardScreen> {
}); });
} }
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.resumed) {
checkSession();
}
}
void checkSession() async {
try {
Utils.showLoading(context);
await DashboardApiClient().getOpenMissingSwipes();
Utils.hideLoading(context);
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
@override @override
void dispose() { void dispose() {
WidgetsBinding.instance.removeObserver(this);
super.dispose(); super.dispose();
chatHubConnection.stop(); chatHubConnection.stop();
} }

@ -111,7 +111,7 @@ class _LoginScreenState extends State<LoginScreen> {
} }
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.handleException(ex, context, (errorMsg) {}); Utils.handleException(ex, context, null);
} }
} }

@ -261,7 +261,7 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
title.toText16().expanded, title.toText16().expanded,
6.width, 6.width,
SimpleButton(LocaleKeys.add.tr(), () async { SimpleButton(LocaleKeys.add.tr(), () async {
ImageOptions.showImageOptionsNew(context, false, (String image, File file) { ImageOptions.showImageOptionsNew(context, true, (String image, File file) {
setState(() { setState(() {
attachmentFiles.add(file); attachmentFiles.add(file);
attachments.add(image); attachments.add(image);

@ -49,7 +49,7 @@ dependencies:
flutter_calendar_carousel: ^2.1.0 flutter_calendar_carousel: ^2.1.0
pie_chart: ^5.1.0 pie_chart: ^5.1.0
shared_preferences: ^2.0.12 shared_preferences: ^2.0.12
firebase_messaging: ^11.2.8 firebase_messaging: ^13.0.4
shimmer: ^2.0.0 shimmer: ^2.0.0
logger: ^1.1.0 logger: ^1.1.0
flutter_countdown_timer: ^4.1.0 flutter_countdown_timer: ^4.1.0

Loading…
Cancel
Save