Commit 2163a391 authored by ayodyabanuka's avatar ayodyabanuka

updated app

parent c79d0ee2
import 'dart:async';
import 'package:firebase_database/firebase_database.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:ifarm/AB/Utils/NotificationService.dart';
import 'package:liquid_progress_indicator/liquid_progress_indicator.dart';
import 'package:switcher_button/switcher_button.dart';
......@@ -318,13 +319,25 @@ class _SingleFoodBucketDataState extends State<SingleFoodBucketData> {
offColor: Colors.black,
value: svalue,
onChange: (value) {
if (mounted) {
setState(() {
svalue = value;
if (err == "2") {
if (mounted) {
setState(() {
svalue = value;
updateone(value);
print(value);
});
updateone(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