better errorhandling, slimmed down optimizer
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:anyway/constants.dart';
|
||||
import 'package:anyway/structs/preferences.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -24,6 +25,32 @@ class _ProfilePageState extends State<ProfilePage> {
|
||||
onChanged: (bool? newValue) {
|
||||
setState(() {
|
||||
debugMode = newValue!;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text('Debug mode - custom API'),
|
||||
content: TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: 'http://localhost:8000'
|
||||
),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
API_URL_BASE = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: Text('OK'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
)
|
||||
|
Reference in New Issue
Block a user