|
|
|
@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
@ -162,17 +163,16 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
|
|
|
|
// TODO change it secondary button and add loading
|
|
|
|
// TODO change it secondary button and add loading
|
|
|
|
AppButton(
|
|
|
|
AppButton(
|
|
|
|
title: TranslationBase.of(context).search,
|
|
|
|
title: TranslationBase.of(context).search,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () async{
|
|
|
|
searchMedicine(context, model);
|
|
|
|
await searchMedicine(context, model);
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
NetworkBaseView(
|
|
|
|
Column(
|
|
|
|
baseViewModel: model,
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
@ -242,7 +242,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -252,7 +252,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
|
|
|
|
),),);
|
|
|
|
),),);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
searchMedicine(context, MedicineViewModel model) {
|
|
|
|
searchMedicine(context, MedicineViewModel model) async {
|
|
|
|
FocusScope.of(context).unfocus();
|
|
|
|
FocusScope.of(context).unfocus();
|
|
|
|
if (myController.text.isNullOrEmpty()) {
|
|
|
|
if (myController.text.isNullOrEmpty()) {
|
|
|
|
helpers.showErrorToast(TranslationBase
|
|
|
|
helpers.showErrorToast(TranslationBase
|
|
|
|
@ -267,7 +267,12 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
|
|
|
|
.moreThan3Letter);
|
|
|
|
.moreThan3Letter);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
model.getMedicineItem(myController.text);
|
|
|
|
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await model.getMedicineItem(myController.text);
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
startVoiceSearch() {
|
|
|
|
startVoiceSearch() {
|
|
|
|
|