This repository has been archived on 2023-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
meincantor-app/lib/Settings/Pages/dev_settings.dart
Denys Konovalov e86c1bad1d = 0.8.0-dev =
- code cleanup
- caching
- black-/whitelist
- sz/news fixes
- added settings options
...
2021-12-13 13:39:06 +01:00

55 lines
2.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../login.dart';
class DevSettings extends StatelessWidget {
const DevSettings({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Entwickler-Einstellungen"),
centerTitle: true,
),
body: ListView(
padding: const EdgeInsets.fromLTRB(20, 20, 20, 20),
children: [
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
child: TextField(
decoration: const InputDecoration(
icon: Icon(MdiIcons.keyOutline),
border: OutlineInputBorder(),
labelText: 'MeinCantor API-Schlüssel',
),
onSubmitted: (String value) async {
SharedPreferences prefs =
await SharedPreferences.getInstance();
String apiKey = value;
await prefs.setString('api_key', apiKey);
final snackBar = SnackBar(
content:
Text('Neuer API-Schlüssel gesetzt: $apiKey'));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
})),
const Divider(),
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
child: OutlinedButton(
onPressed: () async {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Login()),
);
},
child: const Text("Benutzerdaten neu laden"),
)
)
],
));
}
}