Option to edit device id
This commit is contained in:
parent
e2c07a23c6
commit
3fe3810695
2 changed files with 9 additions and 2 deletions
|
|
@ -116,7 +116,7 @@ class MainScreen extends StatelessWidget {
|
|||
child: OutlinedButton(
|
||||
onPressed: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (_) => const SettingsScreen()),
|
||||
MaterialPageRoute(builder: (_) => const SettingsScreen(editDeviceId: true)),
|
||||
),
|
||||
child: const Text('Advanced settings'),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ import 'package:flutter_background_geolocation/flutter_background_geolocation.da
|
|||
import 'preferences.dart';
|
||||
|
||||
class SettingsScreen extends StatefulWidget {
|
||||
const SettingsScreen({super.key});
|
||||
final bool editDeviceId;
|
||||
|
||||
const SettingsScreen({super.key, this.editDeviceId = false});
|
||||
|
||||
@override
|
||||
State<SettingsScreen> createState() => _SettingsScreenState();
|
||||
|
|
@ -30,6 +32,11 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
loading = false;
|
||||
buffering = preferences.getBool(Preferences.buffer) ?? true;
|
||||
});
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (widget.editDeviceId) {
|
||||
_editSetting(AppLocalizations.of(context)!.idLabel, Preferences.id, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _editSetting(String title, String key, bool isInt) async {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue