Commit 2163a391 authored by ayodyabanuka's avatar ayodyabanuka

updated app

parent c79d0ee2
import 'dart:async'; import 'dart:async';
import 'package:firebase_database/firebase_database.dart'; import 'package:firebase_database/firebase_database.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:ifarm/AB/Utils/NotificationService.dart'; import 'package:ifarm/AB/Utils/NotificationService.dart';
import 'package:liquid_progress_indicator/liquid_progress_indicator.dart'; import 'package:liquid_progress_indicator/liquid_progress_indicator.dart';
import 'package:switcher_button/switcher_button.dart'; import 'package:switcher_button/switcher_button.dart';
...@@ -318,6 +319,7 @@ class _SingleFoodBucketDataState extends State<SingleFoodBucketData> { ...@@ -318,6 +319,7 @@ class _SingleFoodBucketDataState extends State<SingleFoodBucketData> {
offColor: Colors.black, offColor: Colors.black,
value: svalue, value: svalue,
onChange: (value) { onChange: (value) {
if (err == "2") {
if (mounted) { if (mounted) {
setState(() { setState(() {
svalue = value; svalue = value;
...@@ -325,6 +327,17 @@ class _SingleFoodBucketDataState extends State<SingleFoodBucketData> { ...@@ -325,6 +327,17 @@ class _SingleFoodBucketDataState extends State<SingleFoodBucketData> {
updateone(value); updateone(value);
print(value); print(value);
}); });
} else if (err == "1") {
Fluttertoast.showToast(
msg:
"ERROR on bucket Please check!");
setState(() {
svalue = false;
updateone(value);
print(value);
});
}
} }
}, },
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment