switched to local git instance
This commit is contained in:
69
lib/intro_screen.dart
Normal file
69
lib/intro_screen.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
class IntroScreen extends StatefulWidget {
|
||||
const IntroScreen({super.key});
|
||||
|
||||
@override
|
||||
State<IntroScreen> createState() => _IntroScreenState();
|
||||
}
|
||||
|
||||
class _IntroScreenState extends State<IntroScreen> {
|
||||
TextEditingController nameVornameC = TextEditingController();
|
||||
TextEditingController bLandC = TextEditingController();
|
||||
|
||||
Future<void> _saveData() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setString('nameVorname', nameVornameC.text);
|
||||
await prefs.setString('bLand', bLandC.text);
|
||||
await prefs.setBool('isFirstLaunch', false);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('FFOrte'),
|
||||
),
|
||||
body: Center(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(31),
|
||||
child: Column(
|
||||
children: [
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: AppLocalizations.of(context)!.namevorname),
|
||||
controller: nameVornameC,
|
||||
onChanged: (value) => setState(() {
|
||||
nameVornameC.text = value;
|
||||
}),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: AppLocalizations.of(context)!.bland),
|
||||
controller: bLandC,
|
||||
onChanged: (value) => setState(() {
|
||||
bLandC.text = value;
|
||||
}),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
_saveData();
|
||||
Navigator.pushNamedAndRemoveUntil(
|
||||
context, '/home', (route) => false);
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.continueB))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user