finish add loader

ipd-changes-for-vida-plus
Elham Rababah 6 years ago
parent bc8a90ef2c
commit 763d6bb49f

@ -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_text_form_field.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:flutter/material.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
AppButton(
title: TranslationBase.of(context).search,
onPressed: () {
searchMedicine(context, model);
onPressed: () async{
await searchMedicine(context, model);
},
),
],
),
),
NetworkBaseView(
baseViewModel: model,
child: Column(
Column(
children: [
Container(
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();
if (myController.text.isNullOrEmpty()) {
helpers.showErrorToast(TranslationBase
@ -267,7 +267,12 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
.moreThan3Letter);
return;
}
model.getMedicineItem(myController.text);
GifLoaderDialogUtils.showMyDialog(context);
await model.getMedicineItem(myController.text);
GifLoaderDialogUtils.hideDialog(context);
}
startVoiceSearch() {

@ -317,8 +317,9 @@ class _PatientsScreenState extends State<PatientsScreen> {
},
builder: (_, model, w) => AppScaffold(
appBarTitle: patientTypeTitle,
isLoading: _isLoading,
body: _isLoading
? DrAppCircularProgressIndeicator()
? Container()
: _isError
? DrAppEmbeddedError(error: error)
: lItems == null || lItems.length == 0

Loading…
Cancel
Save