Merge branch 'master' into faiz_cs

merge-requests/141/head
Faiz Hashmi 3 years ago
commit 7e235c9d8c

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

@ -520,6 +520,6 @@
"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.",
"noWinner": "Sad! No one won today.",
"myTeam" : "My Team"
"myTeam" : "My Team",
"youCanPlayDemo": "But you can play demo"
}

@ -37,7 +37,7 @@ class AppNotifications {
void initNotification(String? firebaseToken) async {
// await requestPermissions();
AppState().deviceNotificationToken = firebaseToken;
AppState().setDeviceToken = firebaseToken;
// await Permission.notification.isDenied.then((value) {
// if (value) {
// Permission.notification.request();

@ -444,7 +444,11 @@ class CodegenLoader extends AssetLoader {
"CorrectAddress": "تصحيح أو تعديل هذا العنوان",
"SelectChangeWantToMake": " حدد نوع التغيير الذي تريد القيام به.",
"profile": {
"reset_password": {"label": "Reset Password", "username": "Username", "password": "password"},
"reset_password": {
"label": "Reset Password",
"username": "Username",
"password": "password"
},
"profileCompletionPer": "استكمال الملف الشخصي",
"completeProfile": "الملف الشخصي الكامل",
"personalInformation": "معلومات شخصية",
@ -466,7 +470,10 @@ class CodegenLoader extends AssetLoader {
"gender": {
"male": "Hi man ;) ",
"female": "Hello girl :)",
"with_arg": {"male": "Hi man ;) {}", "female": "Hello girl :) {}"}
"with_arg": {
"male": "Hi man ;) {}",
"female": "Hello girl :) {}"
}
},
"reset_locale": "إعادة ضبط اللغة",
"chat": "دردشة",
@ -529,6 +536,7 @@ class CodegenLoader extends AssetLoader {
"noUpcoming": "لا يوجد قادم",
"fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية",
"noWinner": "حزين! لم يفز أحد اليوم.",
"myTeam": "فريقي",
"youCanPlayDemo": "لكن يمكنك لعب العرض"
};
static const Map<String,dynamic> en_US = {
@ -961,7 +969,11 @@ class CodegenLoader extends AssetLoader {
"CorrectAddress": "Correct or amend this address",
"SelectChangeWantToMake": "Select the type of change you want to make",
"profile": {
"reset_password": {"label": "Reset Password", "username": "Username", "password": "password"},
"reset_password": {
"label": "Reset Password",
"username": "Username",
"password": "password"
},
"profileCompletionPer": "Profile Completion",
"completeProfile": "Complete Profile",
"personalInformation": "Personal Information",
@ -983,7 +995,10 @@ class CodegenLoader extends AssetLoader {
"gender": {
"male": "Hi man ;) ",
"female": "Hello girl :)",
"with_arg": {"male": "Hi man ;) {}", "female": "Hello girl :) {}"}
"with_arg": {
"male": "Hi man ;) {}",
"female": "Hello girl :) {}"
}
},
"reset_locale": "Reset Language",
"chat": "Chat",
@ -999,7 +1014,7 @@ class CodegenLoader extends AssetLoader {
"minutes": "Minutes",
"seconds": "Seconds",
"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",
"demoMarathonNoteP3": "before the actual time.",
"sponsoredBy": "Sponsored By:",
@ -1046,8 +1061,8 @@ class CodegenLoader extends AssetLoader {
"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.",
"noWinner": "Sad! No one won today.",
"myTeam": "My Team",
"youCanPlayDemo": "But you can play demo"
};
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 fakeLocation = 'fakeLocation';
static const noWinner = 'noWinner';
static const youCanPlayDemo = 'youCanPlayDemo';
static const myTeam = 'myTeam';
static const youCanPlayDemo = 'youCanPlayDemo';
}

@ -6,6 +6,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.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/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
@ -41,7 +42,7 @@ class DashboardScreen extends StatefulWidget {
}
}
class _DashboardScreenState extends State<DashboardScreen> {
class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingObserver {
late DashboardProviderModel data;
late MarathonProvider marathonProvider;
late ChatProviderModel cProvider;
@ -53,6 +54,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
@override
void initState() {
WidgetsBinding.instance.addObserver(this);
super.initState();
scheduleMicrotask(() {
data = Provider.of<DashboardProviderModel>(context, listen: false);
@ -63,8 +65,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
void dispose() {
WidgetsBinding.instance.removeObserver(this);
super.dispose();
chatHubConnection.stop();
}

@ -112,7 +112,7 @@ class _LoginScreenState extends State<LoginScreen> {
}
} catch (ex) {
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,
6.width,
SimpleButton(LocaleKeys.add.tr(), () async {
ImageOptions.showImageOptionsNew(context, false, (String image, File file) {
ImageOptions.showImageOptionsNew(context, true, (String image, File file) {
setState(() {
attachmentFiles.add(file);
attachments.add(image);

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

Loading…
Cancel
Save