This commit is contained in:
estevez-dev 2020-06-30 13:16:43 +03:00
parent 7ebf5f7c18
commit da8efcd43f

View File

@ -17,6 +17,7 @@ class _IntegrationSettingsPageState extends State<IntegrationSettingsPage> {
bool _locationTrackingEnabled = false; bool _locationTrackingEnabled = false;
bool _foregroundLocationTrackingEnabled = false; bool _foregroundLocationTrackingEnabled = false;
bool _wait = false; bool _wait = false;
bool _changedHere = false;
@override @override
void initState() { void initState() {
@ -45,6 +46,7 @@ class _IntegrationSettingsPageState extends State<IntegrationSettingsPage> {
if (_locationInterval < 720) { if (_locationInterval < 720) {
setState(() { setState(() {
_locationInterval = _locationInterval + 5; _locationInterval = _locationInterval + 5;
_changedHere = true;
}); });
} }
} }
@ -53,6 +55,7 @@ class _IntegrationSettingsPageState extends State<IntegrationSettingsPage> {
if (_locationInterval > 5) { if (_locationInterval > 5) {
setState(() { setState(() {
_locationInterval = _locationInterval - 5; _locationInterval = _locationInterval - 5;
_changedHere = true;
}); });
} }
} }
@ -80,6 +83,11 @@ class _IntegrationSettingsPageState extends State<IntegrationSettingsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (!_wait && !_changedHere) {
_loadSettings();
} else if (_changedHere) {
_changedHere = false;
}
return ListView( return ListView(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),