add splash page fix language issues

merge-update-with-lab-changes
Mohammad Aljmma 5 years ago
parent d5afb50ed3
commit e10a0a4d54

@ -673,5 +673,6 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
"Book": {"en": "Book", "ar": "احجز"}, "Book": {"en": "Book", "ar": "احجز"},
"AppointmentLabel": {"en": "Appointment", "ar": "موعد"}, "AppointmentLabel": {"en": "Appointment", "ar": "موعد"},
"BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"},
}; };

@ -7,7 +7,9 @@ import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import '../../../locator.dart';
import '../../../routes.dart'; import '../../../routes.dart';
import '../AuthenticatedUserObject.dart';
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
@ -16,7 +18,8 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
/// onSuccess: (dynamic response, int statusCode) {}, /// onSuccess: (dynamic response, int statusCode) {},
/// onFailure: (String error, int statusCode) {}, /// onFailure: (String error, int statusCode) {},
/// body: Map(); /// body: Map();
///
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
class BaseAppClient { class BaseAppClient {
post(String endPoint, post(String endPoint,
{Map<String, dynamic> body, {Map<String, dynamic> body,
@ -114,11 +117,15 @@ class BaseAppClient {
onFailure( onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode); statusCode);
logout();
} }
} else if (parsed['MessageStatus'] == 1 || } else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) { parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
}else if (!parsed['IsAuthenticated']) {
await logout();
//helpers.showErrorToast('Your session expired Please login agian');
} else { } else {
if (parsed['SameClinicApptList'] != null) { if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
@ -141,7 +148,8 @@ class BaseAppClient {
logout() async { logout() async {
await sharedPref.remove(LOGIN_TOKEN_ID); await sharedPref.remove(LOGIN_TOKEN_ID);
Navigator.of(AppGlobal.context).pushReplacementNamed(LOGIN_TYPE); await authenticatedUserObject.getUser();
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
} }
String getSessionId(String id) { String getSessionId(String id) {

@ -10,19 +10,23 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
class ProjectViewModel extends BaseViewModel { class ProjectViewModel extends BaseViewModel {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
Locale _appLocale; Locale _appLocale = Locale('ar');
String currentLanguage = 'en'; String currentLanguage = 'ar';
bool _isArabic = false; bool _isArabic = false;
bool isInternetConnection = true; bool isInternetConnection = true;
bool isLoading = false; bool isLoading = false;
bool isError = false; bool isError = false;
String error = ''; String error = '';
dynamic searchvalue; dynamic searchvalue;
dynamic get searchValue => searchvalue; dynamic get searchValue => searchvalue;
Locale get appLocal => _appLocale; Locale get appLocal => _appLocale;
LocaleType get localeType => isArabic? LocaleType.en:LocaleType.ar; LocaleType get localeType => isArabic ? LocaleType.en : LocaleType.ar;
bool get isArabic => _isArabic; bool get isArabic => _isArabic;
// BaseViewModel baseViewModel = locator<BaseViewModel>() // BaseViewModel baseViewModel = locator<BaseViewModel>()
StreamSubscription subscription; StreamSubscription subscription;
@ -48,11 +52,10 @@ class ProjectViewModel extends BaseViewModel {
} }
void loadSharedPrefLanguage() async { void loadSharedPrefLanguage() async {
currentLanguage = await sharedPref.getString(APP_LANGUAGE); currentLanguage =
_appLocale = Locale(currentLanguage ?? 'en'); await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
_isArabic = currentLanguage != null _appLocale = Locale(currentLanguage);
? currentLanguage == 'ar' ? true : false _isArabic = currentLanguage == 'ar';
: true;
notifyListeners(); notifyListeners();
} }

@ -67,7 +67,7 @@ class MyApp extends StatelessWidget {
hintColor: Colors.grey[400], hintColor: Colors.grey[400],
disabledColor: Colors.grey[300], disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0), errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: HexColor('#E9E9E9'), // Colors.grey[100], scaffoldBackgroundColor: Color(0xffEEEEEE),
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey, textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white, canvasColor: Colors.white,
@ -75,8 +75,7 @@ class MyApp extends StatelessWidget {
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Color(0xff40ACC9), primaryColor: Color(0xff40ACC9),
bottomSheetTheme: BottomSheetThemeData( bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
backgroundColor: HexColor('#E0E0E0')),
cursorColor: Colors.grey, cursorColor: Colors.grey,
iconTheme: IconThemeData(), iconTheme: IconThemeData(),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
@ -84,11 +83,11 @@ class MyApp extends StatelessWidget {
brightness: Brightness.dark, brightness: Brightness.dark,
elevation: 10.0, elevation: 10.0,
actionsIconTheme: IconThemeData( actionsIconTheme: IconThemeData(
color: Colors.grey[800], color: Color(0xff40ACC9),
), ),
), ),
), ),
initialRoute: HOME, initialRoute: SPLASH,
routes: routes, routes: routes,
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
), ),

@ -235,7 +235,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
return children; return children;
}, },
), ),
onDaySelected: (date, events) { onDaySelected: (date, events,holidays) {
_onDaySelected(date, events); _onDaySelected(date, events);
_animationController.forward(from: 0.0); _animationController.forward(from: 0.0);
}, },

@ -348,7 +348,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
return children; return children;
}, },
), ),
onDaySelected: (date, event) { onDaySelected: (date, event,holidays) {
_onDaySelected(date, event,); _onDaySelected(date, event,);
_animationController.forward(from: 0.0); _animationController.forward(from: 0.0);
}, },

@ -69,21 +69,9 @@ class _HomePageState extends State<HomePage> {
'assets/images/dq_home_page_bg_image.png'), 'assets/images/dq_home_page_bg_image.png'),
fit: BoxFit.cover), fit: BoxFit.cover),
), ),
child: Stack(
children: <Widget>[
Positioned(
top: 15,
left: 5,
right: 5,
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Container(),
),
)
],
),
), ),
Container(width: double.infinity, height: 125), Container(width: double.infinity, height:projectViewModel.isArabic ? 120:110),
], ],
), ),
Positioned( Positioned(
@ -93,7 +81,7 @@ class _HomePageState extends State<HomePage> {
child: (!model.isLogin && projectViewModel.user == null) child: (!model.isLogin && projectViewModel.user == null)
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: 180, height: 160,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -166,7 +154,7 @@ class _HomePageState extends State<HomePage> {
) )
: Container( : Container(
width: double.infinity, width: double.infinity,
height: projectViewModel.isArabic?180: 150, height: projectViewModel.isArabic ? 175: 160,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -274,7 +262,7 @@ class _HomePageState extends State<HomePage> {
bold: true, bold: true,
), ),
Texts( Texts(
"Height", TranslationBase.of(context).height,
color: Colors.white, color: Colors.white,
fontSize: 10, fontSize: 10,
), ),
@ -305,7 +293,7 @@ class _HomePageState extends State<HomePage> {
), ),
Texts( Texts(
"Weight", TranslationBase.of(context).weight,
color: Colors.white, color: Colors.white,
fontSize: 10, fontSize: 10,
) )
@ -334,7 +322,7 @@ class _HomePageState extends State<HomePage> {
color: Colors.white, color: Colors.white,
), ),
Texts( Texts(
"Blood Type", TranslationBase.of(context).bloodType,
color: Colors.white, color: Colors.white,
fontSize: 10, fontSize: 10,
) )
@ -773,8 +761,7 @@ class DashboardItem extends StatelessWidget {
? DecorationImage( ? DecorationImage(
image: ExactAssetImage('assets/images/$imageName'), image: ExactAssetImage('assets/images/$imageName'),
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: new ColorFilter.mode( colorFilter: new ColorFilter.mode(Colors.black.withOpacity(opacity), BlendMode.dstIn),
Colors.black.withOpacity(opacity), BlendMode.dstIn),
) )
: icon, : icon,
), ),

@ -52,8 +52,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
ProjectViewModel projectProvider; ProjectViewModel projectProvider;
///inject the user data ///inject the user data
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
final authService = new AuthProvider(); final authService = new AuthProvider();
@ -374,11 +373,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: pageController, controller: pageController,
children: [ children: [
HomePage( HomePage(goToMyProfile: () {_changeCurrentTab(1);},),
goToMyProfile: () {
_changeCurrentTab(1);
},
),
MedicalProfilePage(), MedicalProfilePage(),
BookingOptions(), BookingOptions(),
Container(), Container(),

@ -62,18 +62,13 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Container( Container(
width: double.infinity, width: double.infinity,
height: 210, height: 210,
decoration: BoxDecoration(
image: DecorationImage(
image: ExactAssetImage(
'assets/images/timeline_bg.png'),
fit: BoxFit.cover),
),
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/timeline_bg.png', 'assets/images/timeline_bg.png',
fit: BoxFit.cover, fit: BoxFit.cover,
width: double.infinity, width: double.infinity,
// color: Colors.black.withOpacity(0.0)
), ),
if(model.authenticatedUserObject.isLogin) if(model.authenticatedUserObject.isLogin)
ListView.builder( ListView.builder(
@ -158,48 +153,52 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: HomePrescriptionsPage(), page: DoctorHomePage(),
), ),
); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context)
.medicines, .myDoctor,
imagePath: 'prescription_icon.png', imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.medicinesSubtitle, .myDoctorSubtitle,
), ),
), ),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => Navigator.push( onTap: () {
context, Navigator.push(
FadePage( context,
page: VitalSignDetailsScreen(), FadePage(
), page: HomePrescriptionsPage(),
), ),
);
},
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context)
.vitalSigns, .medicines,
imagePath: 'vital_signs.png', imagePath: 'prescription_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.vitalSignsSubtitle, .medicinesSubtitle,
), ),
), ),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => Navigator.push(context, onTap: () {
FadePage(page: ActiveMedicationsPage())), Navigator.push(context,
FadePage(page: InsuranceCard()));
},
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context)
.myMedical, .insurance,
imagePath: 'active_medications.png', imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.myMedicalSubtitle, .insuranceSubtitle,
), ),
), ),
), ),
@ -210,20 +209,12 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap:()=> Navigator.push(context, FadePage(page: AllergiesPage())) ,
Navigator.push(
context,
FadePage(
page: DoctorHomePage(),
),
);
},
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context).allergies,
.myDoctor, imagePath: 'my_allergies_icon.png',
imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.myDoctorSubtitle, .allergiesSubtitle,
), ),
), ),
), ),
@ -234,13 +225,13 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: EyeMeasurementsPage())); page: PatientSickLeavePage()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).eye, title: TranslationBase.of(context).sick,
imagePath: 'eye_measurement_icon.png', imagePath: 'sick_leaves_icons.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.eyeSubtitle, .sickSubtitle,
), ),
), ),
), ),
@ -249,82 +240,20 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(context,
FadePage(page: InsuranceCard())); FadePage(page: InsuranceApproval()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context)
.insurance, .insuranceApproval,
imagePath: 'insurance_card_icon.png', imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.insuranceSubtitle, .insuranceApprovalSubtitle,
), ),
), ),
), ),
], ],
), ),
Row(children: <Widget>[ Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: InsuranceUpdate()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.updateInsurance,
imagePath: 'insurance_update_icon_.png',
subTitle: TranslationBase.of(context)
.updateInsuranceSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: InsuranceApproval()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.insuranceApproval,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context)
.insuranceApprovalSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap:()=> Navigator.push(context, FadePage(page: AllergiesPage())) ,
child: MedicalProfileItem(
title: TranslationBase.of(context).allergies,
imagePath: 'my_allergies_icon.png',
subTitle: TranslationBase.of(context)
.allergiesSubtitle,
),
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: MyVaccines()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.myVaccines,
imagePath: 'my_vaccines_icon.png',
subTitle: TranslationBase.of(context)
.myVaccinesSubtitle,
),
),
),
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
@ -334,164 +263,17 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: title:
TranslationBase.of(context).medical, TranslationBase.of(context).medical,
imagePath: 'medical_reports_icon.png', imagePath: 'medical_reports_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.medicalSubtitle, .medicalSubtitle,
), ),
), ),
), ),
Expanded( Expanded(child: Container(),),
flex: 1, Expanded(child: Container(),),
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: MonthlyReportsPage()));
},
child: MedicalProfileItem(
title:
TranslationBase.of(context).monthly,
imagePath: 'monthly_reports_icon.png',
subTitle: TranslationBase.of(context)
.monthlySubtitle,
),
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: PatientSickLeavePage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png',
subTitle: TranslationBase.of(context)
.sickSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: MyBalancePage()));
},
child: MedicalProfileItem(
title:
TranslationBase.of(context).myBalance,
imagePath: 'check-in.png',
subTitle: TranslationBase.of(context)
.myBalanceSubtitle,
),
),
),
Expanded(
flex: 1,
child: MedicalProfileItem(
title:
TranslationBase.of(context).patientCall,
imagePath: 'medical_history_icon.png',
subTitle: TranslationBase.of(context)
.patientCallSubtitle,
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
//TODO
onTap: () {
Navigator.push(
context, FadePage(page: SmartWatchInstructions()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.smartWatches,
imagePath: 'smartwatch_icon.png',
subTitle: TranslationBase.of(context)
.smartWatchesSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: MyTrackers()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.myTrackers,
imagePath: 'my_tracker_icon.png',
subTitle: TranslationBase.of(context)
.myTrackersSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: (){
Navigator.push(context,
FadePage(page: AskDoctorHomPage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).askYour,
imagePath: 'ask_doctor_icon.png',
subTitle: TranslationBase.of(context)
.askYourSubtitle,
),
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
//TODO
// onTap: () {
// Navigator.push(
// context, FadePage(page: DoctorHomePage()));
// },
child: MedicalProfileItem(
title:
TranslationBase.of(context).internet,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context)
.internetSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
// onTap: () {
// Navigator.push(
// context, FadePage(page: InsuranceApproval()));
// },
child: MedicalProfileItem(
title:
TranslationBase.of(context).chatbot,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context)
.chatbotSubtitle,
),
),
),
Expanded(
flex: 1,
child: Container(),
),
]), ]),
SizedBox(height: MediaQuery.of(context).size.height * 0.12,) SizedBox(height: MediaQuery.of(context).size.height * 0.12,)
], ],
), ),
@ -529,6 +311,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
" " + " " +
model.user.lastName, model.user.lastName,
color: Colors.white, color: Colors.white,
bold: true,
), ),
Texts( Texts(

@ -13,9 +13,11 @@ import 'package:diplomaticquarterapp/pages/family/add-family-member.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/symtom-checker.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/symtom-checker.dart';
import 'package:diplomaticquarterapp/splashPage.dart';
const String INIT_ROUTE = '/'; const String INIT_ROUTE = '/';
const String HOME = '/'; const String HOME = 'home';
const String SPLASH = '/';
const String LOGIN = 'login'; const String LOGIN = 'login';
const String WELCOME_LOGIN = 'welcome-login'; const String WELCOME_LOGIN = 'welcome-login';
const String LOGIN_TYPE = 'login-type'; const String LOGIN_TYPE = 'login-type';
@ -32,6 +34,7 @@ const String SYMPTOM_CHECKER = 'symptom-checker';
const String SYMPTOM_CHECKER_INFO = 'symptom-checker-info'; const String SYMPTOM_CHECKER_INFO = 'symptom-checker-info';
const String SELECT_GENDER = 'select-gender'; const String SELECT_GENDER = 'select-gender';
var routes = { var routes = {
SPLASH: (_) => SplashScreen(),
HOME: (_) => LandingPage(), HOME: (_) => LandingPage(),
WELCOME_LOGIN: (_) => WelcomeLogin(), WELCOME_LOGIN: (_) => WelcomeLogin(),
LOGIN_TYPE: (_) => LoginType(), LOGIN_TYPE: (_) => LoginType(),

@ -0,0 +1,36 @@
import 'dart:async';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:flutter/material.dart';
class SplashScreen extends StatefulWidget {
@override
_SplashScreenState createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
@override
void initState() {
super.initState();
Timer(
Duration(seconds: 3),
() => Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (BuildContext context) => LandingPage(),
),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset('assets/images/DQ/DQ_logo.png'),
),
),
);
}
}

@ -730,6 +730,7 @@ class TranslationBase {
String get yearOld => localizedValues['years-old'][locale.languageCode]; String get yearOld => localizedValues['years-old'][locale.languageCode];
String get book => localizedValues['Book'][locale.languageCode]; String get book => localizedValues['Book'][locale.languageCode];
String get appointmentLabel => localizedValues['AppointmentLabel'][locale.languageCode]; String get appointmentLabel => localizedValues['AppointmentLabel'][locale.languageCode];
String get bloodType => localizedValues['BloodType'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -18,7 +18,7 @@ class SecondaryButton extends StatefulWidget {
this.label = "", this.label = "",
this.icon, this.icon,
this.iconOnly = false, this.iconOnly = false,
this.color:const Color.fromRGBO(63, 72, 74, 1), this.color ,
this.textColor, this.textColor,
this.onTap, this.onTap,
this.loading: false, this.loading: false,
@ -185,7 +185,7 @@ class _SecondaryButtonState extends State<SecondaryButton>
height: MediaQuery.of(context).size.width * 2.2, height: MediaQuery.of(context).size.width * 2.2,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: widget.color, color: widget.color?? Theme.of(context).primaryColor,
), ),
), ),
), ),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -6,6 +7,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class TimeLineWidget extends StatelessWidget { class TimeLineWidget extends StatelessWidget {
final bool isUp; final bool isUp;
@ -15,6 +17,7 @@ class TimeLineWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Stack( return Stack(
children: <Widget>[ children: <Widget>[
Container( Container(
@ -24,14 +27,14 @@ class TimeLineWidget extends StatelessWidget {
child: Center( child: Center(
child: Divider( child: Divider(
color: Colors.white, color: Colors.white,
height: 3, height: 2,
thickness: 3, thickness: 2,
), ),
), ),
), ),
if (isUp) if (isUp)
Positioned( Positioned(
top: 15, top: projectViewModel.isArabic ? 15 : 18,
child: Container( child: Container(
margin: EdgeInsets.only(left: 2, right: 2), margin: EdgeInsets.only(left: 2, right: 2),
child: Column( child: Column(
@ -58,15 +61,15 @@ class TimeLineWidget extends StatelessWidget {
), ),
Container( Container(
height: 20, height: 20,
width: 3, width: 2,
color: Colors.white, color: Colors.white,
), ),
Container( Container(
width: 15, width: 15,
height: 15, height: 15,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.yellow[700], color: Theme.of(context).primaryColor,
border: Border.all(color: Colors.yellow[700], width: 2), border: Border.all(color: Theme.of(context).primaryColor, width: 2),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(25.0), Radius.circular(25.0),
@ -90,7 +93,7 @@ class TimeLineWidget extends StatelessWidget {
) )
else else
Positioned( Positioned(
top: 65, top:projectViewModel.isArabic ? 63 : 70,
child: Container( child: Container(
margin: EdgeInsets.only(left: 2, right: 2), margin: EdgeInsets.only(left: 2, right: 2),
child: Column( child: Column(
@ -110,8 +113,8 @@ class TimeLineWidget extends StatelessWidget {
width: 15, width: 15,
height: 15, height: 15,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.yellow[700], color: Theme.of(context).primaryColor,
border: Border.all(color: Colors.yellow[700], width: 2), border: Border.all(color: Theme.of(context).primaryColor, width: 2),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(25.0), Radius.circular(25.0),
@ -120,7 +123,7 @@ class TimeLineWidget extends StatelessWidget {
), ),
Container( Container(
height: 20, height: 20,
width: 3, width: 2,
color: Colors.white, color: Colors.white,
), ),
LargeAvatar( LargeAvatar(

@ -16,11 +16,7 @@ class ArrowBack extends StatelessWidget {
onTap: Feedback.wrapForTap(() { onTap: Feedback.wrapForTap(() {
onTap != null ? onTap() : Navigator.pop(context); onTap != null ? onTap() : Navigator.pop(context);
}, context), }, context),
child: Icon( child: Icon(Icons.arrow_back_ios, color: Colors.white),
projectViewModel.isArabic
? Icons.arrow_forward_ios
: Icons.arrow_back_ios,
color: Colors.white),
); );
} }
} }

@ -46,8 +46,8 @@ class NotAutPage extends StatelessWidget {
height: MediaQuery.of(context).size.height * 0.55, height: MediaQuery.of(context).size.height * 0.55,
width: MediaQuery.of(context).size.width * 0.50, width: MediaQuery.of(context).size.width * 0.50,
child: Image.asset(projectViewModel.isArabic child: Image.asset(projectViewModel.isArabic
? 'assets/images/wifi-EN.png' ? 'assets/images/Wifi-AR.png'
: 'assets/images/Wifi-AR.png'), : 'assets/images/wifi-EN.png'),
), ),
), ),
SizedBox( SizedBox(

Loading…
Cancel
Save