From d8cce04b8ab3919491c18cc4257176a6679304e1 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 6 Apr 2021 11:16:07 +0300 Subject: [PATCH] fix replay design --- lib/screens/doctor/doctor_repaly_chat.dart | 100 +++++++++++++++------ lib/widgets/shared/TextFields.dart | 15 ++-- 2 files changed, 81 insertions(+), 34 deletions(-) diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 362603b5..6980348b 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -43,12 +43,11 @@ class DoctorReplayChat extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, ), - height: 130, + height: 115, child: Container( - color: Colors.red, padding: EdgeInsets.only( left: 10, right: 10), - margin: EdgeInsets.only(top: 50), + margin: EdgeInsets.only(top: 40), child: Column( children: [ Row( @@ -301,31 +300,76 @@ class DoctorReplayChat extends StatelessWidget { ), ), bottomSheet: Container( - child:TextFields( - hasLabelText: msgController.text != '' - ? true - : false, - showLabelText: false, - hintText: TranslationBase - .of(context) - .typeHereToReply, - fontSize: 13.5, - suffixIcon: FontAwesomeIcons.arrowRight, - suffixIconColor: Colors.green, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 50, - minLines: 3, - controller: msgController, - validator: (value) { - if (value == null || value == "") - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - height: MediaQuery.of(context).size.height * 0.1, - ), + width: double.infinity, + // height: MediaQuery.of(context).size.height * 0.12, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + FractionallySizedBox( + child: Container( + child: TextFields( + borderRadius: 0, + hasLabelText: msgController.text != '' + ? true + : false, + showLabelText: false, + hintText: "\n"+TranslationBase + .of(context) + .typeHereToReply, + fontSize: 13.5, + + suffixIcon: FontAwesomeIcons.arrowRight, + suffixIconColor: Colors.green, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 50, + minLines: 3, + controller: msgController, + validator: (value) { + if (value == null || value == "") + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + + ), + ), + ], + ), + ) + + + // Container( + // child:SingleChildScrollView( + // child: TextFields( + // borderRadius: 0, + // hasLabelText: msgController.text != '' + // ? true + // : false, + // showLabelText: false, + // hintText: "\n"+TranslationBase + // .of(context) + // .typeHereToReply, + // fontSize: 13.5, + // + // suffixIcon: FontAwesomeIcons.arrowRight, + // suffixIconColor: Colors.green, + // // hintColor: Colors.black, + // fontWeight: FontWeight.w600, + // maxLines: 50, + // minLines: 3, + // controller: msgController, + // validator: (value) { + // if (value == null || value == "") + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }), + // ), + // height: MediaQuery.of(context).size.height * 0.11, + // ), )); } } diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 706c65b7..aab1eb61 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -77,7 +77,7 @@ class TextFields extends StatefulWidget { this.hasBorder = true, this.onTapTextFields, this.hasLabelText = false, - this.showLabelText = false}) + this.showLabelText = false, this.borderRadius= 8.0}) : super(key: key); final String hintText; @@ -116,6 +116,8 @@ class TextFields extends StatefulWidget { final Color fillColor; final bool hasBorder; final bool showLabelText; + + final double borderRadius; bool hasLabelText; @override @@ -276,6 +278,7 @@ class _TextFieldsState extends State { hintText: widget.hintText, hintStyle: TextStyle( fontSize: widget.fontSize, + fontWeight: widget.fontWeight, color: widget.hintColor ?? Theme.of(context).hintColor, ), @@ -304,7 +307,7 @@ class _TextFieldsState extends State { width: 1.0) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), focusedErrorBorder: OutlineInputBorder( @@ -315,13 +318,13 @@ class _TextFieldsState extends State { .withOpacity(widget.bare ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), + borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), focusedBorder: OutlineInputBorder( borderSide: widget.hasBorder ? BorderSide(color: Colors.grey, width: 1.0) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), disabledBorder: OutlineInputBorder( @@ -329,14 +332,14 @@ class _TextFieldsState extends State { ? BorderSide(color: Colors.grey, width: 1.0) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0)), enabledBorder: OutlineInputBorder( borderSide: widget.hasBorder ? BorderSide(color: Colors.grey, width: 1.0) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), ),