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,13 +319,25 @@ class _SingleFoodBucketDataState extends State<SingleFoodBucketData> { ...@@ -318,13 +319,25 @@ class _SingleFoodBucketDataState extends State<SingleFoodBucketData> {
offColor: Colors.black, offColor: Colors.black,
value: svalue, value: svalue,
onChange: (value) { onChange: (value) {
if (mounted) { if (err == "2") {
setState(() { if (mounted) {
svalue = value; setState(() {
svalue = value;
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