diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index 155f10c7..01e03e6c 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -51,7 +51,7 @@ class _HospitalsLiveChatPageState extends State { Text( TranslationBase.of(context).instructions, textAlign: TextAlign.center, - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), ), SizedBox(height: 20), Text( diff --git a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart index e4dff24e..9657e234 100644 --- a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart @@ -38,7 +38,7 @@ class PharmaciesLiveChatPage extends StatelessWidget { Text( TranslationBase.of(context).instructions, textAlign: TextAlign.center, - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), ), ], ), diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 7d2bd31d..41dcdf58 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -195,178 +195,5 @@ class _HospitalsPageState extends State { ], ), ); - - AppScaffold( - isShowDecPage: false, - body: SingleChildScrollView( - child: Container( - // margin: EdgeInsets.only(left: 15,right: 15,top: 70), - margin: EdgeInsets.only(left: 15, right: 15, top: 70), - child: Column( - children: [ - ...List.generate( - widget.findusHospitalModelList.length, - (index) => Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - InkWell( - onTap: () { - showDialog( - context: context, - builder: (_) => AssetGiffyDialog( - title: Text( - widget.findusHospitalModelList[index].locationName, - style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600), - ), - image: Image.network( - widget.findusHospitalModelList[index].projectImageURL.toString(), - fit: BoxFit.cover, - ), - buttonCancelText: Text('cancel'), - buttonCancelColor: Colors.grey, - onlyCancelButton: true, - )); - }, - child: Container(width: 70, height: 70, child: Image.network(widget.findusHospitalModelList[index].projectImageURL.toString())), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.only(left: 5, right: 5, top: 10, bottom: 1), - child: Texts( - '${widget.findusHospitalModelList[index].locationName}', - textAlign: TextAlign.start, - ))), //model.cOCItemList[index].cOCTitl - Expanded( - flex: 2, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - IconButton( - icon: Icon( - Icons.location_on, - color: Theme.of(context).primaryColor, - size: 35, - ), - // icon: new Image.asset( - // 'assets/images/new-design/navigate.png'), - tooltip: '', - onPressed: () { - setState(() { - MapsLauncher.launchCoordinates(double.parse(widget.findusHospitalModelList[index].latitude), - double.parse(widget.findusHospitalModelList[index].longitude), widget.findusHospitalModelList[index].locationName); - }); - }, - ), - IconButton( - icon: Icon( - Icons.phone, - color: Theme.of(context).primaryColor, - size: 35, - ), - // icon: new Image.asset( - // 'assets/images/new-design/call.png'), - tooltip: '', - onPressed: () { - setState(() { - // _volume += 10; - launch("tel://" + widget.findusHospitalModelList[index].phoneNumber); - }); - }, - ), - ], - ), - ), - ], - ), - ), - ], - ), - // Texts('${model.FindusHospitalModelList[index].locationName}'), - Divider( - height: 4.5, - color: Colors.grey[500], - ) - ], - ), - ), - )), - SizedBox( - height: 8, - ), - Container( - width: double.infinity, - height: 100, - color: Colors.white, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - IconButton( - icon: new Image.asset('assets/images/new-design/youtube.png'), - iconSize: 70, - tooltip: 'Youtube', - onPressed: () { - setState(() { - launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); - }); - }, - ), - IconButton( - icon: new Image.asset('assets/images/new-design/linkedin.png'), - tooltip: 'LinkedIn', - iconSize: 70, - onPressed: () { - setState(() { - launch("https://www.linkedin.com/company/drsulaiman-alhabib-medical-group"); - }); - }, - ), - IconButton( - icon: new Image.asset('assets/images/new-design/twitter.png'), - tooltip: 'Twitter', - iconSize: 70, - onPressed: () { - setState(() { - launch("https://twitter.com/HMG"); - }); - }, - ), - IconButton( - icon: new Image.asset('assets/images/new-design/facebook.png'), - tooltip: 'facebook', - iconSize: 70, - onPressed: () { - setState(() { - launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); - }); - }, - ), - ], - ), - ), - ], - ), - ), - ), - ); } } diff --git a/lib/pages/ContactUs/widgets/card_common_contat.dart b/lib/pages/ContactUs/widgets/card_common_contat.dart index fb8fe6b6..b6a2640d 100644 --- a/lib/pages/ContactUs/widgets/card_common_contat.dart +++ b/lib/pages/ContactUs/widgets/card_common_contat.dart @@ -38,7 +38,12 @@ class CardCommonContact extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Image.asset(this.image, width: 42.0, height: 42.0), + Image.asset( + this.image, + width: 42.0, + height: 42.0, + color: Color(0xff2E303A), + ), Text( text + "${subText.isEmpty ? "" : "\n$subText"}", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart index 15f348f9..06a7f7cd 100644 --- a/lib/pages/feedback/feedback_home_page.dart +++ b/lib/pages/feedback/feedback_home_page.dart @@ -3,6 +3,7 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/pages/feedback/send_feedback_page.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -14,14 +15,13 @@ import 'status_feedback_page.dart'; class FeedbackHomePage extends StatefulWidget { final AppoitmentAllHistoryResultList appointment; final MessageType messageType; - const FeedbackHomePage({Key key, this.appointment, this.messageType= MessageType.NON}) : super(key: key); + const FeedbackHomePage({Key key, this.appointment, this.messageType = MessageType.NON}) : super(key: key); @override _FeedbackHomePageState createState() => _FeedbackHomePageState(); } -class _FeedbackHomePageState extends State - with SingleTickerProviderStateMixin { +class _FeedbackHomePageState extends State with SingleTickerProviderStateMixin { TabController _tabController; @override @@ -43,79 +43,44 @@ class _FeedbackHomePageState extends State isBottomBar: false, isShowDecPage: false, appBarTitle: TranslationBase.of(context).feedbackTitle, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), - height: 70.0, - ), - ), - ), - Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, width: 0.7), - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: Texts(TranslationBase.of(context).send), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: Texts(TranslationBase.of(context).status), - ), - ), - ], - ), - ), - ), - ), - ], + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGrey2Color, + body: Column( + children: [ + TabBar( + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [Text(TranslationBase.of(context).send), Text(TranslationBase.of(context).status)], ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [SendFeedbackPage(appointment: widget.appointment,messageType: widget.messageType,), StatusFeedbackPage()], - ), - ) - ], - ), + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + SendFeedbackPage( + appointment: widget.appointment, + messageType: widget.messageType, + ), + StatusFeedbackPage() + ], + ), + ) + ], ), ); } diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index bbef1757..a7bfde60 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; @@ -102,447 +103,447 @@ class _SendFeedbackPageState extends State { builder: (_, model, widget) => AppScaffold( baseViewModel: model, isShowDecPage: false, - body: Container( - height: MediaQuery.of(context).size.height * 0.8, - child: SingleChildScrollView( - child: Form( - key: formKey, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 65, - ), - Container( - margin: EdgeInsets.only(left: 20, right: 20, top: 8), - child: Texts( - TranslationBase.of(context).likeToHear, - textAlign: TextAlign.center, - ), - ), - InkWell( - onTap: () { - confirmBox(model); - }, - child: Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - height: 50, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(7), - color: Colors.white, - shape: BoxShape.rectangle, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: Form( + key: formKey, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).likeToHear, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - child: Texts( - getSelected(context), - variant: 'bodyText', + SizedBox(height: 21), + InkWell( + onTap: () { + confirmBox(model); + }, + child: Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, ), - margin: EdgeInsets.only(left: 10, right: 10), ), - Icon( - Icons.arrow_drop_down, - size: 22, - color: Colors.grey, - ) - ], - ), - ), - ), - if (appointHistory != null && - messageType == MessageType.ComplaintOnAnAppointment) - InkWell( - onTap: () { - setState(() { - isShowListAppointHistory = true; - }); - }, - child: Container( - margin: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8) - ), - child: Row( - children: [ - Container( - width: projectViewModel.isArabic ? 27 : 20, - height: projectViewModel.isArabic ? 105 : 90, - decoration: BoxDecoration( - //Colors.red[900] Color(0xff404545) - color: appointHistory.isLiveCareAppointment - ? Color(0xff404545) - : !appointHistory.isInOutPatient - ? Colors.red[900] - : Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(0) - : Radius.circular(8), - bottomLeft: projectViewModel.isArabic - ? Radius.circular(0) - : Radius.circular(8), - topRight: projectViewModel.isArabic - ? Radius.circular(8) - : Radius.circular(0), - bottomRight: projectViewModel.isArabic - ? Radius.circular(8) - : Radius.circular(0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + getSelected(context), + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: Color(0xff2B353E), ), ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - appointHistory.isLiveCareAppointment - ? TranslationBase.of(context).liveCare.toUpperCase() - : !appointHistory.isInOutPatient - ? TranslationBase.of(context) - .inPatient - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), - style: TextStyle(color: Colors.white,fontSize: 12), + Icon( + Icons.keyboard_arrow_down, + size: 22, + color: Colors.grey, + ) + ], + ), + ), + ), + SizedBox(height: 12), + if (appointHistory != null && messageType == MessageType.ComplaintOnAnAppointment) + InkWell( + onTap: () { + setState(() { + isShowListAppointHistory = true; + }); + }, + child: Container( + // margin: EdgeInsets.all(8.0), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), + child: Row( + children: [ + Container( + width: projectViewModel.isArabic ? 27 : 20, + height: projectViewModel.isArabic ? 105 : 90, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: appointHistory.isLiveCareAppointment + ? Color(0xff404545) + : !appointHistory.isInOutPatient + ? Colors.red[900] + : Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), + bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), ), - )), - ), - Expanded( - flex: 4, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - children: [ - Expanded( - flex: 1, - child: LargeAvatar( - name: appointHistory.doctorNameObj, - url: appointHistory.doctorImageURL, - ), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + appointHistory.isLiveCareAppointment + ? TranslationBase.of(context).liveCare.toUpperCase() + : !appointHistory.isInOutPatient + ? TranslationBase.of(context).inPatient.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), + style: TextStyle(color: Colors.white, fontSize: 12), ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - appointHistory.doctorNameObj, - bold: true, - ), - Texts( - DateUtil - .getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointHistory.appointmentDate)), - variant: 'caption3', + )), + ), + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + children: [ + Expanded( + flex: 1, + child: LargeAvatar( + name: appointHistory.doctorNameObj, + url: appointHistory.doctorImageURL, + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + appointHistory.doctorNameObj, + bold: true, + ), + Texts( + DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointHistory.appointmentDate)), + variant: 'caption3', + ), + StarRating(totalAverage: appointHistory.doctorRate.toDouble(), forceStars: true), + ], ), - StarRating( - totalAverage: appointHistory - .doctorRate - .toDouble(), - forceStars: true), - ], + ), ), - ), + ], ), - ], + ), + ], + ), + ), + Expanded( + flex: 1, + child: Center( + child: Icon( + Icons.arrow_forward_ios, + size: 15, ), ), - ], - ), + ) + ], ), - Expanded( - flex: 1, - child: Center( - child: Icon( - Icons.arrow_forward_ios, - size: 15, - ), - ), - ) - ], + ), ), - ), - ), - if (messageType == MessageType.ComplaintOnAnAppointment && - model.appointHistoryList.length != 0 && - isShowListAppointHistory) - Container( - height: model.appointHistoryList.length > 2 - ? MediaQuery.of(context).size.height * 0.25 - : MediaQuery.of(context).size.height * 0.15, - child: ListView.builder( - itemCount: model.appointHistoryList.length, - itemBuilder: (context, index) => InkWell( - onTap: () { - setState(() { - appointHistory = model.appointHistoryList[index]; - isShowListAppointHistory = false; - }); - }, - child: Container( - margin: EdgeInsets.only(left: 8, right: 8), - color: Colors.white, - child: Column( - children: [ - Row( + if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 && isShowListAppointHistory) + Container( + height: model.appointHistoryList.length > 2 ? MediaQuery.of(context).size.height * 0.25 : MediaQuery.of(context).size.height * 0.15, + child: ListView.builder( + itemCount: model.appointHistoryList.length, + itemBuilder: (context, index) => InkWell( + onTap: () { + setState(() { + appointHistory = model.appointHistoryList[index]; + isShowListAppointHistory = false; + }); + }, + child: Container( + margin: EdgeInsets.only(left: 8, right: 8), + color: Colors.white, + child: Column( children: [ - Expanded( - flex: 4, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - children: [ - Expanded( - flex: 1, - child: LargeAvatar( - name: model - .appointHistoryList[ - index] - .doctorNameObj, - url: model - .appointHistoryList[ - index] - .doctorImageURL, - ), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Texts( - model - .appointHistoryList[ - index] - .doctorNameObj, - bold: true, - ), - Texts( - DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)), - variant: 'caption3', + Row( + children: [ + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + children: [ + Expanded( + flex: 1, + child: LargeAvatar( + name: model.appointHistoryList[index].doctorNameObj, + url: model.appointHistoryList[index].doctorImageURL, + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + model.appointHistoryList[index].doctorNameObj, + bold: true, + ), + Texts( + DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)), + variant: 'caption3', + ), + StarRating(totalAverage: model.appointHistoryList[index].doctorRate.toDouble(), forceStars: true), + ], ), - StarRating( - totalAverage: model - .appointHistoryList[ - index] - .doctorRate - .toDouble(), - forceStars: true), - ], + ), ), - ), + ], ), - ], + ), + ], + ), + ), + Expanded( + flex: 1, + child: Center( + child: Icon( + Icons.arrow_forward_ios, + size: 15, ), ), - ], - ), + ) + ], ), - Expanded( - flex: 1, - child: Center( - child: Icon( - Icons.arrow_forward_ios, - size: 15, - ), - ), + SizedBox( + height: 5, + ), + Divider( + height: 0.5, + color: Colors.grey[400], ) ], ), - SizedBox( - height: 5, - ), - Divider( - height: 0.5, - color: Colors.grey[400], - ) - ], + ), ), ), ), - ), - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: TranslationBase.of(context).subject, - controller: titleController, - fontSize: 13.5, - hintColor: Colors.black, - fontWeight: FontWeight.w600, - onChanged: (v) { - setState(() {}); - }, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context).emptySubject; - else - return null; - }, - ), - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: TranslationBase.of(context).message, - fontSize: 13.5, - hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: messageController, - suffixIcon: Icons.mic, - onSuffixTap: () { - openSpeechReco(); - }, - onChanged: (v) { - setState(() {}); + inputWidget(TranslationBase.of(context).subject, "xxxxxxxx", titleController), + SizedBox(height: 12), + inputWidget(TranslationBase.of(context).message, "xxxxxxxx", messageController, lines: 11, suffixTap: () { + openSpeechReco(); + }), + SizedBox(height: 12), + InkWell( + onTap: () { + ImageOptions.showImageOptions(context, (String image, File file) { + setState(() { + images.add(image); + }); + }); }, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context).emptyMessage; - else - return null; - }), - ), - InkWell( - onTap: () { - ImageOptions.showImageOptions(context, - (String image, File file) { - setState(() { - images.add(image); - }); - }); - }, - child: Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - height: 50, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(7), - color: Colors.white, - shape: BoxShape.rectangle, - ), - child: Center( - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.attach_file), - Texts( - TranslationBase.of(context).selectAttachment, - variant: 'bodyText', - textAlign: TextAlign.center, + child: Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, ), - ], + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + Icons.attach_file, + color: Color(0xff2B353E), + ), + Text( + TranslationBase.of(context).selectAttachment, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + ), + ], + ), ), ), - ), - ), - ...List.generate( - images.length, - (index) => Container( - margin: EdgeInsets.all(10), - padding: EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, + ...List.generate( + images.length, + (index) => Container( + margin: EdgeInsets.all(10), + padding: EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Icon(FontAwesomeIcons.paperclip), - SizedBox( - width: 8, - ), - Texts( - 'image ${index + 1}.png', + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(FontAwesomeIcons.paperclip), + SizedBox( + width: 8, + ), + Texts( + 'image ${index + 1}.png', + ), + ], ), + InkWell( + onTap: () { + setState(() { + images.remove(images[index]); + }); + }, + child: Icon( + FontAwesomeIcons.trashAlt, + color: Colors.red[300], + )) ], ), - InkWell( - onTap: () { - setState(() { - images.remove(images[index]); - }); - }, - child: Icon( - FontAwesomeIcons.trashAlt, - color: Colors.red[300], - )) - ], - ), - )), - SizedBox( - height: 100, + )), + ], ), - ], + ), ), ), - ), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).send, + (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty) + ? null + : () { + final form = formKey.currentState; + if (form.validate()) { + GifLoaderDialogUtils.showMyDialog(context); + model + .sendCOCItem( + title: titleController.text, + attachment: images.length > 0 ? images[0] : "", + details: messageController.text, + cOCTypeName: getCOCName(), + appointHistory: messageType == MessageType.ComplaintOnAnAppointment ? appointHistory : null) + .then((value) { + if (value) { + setState(() { + titleController.text = ""; + messageController.text = ""; + images = []; + }); + setMessageType(MessageType.NON); + GifLoaderDialogUtils.hideDialog(context); + AppToast.showSuccessToast(message: TranslationBase.of(context).yourFeedback); + } else { + AppToast.showErrorToast(message: model.error); + GifLoaderDialogUtils.hideDialog(context); + } + }); + } + }, + color: Color(0xffD02127), + textColor: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty) ? Color(0xff000000) : Colors.white, + disabledColor: Color(0xffEAEAEA), + ), + ), + ], ), - bottomSheet: Container( - height: 80, - width: double.infinity, - padding: EdgeInsets.all(15.0), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.1, - child: SecondaryButton( - label: TranslationBase.of(context).send, - textColor: Colors.white, - disabled: (titleController.text.toString().isEmpty || - messageController.text.toString().isEmpty), - onTap: () { - final form = formKey.currentState; - if (form.validate()) { - GifLoaderDialogUtils.showMyDialog(context); - model - .sendCOCItem( - title: titleController.text, - attachment: images.length > 0 ? images[0] : "", - details: messageController.text, - cOCTypeName: getCOCName(), - appointHistory: messageType == - MessageType.ComplaintOnAnAppointment - ? appointHistory - : null) - .then((value) { - if (value) { - setState(() { - titleController.text = ""; - messageController.text = ""; - images = []; - }); - setMessageType(MessageType.NON); - GifLoaderDialogUtils.hideDialog(context); - AppToast.showSuccessToast( - message: TranslationBase.of(context).yourFeedback); - } else { - AppToast.showErrorToast(message: model.error); - GifLoaderDialogUtils.hideDialog(context); - } - }); - } - }, + ), + ); + } + + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines}) { + return Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: TextInputType.number, + controller: _controller, + maxLines: lines, + onChanged: (value) => {setState(() {})}, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + suffixIconConstraints: BoxConstraints(minWidth: 50), + suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), + // prefixIconConstraints: BoxConstraints(minWidth: 50), + // prefixIcon: suffix == null + // ? null + // : Text( + // "+" + suffix, + // style: TextStyle( + // fontSize: 14, + // height: 21 / 14, + // fontWeight: FontWeight.w500, + // color: Color(0xff2E303A), + // letterSpacing: -0.56, + // ), + // ), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], ), ), - ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], ), ), ); @@ -595,10 +596,8 @@ class _SendFeedbackPageState extends State { openSpeechReco() async { new RoboSearch(context: context).showAlertDialog(context); - _currentLocaleId = - TranslationBase.of(AppGlobal.context).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode; + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -641,8 +640,7 @@ class _SendFeedbackPageState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } @@ -652,9 +650,7 @@ class FeedbackTypeDialog extends StatefulWidget { final Function(MessageType) onValueSelected; final MessageType messageTypeDialog; - const FeedbackTypeDialog( - {Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) - : super(key: key); + const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) : super(key: key); @override State createState() => new FeedbackTypeDialogState(); @@ -699,14 +695,12 @@ class FeedbackTypeDialogState extends State { child: InkWell( onTap: () => setMessageDialogType(MessageType.NON), child: ListTile( - title: - Texts(TranslationBase.of(context).notClassified), + title: Texts(TranslationBase.of(context).notClassified), leading: Radio( value: MessageType.NON, groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, - onChanged: (MessageType value) => - setMessageDialogType(value), + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), @@ -721,17 +715,14 @@ class FeedbackTypeDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () => setMessageDialogType( - MessageType.ComplaintOnAnAppointment), + onTap: () => setMessageDialogType(MessageType.ComplaintOnAnAppointment), child: ListTile( - title: - Texts(TranslationBase.of(context).complainAppo), + title: Texts(TranslationBase.of(context).complainAppo), leading: Radio( value: MessageType.ComplaintOnAnAppointment, groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, - onChanged: (MessageType value) => - setMessageDialogType(value), + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), @@ -746,17 +737,14 @@ class FeedbackTypeDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () => setMessageDialogType( - MessageType.ComplaintWithoutAppointment), + onTap: () => setMessageDialogType(MessageType.ComplaintWithoutAppointment), child: ListTile( - title: Texts( - TranslationBase.of(context).complainWithoutAppo), + title: Texts(TranslationBase.of(context).complainWithoutAppo), leading: Radio( value: MessageType.ComplaintWithoutAppointment, groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, - onChanged: (MessageType value) => - setMessageDialogType(value), + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), @@ -778,8 +766,7 @@ class FeedbackTypeDialogState extends State { value: MessageType.Question, groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, - onChanged: (MessageType value) => - setMessageDialogType(value), + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), @@ -794,16 +781,14 @@ class FeedbackTypeDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () => - setMessageDialogType(MessageType.Compliment), + onTap: () => setMessageDialogType(MessageType.Compliment), child: ListTile( title: Texts(TranslationBase.of(context).compliment), leading: Radio( value: MessageType.Compliment, groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, - onChanged: (MessageType value) => - setMessageDialogType(value), + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), @@ -818,16 +803,14 @@ class FeedbackTypeDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () => - setMessageDialogType(MessageType.Suggestion), + onTap: () => setMessageDialogType(MessageType.Suggestion), child: ListTile( title: Texts(TranslationBase.of(context).suggestion), leading: Radio( value: MessageType.Suggestion, groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, - onChanged: (MessageType value) => - setMessageDialogType(value), + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index 7541855f..b1eb60ac 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -24,120 +25,116 @@ class _StatusFeedbackPageState extends State { builder: (_, model, widget) => AppScaffold( baseViewModel: model, isShowDecPage: false, - body: model.cOCItemList.isNotEmpty - ? Container( - margin: EdgeInsets.only( - top: 8.0, left: 8.0, right: 8.0, bottom: 80), - padding: EdgeInsets.all(15.0), - child: ListView.builder( - itemCount: model.cOCItemList.length, - itemBuilder: (context, index) => InkWell( - onTap: () { - gotodetails(model.cOCItemList[index]); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - margin: EdgeInsets.all(4), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 8, + body: Column( + children: [ + Expanded( + child: model.cOCItemList.isNotEmpty + ? Container( + margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0, bottom: 80), + padding: EdgeInsets.all(15.0), + child: ListView.builder( + itemCount: model.cOCItemList.length, + itemBuilder: (context, index) => InkWell( + onTap: () { + gotodetails(model.cOCItemList[index]); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - '${model.cOCItemList[index].cOCTitle}'), - Texts( - TranslationBase.of(context).number + - ' : ${model.cOCItemList[index].itemID}', - variant: 'overline', - ), - ], + margin: EdgeInsets.all(4), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, ), - ), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts( - '${model.cOCItemList[index].status}'), - Texts( - '${model.cOCItemList[index].date}', - variant: 'overline', + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('${model.cOCItemList[index].cOCTitle}'), + Texts( + TranslationBase.of(context).number + ' : ${model.cOCItemList[index].itemID}', + variant: 'overline', + ), + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('${model.cOCItemList[index].status}'), + Texts( + '${model.cOCItemList[index].date}', + variant: 'overline', + ), + ], + ), ), ], ), - ), - ], + Texts('${model.cOCItemList[index].formType}'), + Divider( + height: 4.5, + color: Colors.grey[500], + ) + ], + ), ), - Texts('${model.cOCItemList[index].formType}'), - Divider( - height: 4.5, - color: Colors.grey[500], - ) - ], + ))), + ) + : Center( + child: Column( + children: [ + SizedBox( + height: MediaQuery.of(context).size.height * 0.4, + ), + Image.asset( + 'assets/images/comments.png', + width: 80, + height: 80, + ), + SizedBox( + height: 15, + ), + Text( + TranslationBase.of(context).noSearchResult, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: Color(0xff2B353E), ), ), - ))), - ) - : Container( - child: Center( - child: Column( - children: [ - SizedBox( - height: MediaQuery.of(context).size.height * 0.4, - ), - Image.asset( - 'assets/images/comments.png', - width: 80, - height: 80, + ], ), - SizedBox( - height: 15, - ), - Texts(TranslationBase.of(context).noSearchResult), - ], - ), - ), - ), - bottomSheet: Container( - height: 80, - width: double.infinity, - padding: EdgeInsets.all(15.0), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.1, - child: SecondaryButton( - label: TranslationBase.of(context).search, - textColor: Colors.white, - disabled: true, - onTap: () {}, + ), + ), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).search, + () => {}, ), ), - ), + ], ), ), ); } gotodetails(item) { - Navigator.pushReplacement( - context, FadePage(page: FeedbackDetails(items: item))); + Navigator.pushReplacement(context, FadePage(page: FeedbackDetails(items: item))); } } diff --git a/lib/widgets/mobile-no/mobile_no.dart b/lib/widgets/mobile-no/mobile_no.dart index 72509222..844f2e4e 100644 --- a/lib/widgets/mobile-no/mobile_no.dart +++ b/lib/widgets/mobile-no/mobile_no.dart @@ -83,7 +83,6 @@ class _PhoneNumberSelectorWidgetState extends State { _labelText, style: TextStyle( fontSize: 11, - fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.44, @@ -96,7 +95,6 @@ class _PhoneNumberSelectorWidgetState extends State { onChanged: (value) => widget.onNumberChange(value), style: TextStyle( fontSize: 14, - height: 21 / 14, fontWeight: FontWeight.w400, color: Color(0xff2B353E), @@ -107,7 +105,6 @@ class _PhoneNumberSelectorWidgetState extends State { hintText: _hintText, hintStyle: TextStyle( fontSize: 14, - height: 21 / 14, fontWeight: FontWeight.w400, color: Color(0xff575757), @@ -120,7 +117,6 @@ class _PhoneNumberSelectorWidgetState extends State { prefix, style: TextStyle( fontSize: 14, - height: 21 / 14, fontWeight: FontWeight.w500, color: Color(0xff2E303A), @@ -189,12 +185,12 @@ class _MobileNo extends State { Widget build(BuildContext context) { projectProvider = Provider.of(context); return Visibility( - child: Column(children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Container( + child: Column(children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Container( margin: EdgeInsets.only(bottom: 10.0), height: 60.0, decoration: BoxDecoration( @@ -207,70 +203,75 @@ class _MobileNo extends State { ), width: MediaQuery.of(context).size.width * 0.89, child: Padding( - padding: EdgeInsets.all(10), - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: _selectedType, - iconSize: 40, - elevation: 16, - onChanged: (value) => { - widget.onCountryChange(value), - setState(() { - countryCode = value; - _selectedType = value; - }) - }, - items: counties.map>((Countries value) { - return DropdownMenuItem( - value: value.code, - child: Text(projectProvider.isArabic == true ? value.nameAr : value.name), - ); - }).toList())))), - ), - ], - ), - Container( - padding: EdgeInsets.all(5), - decoration: BoxDecoration(color: Colors.white, border: Border.all(color: Colors.grey), borderRadius: BorderRadius.circular(10)), - child: Row(children: [ - Expanded( + padding: EdgeInsets.all(10), + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: _selectedType, + iconSize: 40, + elevation: 16, + onChanged: (value) => { + widget.onCountryChange(value), + setState(() { + countryCode = value; + _selectedType = value; + }) + }, + items: counties.map>((Countries value) { + return DropdownMenuItem( + value: value.code, + child: Text(projectProvider.isArabic == true ? value.nameAr : value.name), + ); + }).toList()), + ), + ), + ), + ), + ], + ), + Container( + padding: EdgeInsets.all(5), + decoration: BoxDecoration(color: Colors.white, border: Border.all(color: Colors.grey), borderRadius: BorderRadius.circular(10)), + child: Row(children: [ + Expanded( flex: 1, child: Icon( Icons.phone, color: secondaryColor, - )), - Expanded( + ), + ), + Expanded( flex: 1, child: Text( 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, - keyboardType: TextInputType.number, - maxLength: 10, - inputFormatters: - [ - FilteringTextInputFormatter.allow(RegExp("[0-9]")), - ], - // maxLengthEnforced: true, - // onChanged: (value) { - // widget.controller.text = countryCode; - // }, - onChanged: (value) => widget.onNumberChange(value), - - decoration: InputDecoration(counterText: "", border: InputBorder.none, hintText: '5xxxxxxxx'), ), ), - ) - ]), - ) - ])); + 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, + keyboardType: TextInputType.number, + maxLength: 10, + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp("[0-9]")), + ], + // maxLengthEnforced: true, + // onChanged: (value) { + // widget.controller.text = countryCode; + // }, + onChanged: (value) => widget.onNumberChange(value), + + decoration: InputDecoration(counterText: "", border: InputBorder.none, hintText: '5xxxxxxxx'), + ), + ), + ) + ]), + ) + ]), + ); } }