Compare commits

...

1 Commits

Author SHA1 Message Date
hussam al-habibeh aeb5d12cc3 flutter 2.8 4 years ago

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

@ -41,7 +41,7 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
@override
Widget build(BuildContext context) {
String txtOfMedicalReport;
HtmlEditorController controller = HtmlEditorController();
return BaseView<PatientMedicalReportViewModel>(
onModelReady: (model) async {
model.getMedicalReportTemplate();
@ -68,13 +68,25 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
children: [
if (model.medicalReportTemplate.length > 0)
HtmlRichEditor(
initialText: (widget.medicalReport != null
initialText: (widget.medicalReport !=
null
? widget.medicalNote
: widget.model.medicalReportTemplate[0].templateText.length > 0
? widget.model.medicalReportTemplate[0].templateText
: widget
.model
.medicalReportTemplate[
0]
.templateText
.length >
0
? widget
.model
.medicalReportTemplate[0]
.templateText
: ""),
hint: "Write the medical report ",
height: MediaQuery.of(context).size.height * 0.75,
height:
MediaQuery.of(context).size.height *
0.75,
),
],
),
@ -100,27 +112,35 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
// disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700,
onPressed: () async {
txtOfMedicalReport = await HtmlEditor.getText();
txtOfMedicalReport = await controller.getText();
if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
widget.medicalReport != null
?await widget.model.updateMedicalReport(
? await widget.model.updateMedicalReport(
widget.patient,
txtOfMedicalReport,
widget.medicalReport != null ? widget.medicalReport.lineItemNo : null,
widget.medicalReport != null ? widget.medicalReport.invoiceNo : null)
: await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport);
widget.medicalReport != null
? widget.medicalReport.lineItemNo
: null,
widget.medicalReport != null
? widget.medicalReport.invoiceNo
: null)
: await widget.model.addMedicalReport(
widget.patient, txtOfMedicalReport);
//model.getMedicalReportList(patient);
Navigator.pop(context);
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(widget.model.error);
if (widget.model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
widget.model.error);
}
} else {
DrAppToastMsg.showErrorToast("Please enter medical note");
DrAppToastMsg.showErrorToast(
"Please enter medical note");
}
},
),
@ -137,17 +157,21 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () async {
txtOfMedicalReport = await HtmlEditor.getText();
txtOfMedicalReport = await controller.getText();
if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport);
await widget.model.verifyMedicalReport(
widget.patient, widget.medicalReport);
GifLoaderDialogUtils.hideDialog(context);
Navigator.pop(context);
if (widget.model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(widget.model.error);
if (widget.model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
widget.model.error);
}
} else {
DrAppToastMsg.showErrorToast("Please enter medical note");
DrAppToastMsg.showErrorToast(
"Please enter medical note");
}
},
),

@ -39,46 +39,49 @@ class NumberTextInputFormatter extends TextInputFormatter {
final _mobileFormatter = NumberTextInputFormatter();
class TextFields extends StatefulWidget {
TextFields(
{Key key,
this.type,
this.hintText,
this.suffixIcon,
this.autoFocus,
this.onChanged,
this.initialValue,
this.minLines,
this.maxLines,
this.inputFormatters,
this.padding,
this.focus = false,
this.maxLengthEnforced = true,
this.suffixIconColor,
this.inputAction = TextInputAction.done,
this.onSubmit,
this.keepPadding = true,
this.textCapitalization = TextCapitalization.none,
this.controller,
this.keyboardType,
this.validator,
this.borderOnlyError = false,
this.onSaved,
this.onSuffixTap,
this.readOnly: false,
this.maxLength,
this.prefixIcon,
this.bare = false,
this.onTap,
this.fontSize = 16.0,
this.fontWeight = FontWeight.w700,
this.autoValidate = false,
this.fillColor,
this.hintColor,
this.hasBorder = true,
this.onTapTextFields,
this.hasLabelText = false,
this.showLabelText = false, this.borderRadius= 8.0, this.borderColor, this.borderWidth = 1, })
: super(key: key);
TextFields({
Key key,
this.type,
this.hintText,
this.suffixIcon,
this.autoFocus,
this.onChanged,
this.initialValue,
this.minLines,
this.maxLines,
this.inputFormatters,
this.padding,
this.focus = false,
this.maxLengthEnforced = true,
this.suffixIconColor,
this.inputAction = TextInputAction.done,
this.onSubmit,
this.keepPadding = true,
this.textCapitalization = TextCapitalization.none,
this.controller,
this.keyboardType,
this.validator,
this.borderOnlyError = false,
this.onSaved,
this.onSuffixTap,
this.readOnly: false,
this.maxLength,
this.prefixIcon,
this.bare = false,
this.onTap,
this.fontSize = 16.0,
this.fontWeight = FontWeight.w700,
this.autoValidate,
this.fillColor,
this.hintColor,
this.hasBorder = true,
this.onTapTextFields,
this.hasLabelText = false,
this.showLabelText = false,
this.borderRadius = 8.0,
this.borderColor,
this.borderWidth = 1,
}) : super(key: key);
final String hintText;
final String initialValue;
@ -108,7 +111,7 @@ class TextFields extends StatefulWidget {
final bool keepPadding;
final TextCapitalization textCapitalization;
final List<TextInputFormatter> inputFormatters;
final bool autoValidate;
final AutovalidateMode autoValidate;
final EdgeInsets padding;
final bool focus;
final bool borderOnlyError;
@ -203,8 +206,7 @@ class _TextFieldsState extends State<TextFields> {
@override
Widget build(BuildContext context) {
widget.borderColor = widget.borderColor?? Colors.grey;
widget.borderColor = widget.borderColor ?? Colors.grey;
return (AnimatedContainer(
duration: Duration(milliseconds: 300),
decoration: widget.bare
@ -225,7 +227,7 @@ class _TextFieldsState extends State<TextFields> {
onTap: widget.onTapTextFields,
keyboardAppearance: Theme.of(context).brightness,
scrollPhysics: BouncingScrollPhysics(),
autovalidate: widget.autoValidate,
autovalidateMode: widget.autoValidate,
textCapitalization: widget.textCapitalization,
onFieldSubmitted: widget.inputAction == TextInputAction.next
? (widget.onSubmit != null
@ -266,7 +268,7 @@ class _TextFieldsState extends State<TextFields> {
fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[
WhitelistingTextInputFormatter.digitsOnly,
FilteringTextInputFormatter.digitsOnly,
_mobileFormatter,
]
: widget.inputFormatters,
@ -281,7 +283,6 @@ class _TextFieldsState extends State<TextFields> {
hintText: widget.hintText,
hintStyle: TextStyle(
fontSize: widget.fontSize,
fontWeight: widget.fontWeight,
color: widget.hintColor ?? Theme.of(context).hintColor,
),
@ -310,7 +311,8 @@ class _TextFieldsState extends State<TextFields> {
width: 1.0)
: BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder
? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)
? BorderRadius.circular(
widget.bare ? 0.0 : widget.borderRadius)
: BorderRadius.circular(0.0),
),
focusedErrorBorder: OutlineInputBorder(
@ -321,28 +323,35 @@ class _TextFieldsState extends State<TextFields> {
.withOpacity(widget.bare ? 0.0 : 0.5),
width: 1.0)
: BorderSide(color: Colors.transparent, width: 0),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)),
borderRadius: BorderRadius.circular(
widget.bare ? 0.0 : widget.borderRadius)),
focusedBorder: OutlineInputBorder(
borderSide: widget.hasBorder
? BorderSide(color: widget.borderColor,width: widget.borderWidth)
? BorderSide(
color: widget.borderColor, width: widget.borderWidth)
: BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder
? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)
? BorderRadius.circular(
widget.bare ? 0.0 : widget.borderRadius)
: BorderRadius.circular(0.0),
),
disabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder
? BorderSide(color: widget.borderColor,width: widget.borderWidth)
? BorderSide(
color: widget.borderColor, width: widget.borderWidth)
: BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder
? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)
? BorderRadius.circular(
widget.bare ? 0.0 : widget.borderRadius)
: BorderRadius.circular(0.0)),
enabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder
? BorderSide(color: widget.borderColor,width: widget.borderWidth)
? BorderSide(
color: widget.borderColor, width: widget.borderWidth)
: BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder
? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)
? BorderRadius.circular(
widget.bare ? 0.0 : widget.borderRadius)
: BorderRadius.circular(0.0),
),
),

@ -13,11 +13,11 @@ class AppTextFormField extends FormField<String> {
GestureTapCallback onTap,
bool obscureText = false,
TextEditingController controller,
bool autovalidate = true,
AutovalidateMode autovalidate,
TextInputType textInputType,
String hintText,
FocusNode focusNode,
TextInputAction textInputAction=TextInputAction.done,
TextInputAction textInputAction = TextInputAction.done,
ValueChanged<String> onFieldSubmitted,
IconButton prefix,
String labelText,
@ -27,7 +27,7 @@ class AppTextFormField extends FormField<String> {
: super(
onSaved: onSaved,
validator: validator,
autovalidate: autovalidate,
autovalidateMode: autovalidate,
builder: (FormFieldState<String> state) {
return Column(
children: <Widget>[

@ -12,7 +12,7 @@ import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../speech-text-popup.dart';
class HtmlRichEditor extends StatefulWidget {
HtmlRichEditor({
HtmlRichEditor({
key,
this.hint = "Your text here...",
this.initialText,
@ -30,7 +30,6 @@ class HtmlRichEditor extends StatefulWidget {
final bool showBottomToolbar;
final List<Toolbar> toolbar;
@override
_HtmlRichEditorState createState() => _HtmlRichEditorState();
}
@ -38,9 +37,9 @@ class HtmlRichEditor extends StatefulWidget {
class _HtmlRichEditorState extends State<HtmlRichEditor> {
ProjectViewModel projectViewModel;
stt.SpeechToText speech = stt.SpeechToText();
HtmlEditorController controller = HtmlEditorController();
var recognizedWord;
var event = RobotProvider();
@override
void initState() {
@ -55,8 +54,6 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
super.initState();
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
@ -65,18 +62,20 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
children: [
HtmlEditor(
hint: widget.hint,
height: widget.height,
initialText: widget.initialText,
showBottomToolbar: widget.showBottomToolbar,
darkMode: widget.darkMode,
decoration: widget.decoration ??
BoxDecoration(
color: Colors.transparent,
borderRadius: BorderRadius.all(
Radius.circular(30.0),
options: HtmlEditorOptions(
showBottomToolbar: widget.showBottomToolbar,
darkMode: widget.darkMode,
decoration: widget.decoration ??
BoxDecoration(
color: Colors.transparent,
borderRadius: BorderRadius.all(
Radius.circular(30.0),
),
border: Border.all(color: Colors.grey[200], width: 0.5),
),
border: Border.all(color: Colors.grey[200], width: 0.5),
),
height: widget.height,
),
initialText: widget.initialText,
toolbar: widget.toolbar ??
const [
// Style(),
@ -96,8 +95,7 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
],
),
Positioned(
top:
50, //MediaQuery.of(context).size.height * 0,
top: 50, //MediaQuery.of(context).size.height * 0,
right: projectViewModel.isArabic
? MediaQuery.of(context).size.width * 0.75
: 15,
@ -107,8 +105,7 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
icon: Icon(DoctorApp.speechtotext,
color: Colors.black, size: 35),
onPressed: () {
initSpeechState()
.then((value) => {onVoiceText()});
initSpeechState().then((value) => {onVoiceText()});
},
),
],
@ -117,7 +114,6 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
);
}
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
@ -150,15 +146,15 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
].request();
}
void resultListener(result)async {
void resultListener(result) async {
recognizedWord = result.recognizedWords;
event.setValue({"searchText": recognizedWord});
String txt = await HtmlEditor.getText();
String txt = await controller.getText();
if (result.finalResult == true) {
setState(() {
SpeechToText.closeAlertDialog(context);
speech.stop();
HtmlEditor.setText(txt+recognizedWord);
controller.setText(txt + recognizedWord);
});
} else {
print(result.finalResult);

@ -72,7 +72,7 @@ class NewTextFields extends StatefulWidget {
this.onTap,
this.fontSize = 15.0,
this.fontWeight = FontWeight.w500,
this.autoValidate = false,
this.autoValidate,
this.hintColor,
this.isEnabled = true})
: super(key: key);
@ -106,7 +106,7 @@ class NewTextFields extends StatefulWidget {
final bool keepPadding;
final TextCapitalization textCapitalization;
final List<TextInputFormatter> inputFormatters;
final bool autoValidate;
final AutovalidateMode autoValidate;
final EdgeInsets padding;
final bool focus;
final bool borderOnlyError;
@ -172,7 +172,7 @@ class _NewTextFieldsState extends State<NewTextFields> {
initialValue: widget.initialValue,
keyboardAppearance: Theme.of(context).brightness,
scrollPhysics: BouncingScrollPhysics(),
autovalidate: widget.autoValidate,
autovalidateMode: widget.autoValidate,
textCapitalization: widget.textCapitalization,
onFieldSubmitted: widget.inputAction == TextInputAction.next
? (widget.onSubmit != null
@ -195,11 +195,11 @@ class _NewTextFieldsState extends State<NewTextFields> {
autofocus: widget.autoFocus ?? false,
validator: widget.validator,
onSaved: widget.onSaved,
style: Theme.of(context).textTheme.body2.copyWith(
style: Theme.of(context).textTheme.bodyText2.copyWith(
fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Color(0xFF575757), fontFamily: 'Poppins'),
inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[
WhitelistingTextInputFormatter.digitsOnly,
FilteringTextInputFormatter.digitsOnly,
_mobileFormatter,
]
: widget.inputFormatters,

File diff suppressed because it is too large Load Diff

@ -17,8 +17,8 @@ environment:
sdk: ">=2.8.0 <3.0.0"
#dependency_overrides:
# intl: 0.17.0-nullsafety.2
dependency_overrides:
intl: 0.17.0-nullsafety.2
dependencies:
@ -94,7 +94,7 @@ dependencies:
quiver: ^2.1.5
# Html Editor Enhanced
html_editor_enhanced: ^1.3.0
html_editor_enhanced: ^1.5.0
#Network Image
cached_network_image: ^2.5.0

Loading…
Cancel
Save