diff --git a/assets/images/habib-logo.png b/assets/images/habib-logo.png new file mode 100644 index 00000000..bcb6a42b Binary files /dev/null and b/assets/images/habib-logo.png differ diff --git a/assets/images/logo.png b/assets/images/logo.png new file mode 100644 index 00000000..0d9e4a56 Binary files /dev/null and b/assets/images/logo.png differ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7cb0159c..2952e734 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -11,5 +11,17 @@ const Map> localizedValues = { 'services': {'en': 'SERVICES', 'ar': 'الخدمات'}, 'mySchedule': {'en': 'My Schedule', 'ar': 'جدولي'}, 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, - + 'login': {'en': 'Login', 'ar': 'تسجيل الدخول'}, + 'loginregister': {'en': 'Login / Register', 'ar': 'دخولتسجيل'}, + 'welcome': {'en': 'Welcome', 'ar': 'أهلا بك'}, + 'welcome_text': { + 'en': 'Dr. Sulaiman Al Habib Mobile Application ', + 'ar': 'الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك' + }, + 'welcome_text2': { + 'en': 'Have you visited AlHabib Medical Group before? ', + 'ar': 'الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك' + }, + 'yes': {'en': 'Yes', 'ar': 'نعم'}, + 'no': {'en': 'No', 'ar': 'لا'} }; diff --git a/lib/main.dart b/lib/main.dart index dff61ac6..e208a45a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/pages/home_page.dart'; import 'package:diplomaticquarterapp/pages/landing_page.dart'; import 'package:diplomaticquarterapp/providers/project_provider.dart'; +import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; @@ -61,22 +62,18 @@ class MyApp extends StatelessWidget { splashColor: Colors.transparent, primaryColor: Colors.grey, cursorColor: Color.fromRGBO(78, 62, 253, 1.0), - iconTheme:IconThemeData( - - ) , + iconTheme: IconThemeData(), appBarTheme: AppBarTheme( - color: Color.fromRGBO(247, 248, 251, 1), - brightness: Brightness.light, + color: Colors.grey, + // brightness: Brightness.light, elevation: 0.0, actionsIconTheme: IconThemeData( color: Colors.grey[800], ), ), ), - initialRoute: '/', - routes: { - '/': (context) => LandingPage() - }, + initialRoute: HOME, + routes: routes, debugShowCheckedModeBanner: false, ), ), diff --git a/lib/pages/landing_page.dart b/lib/pages/landing_page.dart index 116abcdc..4fb12a7a 100644 --- a/lib/pages/landing_page.dart +++ b/lib/pages/landing_page.dart @@ -31,6 +31,7 @@ class _LandingPageState extends State { return Scaffold( appBar: AppBar( elevation: 0, + backgroundColor: Colors.grey, textTheme: TextTheme( headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart new file mode 100644 index 00000000..fa9d7d52 --- /dev/null +++ b/lib/pages/login/welcome.dart @@ -0,0 +1,75 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class WelcomeLogin extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).welcome, + body: Padding( + padding: EdgeInsets.all(20), + child: Column( + children: [ + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/habib-logo.png', + height: 80, + width: 80, + ), + Text( + TranslationBase.of(context).welcome, + style: TextStyle(fontSize: 30), + textAlign: TextAlign.left, + ), + Text( + TranslationBase.of(context).welcomeText, + style: TextStyle(fontSize: 24), + textAlign: TextAlign.left, + ), + Text( + TranslationBase.of(context).welcomeText2, + style: TextStyle(fontSize: 24), + textAlign: TextAlign.left, + ) + ]), + ), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: RaisedButton( + color: Colors.red[900], + textColor: Colors.white, + child: Text(TranslationBase.of(context).yes), + onPressed: () => {}, + )) + ], + ), + Row( + children: [ + Expanded( + child: RaisedButton( + child: Text(TranslationBase.of(context).no), + onPressed: () => {}, + )) + ], + ), + ], + )) + ], + ))); + } +} diff --git a/lib/routes.dart b/lib/routes.dart new file mode 100644 index 00000000..d25f9988 --- /dev/null +++ b/lib/routes.dart @@ -0,0 +1,15 @@ +import 'package:diplomaticquarterapp/pages/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/login/welcome.dart'; + +const String INIT_ROUTE = '/'; +const String ROOT = 'root'; +const String HOME = '/'; +const String LOGIN = 'login'; +const String WELCOME_LOGIN = 'welcome-login'; +var routes = { + // ROOT: (_) => RootPage(), + HOME: (_) => LandingPage(), + WELCOME_LOGIN: (_) => WelcomeLogin(), + + // LIVECARE_END_DIALOG: (_) => EndCallDialogBox() +}; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index f9630b6d..faff53a1 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -37,8 +37,16 @@ class TranslationBase { String get replay2 => localizedValues['replay2'][locale.languageCode]; String get logout => localizedValues['logout'][locale.languageCode]; - - + String get login => localizedValues['login'][locale.languageCode]; + String get loginregister => + localizedValues['loginregister'][locale.languageCode]; + String get welcome => localizedValues['welcome'][locale.languageCode]; + String get welcomeText => + localizedValues['welcome_text'][locale.languageCode]; + String get welcomeText2 => + localizedValues['welcome_text2'][locale.languageCode]; + String get yes => localizedValues['yes'][locale.languageCode]; + String get no => localizedValues['no'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 6474e05b..9960c59b 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/list/ListContainer.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -5,8 +6,6 @@ import 'package:flutter/material.dart'; import '../../config/size_config.dart'; import 'drawer_item_widget.dart'; - - class AppDrawer extends StatefulWidget { @override _AppDrawerState createState() => _AppDrawerState(); @@ -16,6 +15,7 @@ class _AppDrawerState extends State { @override Widget build(BuildContext context) { return ListContainer( + widthFactor: SizeConfig.widthMultiplier * .18, child: Container( color: Colors.white, child: Drawer( @@ -31,11 +31,11 @@ class _AppDrawerState extends State { child: InkWell( child: DrawerHeader( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( child: Image.asset('assets/images/logo.png'), - margin: EdgeInsets.only(top: 10, bottom: 15), + margin: EdgeInsets.all(20), ), SizedBox( height: 1, @@ -44,36 +44,18 @@ class _AppDrawerState extends State { ), ), SizedBox(height: 15), - CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, - backgroundColor: Colors.white, - //TODO add backgroundImage: NetworkImage(''), - ), - Padding( - padding: EdgeInsets.only(top: 10), - child: Texts( - 'Patient', - color: Colors.black, - fontSize: SizeConfig.textMultiplier * 2, - )), - Texts("Director of medical records", - //TODO: Make The Dr Title Dynamic and check overflow issue. - - color: Colors.black87), - RaisedButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(18.0), - side: BorderSide(color: Colors.red), - ), - child: Texts( - TranslationBase.of(context).logout, - color: Colors.white, - ), - onPressed: () async { - Navigator.pop(context); - //TODO add await helpers.logout(); - }, - ), + // CircleAvatar( + // radius: SizeConfig.imageSizeMultiplier * 12, + // backgroundColor: Colors.white, + // //TODO add backgroundImage: NetworkImage(''), + // ), + // Padding( + // padding: EdgeInsets.only(top: 10), + // child: Texts( + // 'Patient', + // color: Colors.black, + // fontSize: SizeConfig.textMultiplier * 2, + // )), ], ), ), @@ -84,10 +66,12 @@ class _AppDrawerState extends State { ), InkWell( child: DrawerItem( - TranslationBase.of(context).settings, Icons.settings), + TranslationBase.of(context).loginregister, + Icons.lock), onTap: () { - Navigator.pop(context); - //TODO add fun + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); }, ), ], diff --git a/lib/widgets/drawer/drawer_item_widget.dart b/lib/widgets/drawer/drawer_item_widget.dart index f7c6bf54..991d34b0 100644 --- a/lib/widgets/drawer/drawer_item_widget.dart +++ b/lib/widgets/drawer/drawer_item_widget.dart @@ -24,7 +24,7 @@ class _DrawerItemState extends State { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10), + margin: EdgeInsets.only(top: 5, bottom: 15, left: 10, right: 10), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -33,21 +33,26 @@ class _DrawerItemState extends State { color: widget.iconColor, size: SizeConfig.imageSizeMultiplier * 5, ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - widget.title, - color: widget.textColor, - fontSize: SizeConfig.textMultiplier * 2.3, - ), - Texts( - widget.subTitle, - color: widget.textColor, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ], - ), + Padding( + padding: widget.subTitle == '' + ? EdgeInsets.only(top: 20) + : EdgeInsets.only(top: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + widget.title, + color: widget.textColor, + fontSize: SizeConfig.textMultiplier * 2.3, + ), + Texts( + widget.subTitle, + color: widget.textColor, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ], + ), + ) ], ), ); diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 27c0a826..c6fc690b 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -1,8 +1,8 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/providers/project_provider.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import '../progress_indicator/app_loader_widget.dart'; import 'arrow_back.dart'; -import 'file:///D:/Mohammad/diplomatic_quarter_app/lib/widgets/progress_indicator/app_loader_widget.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart';