From 8dd38a8b3c0e2eee7b3f33921f094dc9ab977536 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 20 Jul 2020 09:34:55 +0300 Subject: [PATCH] no message --- assets/images/id_card_icon.png | Bin 0 -> 1924 bytes assets/images/my_file_white_icon.png | Bin 0 -> 2109 bytes lib/config/localized_values.dart | 18 ++- lib/pages/login/forgot-password.dart | 87 +++++++++++ lib/pages/login/login-type.dart | 139 ++++++++++++++++++ lib/pages/login/login.dart | 106 +++++++++++++ lib/pages/login/welcome.dart | 7 +- lib/routes.dart | 8 +- lib/uitl/translations_delegate_base.dart | 12 ++ lib/widgets/card/rounded_container.dart | 88 +++++++++++ .../input/date_picker/button_actions.dart | 2 +- lib/widgets/input/text_field.dart | 46 ++---- lib/widgets/mobile-no/mobile_no.dart | 75 ++++++++++ lib/widgets/text/app_texts_widget.dart | 74 ++++++++++ 14 files changed, 622 insertions(+), 40 deletions(-) create mode 100644 assets/images/id_card_icon.png create mode 100644 assets/images/my_file_white_icon.png create mode 100644 lib/pages/login/forgot-password.dart create mode 100644 lib/pages/login/login-type.dart create mode 100644 lib/pages/login/login.dart create mode 100644 lib/widgets/card/rounded_container.dart create mode 100644 lib/widgets/mobile-no/mobile_no.dart create mode 100644 lib/widgets/text/app_texts_widget.dart diff --git a/assets/images/id_card_icon.png b/assets/images/id_card_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..9665060423d17540e312f259817dab4b88cae742 GIT binary patch literal 1924 zcmV-~2YdL5P) zd5jcA6o)?+L=Xf7BO)sbh>8k$prWE8sPVv?sEP5G2nG|0Xk1Z1JiseKqXtccjsKW< zM5ACt5fWqKg$F@lRU|?1z(rU&ycWSceM5$}YNmU-`kLu4>10#gU0YMXuIj4yURAfD zG@XFcfT2J=(5}q&Ic{hL)&fg_MZoVtbL|N{25bg)^5ltdHv;W*Jz}T5*8L`nHjfkv)X{R0qz$Q^`bsTBEc&zn9i-6bS`;2z z>ou1m##%HwONuzva6+aLyVZKFr3letgF&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cgg_SwU zFy3P2`d2&Kx0AM5RL_Z*VH!ed`nJ{1a24Cv%eJbIEvlfT96KG=F>VrXM`4AR-|q*C zke??Q`d({@9!HjFI4v5ovde;>{0pAhImXx?==>YH=|3iv>y7fSSf}&YSgPfD$-g6? zo@29WVKlCkTUXFYSI7=kOF)`Gvr|oobxeG(GS8D>Wf?^NAK)L8NzS}Lwp=U#0000< KMNUMnLSTZHjFeLV literal 0 HcmV?d00001 diff --git a/assets/images/my_file_white_icon.png b/assets/images/my_file_white_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..6bd9b935925cc843dec9e738568e3292f278d984 GIT binary patch literal 2109 zcmV-D2*US?P)3(R6#m|OEk$;!pa|j;K*S&_8kPj&hD(e_qakj=HAdnB#>9yF!}W(zNnCI@BF4Cd z7$i2BXjO=aU|F<8K@(cE2#P`x3Z?D4X2^HVFx+?FoqOlaTwdRoOw-J&!+coaYz0IxvV4d7t_J-aba2T%pzH+KsxPNOma zsC`B;9l)mmwrTh#QEmwlBFJ>Zis)Sz1Gp;9M2X(+r6Rpuq0#~1ypXyticzO1d)QH^ zn&=$D1n0+WRGtogXh4yuq=Q<5kJ6V9oGVQM!B~Jz~=zA(3ceY ztaboP0Bn-3_hQ|9rE4PqTnL~CNe+@FN8-hErz!XE1@J*gyMyZ6PVN66@{1z6zL^pC zV1Bq4p;A%DDE4|jUIXwLfR+e?ski{Z9M=6ffUjfJAvE$4w#UaVb_QMq!ZQ3)M2NEr zz#9OXJ$2&ive^RYTE|k7Q{Dty%ghss39!tElGQ zB4((fnvU8>K4rs^P9+4XQsga$41-@E`K%H;WHbruP-3OtDNDc9Nd6TZg>-7Xe+VBs zYzu7~7!WjW;6NJm4GXAT4@dXi;u&Dr^CLuCB zW+QwELGA%?B|{8XDR7V4HB7mF1%UGvxiTb6e9<39sk}*XiYkd>P`%JlER*K4TAEAn zkyY|>Em2ISrxeGOGX_M-YD6(fPwDxD`Zm(xr)kzn7ouHbq%f!}!q{2M>HBD=FK90V z!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iPHU@;^KqK z%E5MS-rUoThfW?(E*P(Dczs3uI8K@wu9U)MtNedPCa_zr5EfjTxn1#~9`ZzPI-jQT nPgKesVrovDc<}atunNF`qlPXy0&X&600000NkvXXu0mjfzG~J} literal 0 HcmV?d00001 diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2952e734..1360d80e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -23,5 +23,21 @@ const Map> localizedValues = { 'ar': 'الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك' }, 'yes': {'en': 'Yes', 'ar': 'نعم'}, - 'no': {'en': 'No', 'ar': 'لا'} + 'no': {'en': 'No', 'ar': 'لا'}, + "logintyperadio": { + "en": "Choose from below options to login to your medical file.", + "ar": "اختر من الخيارات أدناه لتسجيل الدخول إلى ملفك الطبي." + }, + "registernow": {"en": "Register Now", "ar": "تسجيل الان"}, + "nationalID": {"en": "National ID", "ar": "رقم الهوية"}, + "fileNo": {"en": "File Number", "ar": "رقم الملف"}, + "forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"}, + "enter-national-id": { + "en": "Please enter mobile number and national ID / Iqama", + "ar": "الرجاء إدخال رقم الجوال والهوية الوطنية / الاقامة" + }, + "profile-info": { + "en": "Please enter profile information", + "ar": "الرجاء إدخال معلومات الملف الشخصي" + }, }; diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart new file mode 100644 index 00000000..4a1069e7 --- /dev/null +++ b/lib/pages/login/forgot-password.dart @@ -0,0 +1,87 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ForgotPassword extends StatelessWidget { + final String selectedType = 'Saudi Arabia'; + final TextEditingController nationalIDorFile = null; + final TextEditingController mobileNo = null; + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).login, + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.only(top: 10, left: 10, right: 10), + height: SizeConfig.realScreenHeight * .8, + width: SizeConfig.realScreenWidth, + child: Column(children: [ + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context).enterNationalId, + fontSize: SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.left, + )), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: selectedType, + iconSize: 40, + elevation: 16, + // selectedItemBuilder: + // (BuildContext context) {}, + onChanged: (String newValue) => {}, + items: [ + 'Saudi Arabia', + 'Dubai', + ].map>( + (String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList()))), + ], + ), + MobileNo(controller: mobileNo), + ], + ), + ), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: RaisedButton( + color: Colors.grey, + textColor: Colors.white, + child: Text(TranslationBase.of(context).submit), + onPressed: () => {}, + )) + ], + ), + ], + )) + ]), + ))); + } +} diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart new file mode 100644 index 00000000..713333b4 --- /dev/null +++ b/lib/pages/login/login-type.dart @@ -0,0 +1,139 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/routes.dart'; + +class LoginType extends StatelessWidget { + static int loginType = 0; + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).welcome, + body: Padding( + padding: EdgeInsets.all(20), + child: Column( + children: [ + Expanded( + flex: 4, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/habib-logo.png', + height: 80, + width: 80, + ), + AppText( + TranslationBase.of(context).logintypeRadio, + fontSize: SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.left, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + InkWell( + onTap: () => { + LoginType.loginType = 2, + Navigator.of(context) + .pushNamed(LOGIN_PAGE) + }, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: + EdgeInsets.fromLTRB(20, 10, 20, 10), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/id_card_icon.png', + height: 60, + width: 70, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context) + .nationalID, + fontSize: + SizeConfig.textMultiplier * 3, + ) + ], + ), + ))), + InkWell( + onTap: () => { + LoginType.loginType = 1, + Navigator.of(context) + .pushNamed(LOGIN_PAGE) + }, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: + EdgeInsets.fromLTRB(25, 10, 25, 10), + child: Column( + children: [ + Image.asset( + 'assets/images/my_file_white_icon.png', + height: 60, + width: 70, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).fileNo, + fontSize: + SizeConfig.textMultiplier * 3, + ) + ], + ), + ))) + ], + ), + Divider( + color: Colors.grey, + height: 2, + ), + Center( + child: AppText( + TranslationBase.of(context).forgotPassword, + fontSize: SizeConfig.textMultiplier * 3, + margin: 10, + underline: true)) + ]), + ), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: RaisedButton( + color: Colors.grey, + textColor: Colors.white, + child: + Text(TranslationBase.of(context).registerNow), + onPressed: () => {}, + )) + ], + ), + ], + )) + ], + ))); + } +} diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart new file mode 100644 index 00000000..de649382 --- /dev/null +++ b/lib/pages/login/login.dart @@ -0,0 +1,106 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/pages/login/login-type.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class Login extends StatelessWidget { + final String _selectedType = 'Saudi Arabia'; + final TextEditingController nationalIDorFile = null; + final int loginType = LoginType.loginType; + final TextEditingController mobileNo = null; + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).login, + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.only(top: 10, left: 10, right: 10), + height: SizeConfig.realScreenHeight * .8, + width: SizeConfig.realScreenWidth, + child: Column(children: [ + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context).enterNationalId, + fontSize: SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.left, + )), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: _selectedType, + iconSize: 40, + elevation: 16, + // selectedItemBuilder: + // (BuildContext context) {}, + onChanged: (String newValue) => {}, + items: [ + 'Saudi Arabia', + 'Dubai', + ].map>( + (String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList()))), + ], + ), + MobileNo(controller: mobileNo), + Container( + child: TextFields( + controller: nationalIDorFile, + prefixIcon: Icon( + loginType == 1 + ? Icons.receipt + : Icons.chrome_reader_mode, + color: Colors.red), + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + hintText: loginType == 1 + ? TranslationBase.of(context).fileNo + : TranslationBase.of(context).nationalID, + )) + ], + ), + ), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: RaisedButton( + color: Colors.grey, + textColor: Colors.white, + child: Text(TranslationBase.of(context).login), + onPressed: () => {}, + )) + ], + ), + ], + )) + ]), + ))); + } +} diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index fa9d7d52..021b2bfc 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -4,6 +4,7 @@ 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'; +import 'package:diplomaticquarterapp/routes.dart'; class WelcomeLogin extends StatelessWidget { @override @@ -54,7 +55,11 @@ class WelcomeLogin extends StatelessWidget { color: Colors.red[900], textColor: Colors.white, child: Text(TranslationBase.of(context).yes), - onPressed: () => {}, + onPressed: () => { + Navigator.of(context).pushNamed( + LOGIN_TYPE, + ) + }, )) ], ), diff --git a/lib/routes.dart b/lib/routes.dart index d25f9988..8e4f55ed 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,15 +1,19 @@ import 'package:diplomaticquarterapp/pages/landing_page.dart'; import 'package:diplomaticquarterapp/pages/login/welcome.dart'; +import 'package:diplomaticquarterapp/pages/login/login-type.dart'; +import 'package:diplomaticquarterapp/pages/login/login.dart'; const String INIT_ROUTE = '/'; const String ROOT = 'root'; const String HOME = '/'; const String LOGIN = 'login'; const String WELCOME_LOGIN = 'welcome-login'; +const String LOGIN_TYPE = 'login-type'; +const String LOGIN_PAGE = 'login-page'; var routes = { // ROOT: (_) => RootPage(), HOME: (_) => LandingPage(), WELCOME_LOGIN: (_) => WelcomeLogin(), - - // LIVECARE_END_DIALOG: (_) => EndCallDialogBox() + LOGIN_TYPE: (_) => LoginType(), + LOGIN_PAGE: (_) => Login(), }; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index faff53a1..ca48792c 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -47,6 +47,18 @@ class TranslationBase { localizedValues['welcome_text2'][locale.languageCode]; String get yes => localizedValues['yes'][locale.languageCode]; String get no => localizedValues['no'][locale.languageCode]; + String get logintypeRadio => + localizedValues['logintyperadio'][locale.languageCode]; + String get registerNow => localizedValues['registernow'][locale.languageCode]; + String get nationalID => localizedValues['nationalID'][locale.languageCode]; + String get fileNo => localizedValues['fileNo'][locale.languageCode]; + String get forgotPassword => + localizedValues['forgotFileNo'][locale.languageCode]; + String get enterNationalId => + localizedValues['enter-national-id'][locale.languageCode]; + String get profileInfo => + localizedValues['profile-info'][locale.languageCode]; + String get submit => localizedValues['submit'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/card/rounded_container.dart b/lib/widgets/card/rounded_container.dart new file mode 100644 index 00000000..a6cb36e2 --- /dev/null +++ b/lib/widgets/card/rounded_container.dart @@ -0,0 +1,88 @@ +import 'package:flutter/material.dart'; + +// OWNER : Ibrahim albitar +// DATE : 05-04-2020 +// DESCRIPTION : Custom widget for rounded container and custom decoration + +class RoundedContainer extends StatefulWidget { + final double width; + final double height; + final double raduis; + final Color backgroundColor; + final double margin; + final double elevation; + final bool showBorder; + final Color borderColor; + final bool customCornerRaduis; + final double topLeft; + final double bottomRight; + final double topRight; + final double bottomLeft; + final Widget child; + final double borderWidth; + + RoundedContainer( + {@required this.child, + this.width, + this.height, + this.raduis = 10, + this.backgroundColor = Colors.white, + this.margin = 10, + this.elevation = 1, + this.showBorder = false, + this.borderColor = Colors.red, + this.customCornerRaduis = false, + this.topLeft = 0, + this.topRight = 0, + this.bottomRight = 0, + this.bottomLeft = 0, + this.borderWidth = 1}); + + @override + _RoundedContainerState createState() => _RoundedContainerState(); +} + +class _RoundedContainerState extends State { + @override + Widget build(BuildContext context) { + return Container( + width: widget.width, + height: widget.height, + margin: EdgeInsets.all(widget.margin), + decoration: widget.showBorder == true + ? BoxDecoration( + color: Theme.of(context).primaryColor, + border: Border.all( + color: widget.borderColor, width: widget.borderWidth), + borderRadius: widget.customCornerRaduis + ? BorderRadius.only( + topLeft: Radius.circular(widget.topLeft), + topRight: Radius.circular(widget.topRight), + bottomRight: Radius.circular(widget.bottomRight), + bottomLeft: Radius.circular(widget.bottomLeft)) + : BorderRadius.circular(widget.raduis), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.1), + spreadRadius: 10, + blurRadius: 5, + offset: Offset(0, 5), // changes position of shadow + ), + ]) + : null, + child: Card( + margin: EdgeInsets.all(0), + shape: RoundedRectangleBorder( + borderRadius: widget.customCornerRaduis + ? BorderRadius.only( + topLeft: Radius.circular(widget.topLeft), + topRight: Radius.circular(widget.topRight), + bottomRight: Radius.circular(widget.bottomRight), + bottomLeft: Radius.circular(widget.bottomLeft)) + : BorderRadius.circular(widget.raduis), + ), + color: widget.backgroundColor, + child: widget.child, + )); + } +} diff --git a/lib/widgets/input/date_picker/button_actions.dart b/lib/widgets/input/date_picker/button_actions.dart index 685d6a77..c3fbea64 100644 --- a/lib/widgets/input/date_picker/button_actions.dart +++ b/lib/widgets/input/date_picker/button_actions.dart @@ -18,7 +18,7 @@ class ButtonActions extends StatelessWidget { widthFactor: 0.6, child: Button( onTap: onPositive, - title: "Confirm", + // title: "Confirm", ), ), ); diff --git a/lib/widgets/input/text_field.dart b/lib/widgets/input/text_field.dart index 6ab268d5..5c11f699 100644 --- a/lib/widgets/input/text_field.dart +++ b/lib/widgets/input/text_field.dart @@ -80,7 +80,7 @@ class TextFields extends StatefulWidget { final bool autoFocus; final IconData suffixIcon; final Color suffixIconColor; - final IconData prefixIcon; + final Icon prefixIcon; final VoidCallback onTap; final TextEditingController controller; final TextInputType keyboardType; @@ -198,10 +198,10 @@ class _TextFieldsState extends State { decoration: widget.bare ? null : BoxDecoration(boxShadow: [ - BoxShadow( - color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), - offset: Offset(0.0, 13.0), - blurRadius: focus ? 34.0 : 12.0) + // BoxShadow( + // color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), + // offset: Offset(0.0, 13.0), + // blurRadius: focus ? 34.0 : 12.0) ]), child: TextFormField( keyboardAppearance: Theme.of(context).brightness, @@ -257,19 +257,7 @@ class _TextFieldsState extends State { ? Colors.transparent : Theme.of(context).backgroundColor, suffixIcon: _buildSuffixIcon(), - prefixIcon: widget.type != "search" - ? widget.prefixIcon != null - ? Padding( - padding: EdgeInsets.only( - left: 28.0, top: 14.0, bottom: 14.0, right: 0), - child: Text( - "\$", - style: TextStyle( - fontSize: 14, fontWeight: FontWeight.w800), - ), - ) - : null - : Icon(EvaIcons.search, size: 20.0, color: Colors.grey[500]), + prefixIcon: widget.prefixIcon, errorStyle: TextStyle( fontSize: 14.0, fontWeight: widget.fontWeight, @@ -279,35 +267,23 @@ class _TextFieldsState extends State { color: Theme.of(context) .errorColor .withOpacity(widget.bare ? 0.0 : 0.5), - width: 2.0), + width: 1.0), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( color: Theme.of(context) .errorColor .withOpacity(widget.bare ? 0.0 : 0.5), - width: 2.0), + width: 1.0), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context) - .dividerColor - .withOpacity(widget.bare ? 0.0 : 1.0), - width: 2.0), + borderSide: BorderSide(color: Colors.grey, width: 1.0), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), disabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context) - .dividerColor - .withOpacity(widget.bare ? 0.0 : 1.0), - width: 2.0), + borderSide: BorderSide(color: Colors.grey, width: 1.0), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context) - .dividerColor - .withOpacity(widget.bare ? 0.0 : 1.0), - width: 2.0), + borderSide: BorderSide(color: Colors.grey, width: 1.0), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0), ), ), diff --git a/lib/widgets/mobile-no/mobile_no.dart b/lib/widgets/mobile-no/mobile_no.dart new file mode 100644 index 00000000..a4407e73 --- /dev/null +++ b/lib/widgets/mobile-no/mobile_no.dart @@ -0,0 +1,75 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +// OWNER : Ibrahim albitar +// DATE : 12-04-2020 +// DESCRIPTION : Customization for Texts in app + +class MobileNo extends StatefulWidget { + final bool disabled; + // final String data; + final String countryCode; + final double margin; + final double marginTop; + final double marginRight; + final double marginBottom; + final double marginLeft; + final TextEditingController controller; + MobileNo( + {this.disabled = false, + this.countryCode = '966', + this.marginTop = 0, + this.marginRight = 0, + this.marginBottom = 0, + this.controller, + this.marginLeft = 0, + this.margin = 0}); + + @override + _MobileNo createState() => _MobileNo(); +} + +class _MobileNo extends State { + @override + Widget build(BuildContext context) { + return Visibility( + child: Container( + padding: EdgeInsets.all(5), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(10)), + child: Row(children: [ + Expanded( + flex: 1, + child: Icon( + Icons.phone, + color: Colors.red, + )), + Expanded( + flex: 1, + child: Text( + widget.countryCode, + overflow: TextOverflow.clip, + )), + Expanded( + flex: 4, + child: Container( + margin: widget.margin != null + ? EdgeInsets.all(widget.margin) + : EdgeInsets.only( + top: widget.marginTop, + right: widget.marginRight, + bottom: widget.marginBottom, + left: widget.marginLeft), + child: TextField( + controller: widget.controller, + decoration: InputDecoration( + border: InputBorder.none, hintText: '5xxxxxxxx'), + ), + ), + ) + ]), + )); + } +} diff --git a/lib/widgets/text/app_texts_widget.dart b/lib/widgets/text/app_texts_widget.dart new file mode 100644 index 00000000..e3989719 --- /dev/null +++ b/lib/widgets/text/app_texts_widget.dart @@ -0,0 +1,74 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +// OWNER : Ibrahim albitar +// DATE : 12-04-2020 +// DESCRIPTION : Customization for Texts in app + +class AppText extends StatefulWidget { + final String data; + final Color color; + final FontWeight fontWeight; + final double fontSize; + final String fontFamily; + final double margin; + final double marginTop; + final double marginRight; + final double marginBottom; + final double marginLeft; + final bool visibility; + final TextAlign textAlign; + final Color backGroundcolor; + final bool underline; + AppText(this.data, + {this.color = Colors.black, + this.fontWeight = FontWeight.normal, + this.fontSize, + this.fontFamily = 'WorkSans', + this.margin, + this.marginTop = 0, + this.marginRight = 0, + this.marginBottom = 0, + this.marginLeft = 0, + this.visibility = true, + this.textAlign, + this.underline = false, + this.backGroundcolor = Colors.white}); + + @override + _AppTextState createState() => _AppTextState(); +} + +class _AppTextState extends State { + @override + Widget build(BuildContext context) { + return Visibility( + visible: widget.visibility, + child: Container( + margin: widget.margin != null + ? EdgeInsets.all(widget.margin) + : EdgeInsets.only( + top: widget.marginTop, + right: widget.marginRight, + bottom: widget.marginBottom, + left: widget.marginLeft), + child: Text( + widget.data, + textAlign: widget.textAlign, + overflow: TextOverflow.clip, + style: TextStyle( + color: widget.color, + fontWeight: widget.fontWeight, + fontSize: widget.fontSize ?? (SizeConfig.textMultiplier * 2), + fontFamily: widget.fontFamily, + decoration: widget.underline == true + ? TextDecoration.underline + : TextDecoration.none + // backgroundColor:widget.backGroundcolor + ), + ), + ), + ); + } +}