Merge branch 'development_v2.5' into zik_new_design_flutter_v2.5

* development_v2.5:
  updates
  livecare changes
  updates
merge-update-with-lab-changes
Zohaib Iqbal Kambrani 4 years ago
commit bf7c1d1610

@ -1758,4 +1758,5 @@ const Map localizedValues = {
"ancillaryOrderPaymentSuccess": {"en": "Your payment for selected orders has been made successfully.", "ar": "تم سداد دفعتك للطلبات المحددة بنجاح."}, "ancillaryOrderPaymentSuccess": {"en": "Your payment for selected orders has been made successfully.", "ar": "تم سداد دفعتك للطلبات المحددة بنجاح."},
"connectTitle": {"en": "Connect", "ar": "تواصل"}, "connectTitle": {"en": "Connect", "ar": "تواصل"},
"connectSubtitle": {"en": "With us", "ar": "معنا"}, "connectSubtitle": {"en": "With us", "ar": "معنا"},
"covidConsent": {"en": "Covid-19 Test feature allows you to book an appointment for the Covid-19 Lab test within HMG branches, where a swab sample will be collected & processed. Once the result has been processed, we shall notify you via SMS on your registered mobile number & the test result will also be available in the Lab Results section of this app. Please note that this result is only available to you & not publicly available to anyone else. \nPlease accept to confirm & proceed.", "ar": "تتيح لك ميزة اختبار كوفيد19 حجز موعد في احد فروع مجموعة الحبيب الطبية ، حيث سيتم اخذ عينة المسحة ومعالجتها. بمجرد معالجة النتيجة ، سنخطرك عبر رسالة نصية قصيرة على رقم هاتفك المحمول المسجل وستكون نتيجة الاختبار متاحة أيضًا على التطبيق في قسم نتائج المختبر. يرجى ملاحظة أن هذه النتيجة متاحة لك فقط وليست متاحة للجمهور او اي شخص آخر. الرجاء الموافقة للتأكيد والمتابعة."},
}; };

@ -228,17 +228,17 @@ class AmbulanceRequestOrdersModel {
} }
class WFOrder { class WFOrder {
Null wfButtonsDTO; dynamic wfButtonsDTO;
num iD; num iD;
num orderId; num orderId;
num previousStep; num previousStep;
num nextStep; num nextStep;
num serviceId; num serviceId;
Null order; dynamic order;
String created; String created;
Null createdBy; dynamic createdBy;
Null modified; dynamic modified;
Null modifiedBy; dynamic modifiedBy;
bool isDeleted; bool isDeleted;
WFOrder( WFOrder(
@ -291,14 +291,14 @@ class WFOrder {
class Orderpayment { class Orderpayment {
num iD; num iD;
num orderId; num orderId;
Null clientRequestId; dynamic clientRequestId;
num totalAmount; num totalAmount;
num paymentStatus; num paymentStatus;
Null order; dynamic order;
String created; String created;
Null createdBy; dynamic createdBy;
Null modified; dynamic modified;
Null modifiedBy; dynamic modifiedBy;
bool isDeleted; bool isDeleted;
Orderpayment( Orderpayment(

@ -283,8 +283,7 @@ class ServicesView extends StatelessWidget {
builder: (cxt) => CovidConsentDialog( builder: (cxt) => CovidConsentDialog(
okTitle: TranslationBase.of(context).acceptLbl, okTitle: TranslationBase.of(context).acceptLbl,
title: "User Consent", title: "User Consent",
message: message: TranslationBase.of(context).covidConsent,
"Covid-19 Test feature allows you to book appointment for Covid-19 Lab test within HMG branches where a swab sample will be collected & will be processed. Once the result has been processed you shall be notified via SMS on your registered mobile number & the test result will also be available in the Lab Results section of this app. Please note that this result is only available to you & not publicly available to anyone else. \nPlease accept to confirm & proceed.",
onTap: () async { onTap: () async {
Navigator.push(context, FadePage(page: CovidDrivethruLocation())); Navigator.push(context, FadePage(page: CovidDrivethruLocation()));
}, },

@ -3,7 +3,6 @@ import 'dart:ui';
import 'package:camera/camera.dart'; import 'package:camera/camera.dart';
import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart';
import 'package:diplomaticquarterapp/models/LiveCare/room_model.dart'; import 'package:diplomaticquarterapp/models/LiveCare/room_model.dart';
import 'package:diplomaticquarterapp/pages/conference/web_rtc/call_home_page.dart';
import 'package:diplomaticquarterapp/pages/conference/web_rtc/call_home_page_.dart'; import 'package:diplomaticquarterapp/pages/conference/web_rtc/call_home_page_.dart';
import 'package:diplomaticquarterapp/pages/conference/widgets/platform_exception_alert_dialog.dart'; import 'package:diplomaticquarterapp/pages/conference/widgets/platform_exception_alert_dialog.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
@ -34,7 +33,6 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
bool isCameraReady = false; bool isCameraReady = false;
Signaling signaling = Signaling()..init(); Signaling signaling = Signaling()..init();
@override @override
void initState() { void initState() {
_animationController = AnimationController(vsync: this, duration: Duration(milliseconds: 500)); _animationController = AnimationController(vsync: this, duration: Duration(milliseconds: 500));
@ -231,16 +229,17 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
Future<void> _submit() async { Future<void> _submit() async {
try { try {
// backToHome();
final roomModel = RoomModel(name: widget.incomingCallData.name, token: widget.incomingCallData.sessionId, identity: widget.incomingCallData.identity); final roomModel = RoomModel(name: widget.incomingCallData.name, token: widget.incomingCallData.sessionId, identity: widget.incomingCallData.identity);
await _controller.dispose(); await _controller.dispose();
await Navigator.of(context).pushReplacement( await Navigator.of(context).pushReplacement(
MaterialPageRoute( MaterialPageRoute(
fullscreenDialog: true, // fullscreenDialog: true,
builder: (BuildContext context) { builder: (BuildContext context) {
if(openCallInWeb) // if (openCallInWeb)
return VideoCallWebPage(receiverId: widget.incomingCallData.receiverID, callerId: widget.incomingCallData.callerID); return VideoCallWebPage(receiverId: widget.incomingCallData.receiverID, callerId: widget.incomingCallData.callerID);
// else
return CallHomePage(receiverId: widget.incomingCallData.receiverID, callerId: widget.incomingCallData.callerID); // return CallHomePage(receiverId: widget.incomingCallData.receiverID, callerId: widget.incomingCallData.callerID);
}, },
), ),
); );

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -6,14 +7,14 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart';
class VideoCallWebPage extends StatelessWidget{ class VideoCallWebPage extends StatelessWidget{
final GlobalKey webViewKey = GlobalKey(); final GlobalKey webViewKey = GlobalKey();
InAppWebViewController webViewController; // InAppWebViewController webViewController;
InAppWebViewController controller; InAppWebViewController controller;
URLRequest request; URLRequest request;
final String receiverId; final String receiverId;
final String callerId; final String callerId;
VideoCallWebPage({@required this.receiverId, @required this.callerId}){ VideoCallWebPage({@required this.receiverId, @required this.callerId}){
request = URLRequest(url: Uri.parse("https://vcallapi.hmg.com/index.html?username=$receiverId")); request = URLRequest(url: Uri.parse("https://vcallapi.hmg.com/Mobileindex.html?username=$receiverId&doctorid=$callerId"));
} }
InAppWebViewGroupOptions options = InAppWebViewGroupOptions( InAppWebViewGroupOptions options = InAppWebViewGroupOptions(
@ -51,7 +52,7 @@ class VideoCallWebPage extends StatelessWidget{
), ),
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
extendBody: false, extendBody: false,
backgroundColor: Colors.white, // backgroundColor: Colors.white,
body: Column( body: Column(
children: [ children: [
SizedBox(height: MediaQuery.of(context).viewPadding.top), SizedBox(height: MediaQuery.of(context).viewPadding.top),
@ -64,7 +65,7 @@ class VideoCallWebPage extends StatelessWidget{
onLoadStart: onLoadStart, onLoadStart: onLoadStart,
onLoadError: onError, onLoadError: onError,
onConsoleMessage: onConsoleMessage, onConsoleMessage: onConsoleMessage,
shouldOverrideUrlLoading: shouldRedirect , // shouldOverrideUrlLoading: shouldRedirect ,
), ),
), ),
], ],
@ -82,7 +83,10 @@ class VideoCallWebPage extends StatelessWidget{
); );
} }
onWebViewCreated(InAppWebViewController controller) => this.controller = controller; onWebViewCreated(InAppWebViewController controller) {
this.controller = controller;
LandingPage.isOpenCallPage = true;
}
onConsoleMessage(controller, ConsoleMessage consoleMessage){ onConsoleMessage(controller, ConsoleMessage consoleMessage){
print(consoleMessage); print(consoleMessage);
@ -93,11 +97,23 @@ class VideoCallWebPage extends StatelessWidget{
} }
onLoadStart(InAppWebViewController controller, Uri url) { onLoadStart(InAppWebViewController controller, Uri url) {
print(url);
if(url.toString().toLowerCase().contains("endcallpage")){
LandingPage.isOpenCallPage = false;
if(LandingPage.isOpenCallPage == true) {
print("END CALL!!!");
// controller.goBack();
Navigator.pop(webViewKey.currentContext);
}
}
} }
Future<NavigationActionPolicy> shouldRedirect(InAppWebViewController controller, NavigationAction navigationAction) async { Future<NavigationActionPolicy> shouldRedirect(InAppWebViewController controller, NavigationAction navigationAction) async {
var uri = navigationAction.request.url; var uri = navigationAction.request.url;
if(uri.queryParameters['exit'] == "yes"){ // if(uri.queryParameters['exit'] == "yes"){
// Navigator.pop(webViewKey.currentContext);
// }
if(uri.toString().toLowerCase().contains("endcallpage")){
Navigator.pop(webViewKey.currentContext); Navigator.pop(webViewKey.currentContext);
} }

@ -698,6 +698,7 @@ class DoctorsListService extends BaseService {
"ProjectID": projectID, "ProjectID": projectID,
"ServiceID": serviceID, "ServiceID": serviceID,
"AcceptedBy": docID, "AcceptedBy": docID,
"IsFlutter": true,
"DeviceToken": deviceToken, "DeviceToken": deviceToken,
"Latitude": lat, "Latitude": lat,
"Longitude": long, "Longitude": long,

@ -1,134 +1,124 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/uitl/app-permissions.dart'; import 'package:diplomaticquarterapp/uitl/app-permissions.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huawei_push/huawei_push.dart' as h_push;
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:firebase_messaging/firebase_messaging.dart' as fir; import 'package:firebase_messaging/firebase_messaging.dart' as fir;
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:huawei_push/huawei_push.dart' as h_push;
import 'app_shared_preferences.dart'; import 'app_shared_preferences.dart';
import 'navigation_service.dart'; import 'navigation_service.dart';
// |--> Push Notification Background // |--> Push Notification Background
Future<dynamic> backgroundMessageHandler(dynamic message) async{ Future<dynamic> backgroundMessageHandler(dynamic message) async {
fir.RemoteMessage message_; fir.RemoteMessage message_;
if(message is h_push.RemoteMessage){ // if huawei remote message convert it to Firebase Remote Message if (message is h_push.RemoteMessage) {
// if huawei remote message convert it to Firebase Remote Message
message_ = toFirebaseRemoteMessage(message); message_ = toFirebaseRemoteMessage(message);
} }
if (message_.data != null && message_.data['is_call'] == 'true') { if (message.data != null && message.data['is_call'] == 'true') {
_incomingCall(message_.data); _incomingCall(message.data);
return; return;
} }
h_push.Push.localNotification({ h_push.Push.localNotification({h_push.HMSLocalNotificationAttr.TITLE: 'Background Message', h_push.HMSLocalNotificationAttr.MESSAGE: "By: BackgroundMessageHandler"});
h_push.HMSLocalNotificationAttr.TITLE: 'Background Message',
h_push.HMSLocalNotificationAttr.MESSAGE: "By: BackgroundMessageHandler"
});
} }
// Push Notification Background <--| // Push Notification Background <--|
RemoteMessage toFirebaseRemoteMessage(h_push.RemoteMessage message) {
RemoteMessage toFirebaseRemoteMessage(h_push.RemoteMessage message){
final payload_data = jsonDecode(message.data); final payload_data = jsonDecode(message.data);
final fire_message = RemoteMessage( final fire_message = RemoteMessage(
from: message.from, from: message.from,
collapseKey: message.collapseKey, collapseKey: message.collapseKey,
data: payload_data['data'], data: payload_data['data'],
messageId: message.messageId, messageId: message.messageId,
sentTime: DateTime.fromMillisecondsSinceEpoch(message.sentTime*1000), sentTime: DateTime.fromMillisecondsSinceEpoch(message.sentTime * 1000),
ttl: message.ttl, ttl: message.ttl,
category: null, category: null,
messageType: message.type, messageType: message.type,
notification: RemoteNotification( notification: RemoteNotification(
title: message.notification.title, title: message.notification.title,
titleLocArgs: (message.notification.titleLocalizationArgs ?? []).map((e) => e.toString()).toList(), titleLocArgs: (message.notification.titleLocalizationArgs ?? []).map((e) => e.toString()).toList(),
titleLocKey: message.notification.titleLocalizationKey, titleLocKey: message.notification.titleLocalizationKey,
body: message.notification.body, body: message.notification.body,
bodyLocArgs: (message.notification.bodyLocalizationArgs ?? []).map((e) => e.toString()).toList(), bodyLocArgs: (message.notification.bodyLocalizationArgs ?? []).map((e) => e.toString()).toList(),
bodyLocKey: message.notification.bodyLocalizationKey, bodyLocKey: message.notification.bodyLocalizationKey,
android: AndroidNotification( android: AndroidNotification(
channelId: message.notification.channelId, channelId: message.notification.channelId,
clickAction: message.notification.clickAction, clickAction: message.notification.clickAction,
color: message.notification.color, color: message.notification.color,
count: null, count: null,
imageUrl: message.notification.imageUrl.path, imageUrl: message.notification.imageUrl.path,
link: message.notification.link.path, link: message.notification.link.path,
smallIcon: message.notification.icon, smallIcon: message.notification.icon,
sound: message.notification.sound, sound: message.notification.sound,
ticker: message.notification.ticker, ticker: message.notification.ticker,
tag: message.notification.tag, tag: message.notification.tag,
), ),
) ));
);
return fire_message; return fire_message;
} }
_incomingCall(Map data) async{ _incomingCall(Map data) async {
print("_incomingCall CALLED!!!!!! $data");
// print(ModalRoute.of(currentContext).settings.name);
LandingPage.incomingCallData = IncomingCallData.fromJson(data); LandingPage.incomingCallData = IncomingCallData.fromJson(data);
if(LandingPage.isOpenCallPage == false){ if (LandingPage.isOpenCallPage == false) {
LandingPage.isOpenCallPage = true; LandingPage.isOpenCallPage = true;
final permited = await AppPermission.askVideoCallPermission(currentContext); final permited = await AppPermission.askVideoCallPermission(currentContext);
if(permited) if (permited) await NavigationService.navigateToPage(IncomingCall(incomingCallData: LandingPage.incomingCallData));
await NavigationService.navigateToPage(IncomingCall(incomingCallData: LandingPage.incomingCallData)); // LandingPage.isOpenCallPage = false;
LandingPage.isOpenCallPage = false;
} }
await Future.delayed(Duration(milliseconds: 500)); await Future.delayed(Duration(milliseconds: 500));
await AppSharedPreferences().remove('call_data'); await AppSharedPreferences().remove('call_data');
} }
class PushNotificationHandler{ class PushNotificationHandler {
final BuildContext context; final BuildContext context;
static PushNotificationHandler _instance; static PushNotificationHandler _instance;
PushNotificationHandler(this.context){ PushNotificationHandler(this.context) {
PushNotificationHandler._instance = this; PushNotificationHandler._instance = this;
} }
static PushNotificationHandler getInstance() => _instance; static PushNotificationHandler getInstance() => _instance;
init() async{ init() async {
if (Platform.isIOS) { if (Platform.isIOS) {
final permission = await FirebaseMessaging.instance.requestPermission(); final permission = await FirebaseMessaging.instance.requestPermission();
if(permission.authorizationStatus == AuthorizationStatus.denied) if (permission.authorizationStatus == AuthorizationStatus.denied) return;
return;
} }
if(Platform.isAndroid && (await FlutterHmsGmsAvailability.isHmsAvailable)) { // 'Android HMS' (Handle Huawei Push_Kit Streams) if (Platform.isAndroid && (await FlutterHmsGmsAvailability.isHmsAvailable)) {
// 'Android HMS' (Handle Huawei Push_Kit Streams)
h_push.Push.enableLogger(); h_push.Push.enableLogger();
final result = await h_push.Push.setAutoInitEnabled(true); final result = await h_push.Push.setAutoInitEnabled(true);
h_push.Push.onNotificationOpenedApp.listen((message){ h_push.Push.onNotificationOpenedApp.listen((message) {
newMessage(toFirebaseRemoteMessage(message)); newMessage(toFirebaseRemoteMessage(message));
}, onError: (e) => print(e.toString())); }, onError: (e) => print(e.toString()));
h_push.Push.onMessageReceivedStream.listen((message){ h_push.Push.onMessageReceivedStream.listen((message) {
newMessage(toFirebaseRemoteMessage(message)); newMessage(toFirebaseRemoteMessage(message));
}, onError: (e) => print(e.toString())); }, onError: (e) => print(e.toString()));
h_push.Push.getTokenStream.listen((token) {
h_push.Push.getTokenStream.listen((token){
onToken(token); onToken(token);
}, onError: (e) => print(e.toString())); }, onError: (e) => print(e.toString()));
await h_push.Push.getToken(''); await h_push.Push.getToken('');
h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler);
} else {
}else{ // 'Android GMS or iOS' (Handle Firebase Messaging Streams) // 'Android GMS or iOS' (Handle Firebase Messaging Streams)
FirebaseMessaging.onMessage.listen((RemoteMessage message) async { FirebaseMessaging.onMessage.listen((RemoteMessage message) async {
newMessage(message); newMessage(message);
@ -145,19 +135,15 @@ class PushNotificationHandler{
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
final fcmToken = await FirebaseMessaging.instance.getToken(); final fcmToken = await FirebaseMessaging.instance.getToken();
if(fcmToken != null) if (fcmToken != null) onToken(fcmToken);
onToken(fcmToken);
} }
} }
newMessage(RemoteMessage remoteMessage) {
newMessage(RemoteMessage remoteMessage){ if (remoteMessage.data['is_call'] == 'true' || remoteMessage.data['is_call'] == true) _incomingCall(remoteMessage.data);
if(remoteMessage.data['is_call'] == 'true' || remoteMessage.data['is_call'] == true)
_incomingCall(remoteMessage.data);
} }
onToken(String token) async{ onToken(String token) async {
print("Push Notification Token: " + token); print("Push Notification Token: " + token);
AppSharedPreferences().setString(PUSH_TOKEN, token); AppSharedPreferences().setString(PUSH_TOKEN, token);
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
@ -165,11 +151,10 @@ class PushNotificationHandler{
onResume() async { onResume() async {
var call_data = await AppSharedPreferences().getObject('call_data'); var call_data = await AppSharedPreferences().getObject('call_data');
if(call_data != null){ if (call_data != null) {
_incomingCall(call_data); _incomingCall(call_data);
} }
} }
} }
/* todo verify all functionality */ /* todo verify all functionality */
@ -275,4 +260,4 @@ class PushNotificationHandler{
// print("Is Call Not Found iOS"); // print("Is Call Not Found iOS");
// } // }
// }, // },
// ); // );

@ -2829,11 +2829,10 @@ class TranslationBase {
String get successRegister => localizedValues["successRegister"][locale.languageCode]; String get successRegister => localizedValues["successRegister"][locale.languageCode];
String get pharmacyLiveCare => localizedValues["pharmacyLiveCare"][locale.languageCode]; String get pharmacyLiveCare => localizedValues["pharmacyLiveCare"][locale.languageCode];
String get ancillaryOrderPaymentSuccess => localizedValues["ancillaryOrderPaymentSuccess"][locale.languageCode]; String get ancillaryOrderPaymentSuccess => localizedValues["ancillaryOrderPaymentSuccess"][locale.languageCode];
String get connectTitle => localizedValues["connectTitle"][locale.languageCode]; String get connectTitle => localizedValues["connectTitle"][locale.languageCode];
String get connectSubtitle => localizedValues["connectSubtitle"][locale.languageCode]; String get connectSubtitle => localizedValues["connectSubtitle"][locale.languageCode];
String get declineLbl => localizedValues["declineLbl"][locale.languageCode]; String get declineLbl => localizedValues["declineLbl"][locale.languageCode];
String get covidConsent => localizedValues["covidConsent"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -50,16 +50,16 @@ class _BottomNavBarState extends State<BottomNavBar> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
BottomNavigationItem( BottomNavigationItem(
icon: DQIcons.my_medical_file, icon: "assets/images/new/bottom_nav/my_file.svg",
activeIcon: DQIcons.my_medical_file, activeIcon: "assets/images/new/bottom_nav/my_file.svg",
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: widget.index, index: widget.index,
currentIndex: 1, currentIndex: 1,
name: TranslationBase.of(context).medicalFile, name: TranslationBase.of(context).medicalFile,
), ),
BottomNavigationItem( BottomNavigationItem(
icon: DQIcons.family, icon: "assets/images/new/bottom_nav/family_files.svg",
activeIcon: DQIcons.family, activeIcon: "assets/images/new/bottom_nav/family_files.svg",
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: widget.index, index: widget.index,
currentIndex: 3, currentIndex: 3,
@ -69,8 +69,8 @@ class _BottomNavBarState extends State<BottomNavBar> {
if (widget.index == 0) if (widget.index == 0)
(widget.showHomeIcon) (widget.showHomeIcon)
? BottomNavigationItem( ? BottomNavigationItem(
icon: Icons.home_outlined, icon: "assets/images/new/bottom_nav/home.svg",
activeIcon: Icons.home_outlined, activeIcon: "assets/images/new/bottom_nav/home.svg",
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: widget.index, index: widget.index,
currentIndex: 2, currentIndex: 2,
@ -79,8 +79,8 @@ class _BottomNavBarState extends State<BottomNavBar> {
: Expanded(child: SizedBox()), : Expanded(child: SizedBox()),
if (widget.index != 0 && projectViewModel.havePrivilege(34)) if (widget.index != 0 && projectViewModel.havePrivilege(34))
BottomNavigationItem( BottomNavigationItem(
icon: Icons.home_outlined, icon: "assets/images/new/bottom_nav/home.svg",
activeIcon: Icons.home_outlined, activeIcon: "assets/images/new/bottom_nav/home.svg",
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: widget.index, index: widget.index,
currentIndex: 0, currentIndex: 0,
@ -96,8 +96,8 @@ class _BottomNavBarState extends State<BottomNavBar> {
// ), // ),
if (/*widget.index == 0 && */ projectViewModel.havePrivilege(34)) if (/*widget.index == 0 && */ projectViewModel.havePrivilege(34))
BottomNavigationItem( BottomNavigationItem(
icon: Icons.calendar_today_sharp, icon: "assets/images/new/bottom_nav/todo.svg",
activeIcon: Icons.calendar_today_sharp, activeIcon: "assets/images/new/bottom_nav/todo.svg",
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: widget.index, index: widget.index,
currentIndex: 4, currentIndex: 4,
@ -105,8 +105,8 @@ class _BottomNavBarState extends State<BottomNavBar> {
), ),
if (projectViewModel.havePrivilege(77)) if (projectViewModel.havePrivilege(77))
BottomNavigationItem( BottomNavigationItem(
icon: DQIcons.roboticon, icon: "assets/images/new/bottom_nav/help.svg",
activeIcon: DQIcons.roboticon, activeIcon: "assets/images/new/bottom_nav/help.svg",
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: widget.index, index: widget.index,
currentIndex: 5, currentIndex: 5,

@ -6,13 +6,14 @@ import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../Constants.dart'; import '../../Constants.dart';
class BottomNavigationItem extends StatelessWidget { class BottomNavigationItem extends StatelessWidget {
final IconData icon; final String icon;
final IconData activeIcon; final String activeIcon;
final ValueChanged<int> changeIndex; final ValueChanged<int> changeIndex;
final int index; final int index;
final int currentIndex; final int currentIndex;
@ -46,14 +47,12 @@ class BottomNavigationItem extends StatelessWidget {
SizedBox( SizedBox(
height: 15, height: 15,
), ),
Container( icon == "assets/images/new/bottom_nav/help.svg" ? Container(
child: Icon(currentIndex == index ? activeIcon : icon, child: SvgPicture.asset(icon, height: 20, width: 20, fit: BoxFit.cover),
color: currentIndex == index ) : Container(
? secondaryColor child: SvgPicture.asset(icon, height: 20, width: 20, fit: BoxFit.cover, color: currentIndex == index
: isDisabled ? Color(0xff333c45)
? Colors.grey[300] : Color(0xff989898)),
: Colors.grey,
size: 22.0),
), ),
SizedBox( SizedBox(
height: 2, height: 2,
@ -62,7 +61,7 @@ class BottomNavigationItem extends StatelessWidget {
name, name,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: currentIndex == index color: currentIndex == index
? secondaryColor ? Color(0xff333c45)
: isDisabled : isDisabled
? Colors.grey[300] ? Colors.grey[300]
: Colors.grey, : Colors.grey,
@ -77,21 +76,6 @@ class BottomNavigationItem extends StatelessWidget {
? Stack( ? Stack(
alignment: AlignmentDirectional.center, alignment: AlignmentDirectional.center,
children: [ children: [
Positioned(
right: 18.0,
bottom: 28.0,
child: Badge(
toAnimate: false,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.0),
child: Text(model.count.toString(), style: TextStyle(color: Colors.white, fontSize: 14.0)),
),
),
),
Column( Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -100,7 +84,10 @@ class BottomNavigationItem extends StatelessWidget {
height: 15, height: 15,
), ),
Container( Container(
child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? secondaryColor : Theme.of(context).dividerColor, size: 22.0), child: SvgPicture.asset(icon, height: 20, width: 20, fit: BoxFit.cover, color: currentIndex == index
? Color(0xff333c45)
: Color(0xff989898)),
// Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? secondaryColor : Theme.of(context).dividerColor, size: 22.0),
), ),
SizedBox( SizedBox(
height: 2, height: 2,
@ -108,7 +95,7 @@ class BottomNavigationItem extends StatelessWidget {
Texts( Texts(
name, name,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: currentIndex == index ? Theme.of(context).primaryColor : Colors.grey, color: currentIndex == index ? Color(0xff333c45) : Colors.grey,
fontSize: 11, fontSize: 11,
), ),
SizedBox( SizedBox(
@ -116,6 +103,21 @@ class BottomNavigationItem extends StatelessWidget {
), ),
], ],
), ),
Positioned(
right: 18.0,
bottom: 28.0,
child: Badge(
toAnimate: false,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.0),
child: Text(model.count.toString(), style: TextStyle(color: Colors.white, fontSize: 14.0)),
),
),
),
], ],
) )
: Column( : Column(
@ -126,13 +128,7 @@ class BottomNavigationItem extends StatelessWidget {
height: 15, height: 15,
), ),
Container( Container(
child: Icon(currentIndex == index ? activeIcon : icon, child: SvgPicture.asset(icon, height: 20, width: 20, fit: BoxFit.cover),
color: currentIndex == index
? secondaryColor
: isDisabled
? Colors.grey[300]
: Theme.of(context).dividerColor,
size: 22.0),
), ),
SizedBox( SizedBox(
height: 2, height: 2,
@ -141,7 +137,7 @@ class BottomNavigationItem extends StatelessWidget {
name, name,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: currentIndex == index color: currentIndex == index
? secondaryColor ? Color(0xff333c45)
: isDisabled : isDisabled
? Colors.grey[300] ? Colors.grey[300]
: Colors.grey, : Colors.grey,

Loading…
Cancel
Save