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.dart
Denys Konovalov 20a50d66f7 ==Initial version==
- many hardcoded placeholders
- TODO:
  - update README
  - update license & copyright info
  - cleanup code
  - merge code parts to server side
  - muuuuuuuch more...
2021-08-27 19:24:30 +02:00

38 lines
1.2 KiB
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'networking.dart';
class Settings extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Einstellungen"),
),
body: ListView(
padding: EdgeInsets.fromLTRB(20, 20, 20, 20),
children: [
Padding(
padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: TextField(
decoration: InputDecoration(
icon: Icon(CupertinoIcons.lock),
border: OutlineInputBorder(),
labelText: 'API Key (POST /login)',
),
onSubmitted: (String value) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
String api_key = value;
print('Set new API key to $api_key');
await prefs.setString('api_key', api_key);
}
)
),
Divider(),
buildClassesChooser()
],
)
);
}
}