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

38 lines
1.2 KiB
Dart
Raw Normal View History

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()
],
)
);
}
}