prevent add spaces

merge-requests/560/head
Elham Rababah 5 years ago
parent 4a6503c2cf
commit 23cb01daf5

@ -20,6 +20,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:url_launcher/url_launcher.dart';
class DoctorReplayChat extends StatelessWidget { class DoctorReplayChat extends StatelessWidget {
@ -107,7 +108,7 @@ class DoctorReplayChat extends StatelessWidget {
SizedBox(height: 30,), SizedBox(height: 30,),
Container( Container(
// color: Color(0xFF2B353E), // color: Color(0xFF2B353E),
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.9,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
@ -135,7 +136,7 @@ class DoctorReplayChat extends StatelessWidget {
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
1 == 1 reply.gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -144,7 +145,7 @@ class DoctorReplayChat extends StatelessWidget {
Divider(), Divider(),
SizedBox(width: 10,), SizedBox(width: 10,),
Container( Container(
width: MediaQuery.of(context).size.width * 0.30, width: MediaQuery.of(context).size.width * 0.35,
child: AppText( child: AppText(
reply.patientName reply.patientName
.toString(), .toString(),
@ -154,7 +155,19 @@ class DoctorReplayChat extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
// fontSize: 18 // fontSize: 18
), ),
) ),
Container(
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" +reply.mobileNumber);
},
child: Icon(
Icons.phone,
color: Colors.white,
),
),
),
], ],
), ),
Column( Column(
@ -218,61 +231,61 @@ class DoctorReplayChat extends StatelessWidget {
), ),
), ),
Positioned( // Positioned(
bottom: 0, // bottom: 0,
child: Container( // child: Container(
width:MediaQuery.of(context).size.width * 1, // width:MediaQuery.of(context).size.width * 1,
// height: MediaQuery.of(context).size.height * 0.12, // // height: MediaQuery.of(context).size.height * 0.12,
child: Column( // child: Column(
mainAxisSize: MainAxisSize.min, // mainAxisSize: MainAxisSize.min,
children: <Widget>[ // children: <Widget>[
FractionallySizedBox( // FractionallySizedBox(
child: Container( // child: Container(
//
child: TextFields( // child: TextFields(
borderRadius: 0, // borderRadius: 0,
hintText: TranslationBase // hintText: TranslationBase
.of(context) // .of(context)
.typeHereToReply, // .typeHereToReply,
fontSize: 13.5, // fontSize: 13.5,
//
suffixIcon: FontAwesomeIcons.arrowRight, // suffixIcon: FontAwesomeIcons.arrowRight,
suffixIconColor: Colors.green, // suffixIconColor: Colors.green,
onSuffixTap: ()async { // onSuffixTap: ()async {
GifLoaderDialogUtils.showMyDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
await model.replay(msgController.text, reply); // await model.replay(msgController.text, reply);
if(model.state == ViewState.ErrorLocal) { // if(model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast("An error happened while you are replaying"); // Helpers.showErrorToast("An error happened while you are replaying");
} else { // } else {
DrAppToastMsg.showSuccesToast("Thank you for your replay "); // DrAppToastMsg.showSuccesToast("Thank you for your replay ");
await previousModel.getDoctorReply(); // await previousModel.getDoctorReply();
Navigator.pop(context); // Navigator.pop(context);
} // }
GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
//
//
//
//
}, // },
// hintColor: Colors.black, // // hintColor: Colors.black,
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
maxLines: 50, // maxLines: 50,
minLines: 3, // minLines: 3,
controller: msgController, // controller: msgController,
validator: (value) { // validator: (value) {
if (value == null || value == "") // if (value == null || value == "")
return TranslationBase.of(context) // return TranslationBase.of(context)
.emptyMessage; // .emptyMessage;
else // else
return null; // return null;
}), // }),
//
), // ),
), // ),
], // ],
), // ),
), // ),
) // )
], ],

@ -48,17 +48,15 @@ class DoctorReplyScreen extends StatelessWidget {
children: children:
model.listDoctorWorkingHoursTable.map((reply) { model.listDoctorWorkingHoursTable.map((reply) {
return InkWell( return InkWell(
onTap: reply.status != 2 onTap: () {
? null Navigator.push(
: () { context,
// Navigator.push( MaterialPageRoute(
// context, builder: (BuildContext context) =>
// MaterialPageRoute( DoctorReplayChat(
// builder: (BuildContext context) => reply: reply,
// DoctorReplayChat( previousModel: model,
// reply: reply, )));
// previousModel: model,
// )));
}, },
child: DoctorReplyWidget(reply: reply), child: DoctorReplyWidget(reply: reply),
); );

@ -118,7 +118,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
setState(() { setState(() {
isSubmitted = true; isSubmitted = true;
}); });
if (progressNoteController.text.isNotEmpty) { if (progressNoteController.text.trim().isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
@ -177,6 +177,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast("Your Order added Successfully"); DrAppToastMsg.showSuccesToast("Your Order added Successfully");
Navigator.of(context).pop(); Navigator.of(context).pop();
} else {
Helpers.showErrorToast("You cant add only spaces");
} }
}), }),
], ],

@ -11,6 +11,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class DoctorReplyWidget extends StatefulWidget { class DoctorReplyWidget extends StatefulWidget {
final ListGtMyPatientsQuestions reply; final ListGtMyPatientsQuestions reply;
@ -104,6 +105,7 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
], ],
), ),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
@ -113,6 +115,18 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
), ),
Container(
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" +widget.reply.mobileNumber);
},
child: Icon(
Icons.phone,
color: Colors.black87,
),
),
),
SizedBox( SizedBox(
width: 4, width: 4,
), ),
@ -220,8 +234,8 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
Container( Container(
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
child: RichText( child: RichText(
// maxLines: 2, maxLines: 3,
// overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 2.0 * SizeConfig.textMultiplier,

Loading…
Cancel
Save