Implemented placeholder SettingsView

This commit is contained in:
Felix Kirchner
2025-05-02 23:22:35 +02:00
parent 4c27b65dd7
commit 56097b79d4
3 changed files with 69 additions and 4 deletions

View File

@@ -0,0 +1,65 @@
import 'package:flutter/cupertino.dart';
import 'package:package_info_plus/package_info_plus.dart';
class SettingsView extends StatefulWidget {
const SettingsView({super.key});
@override
State<SettingsView> createState() => _SettingsViewState();
}
class _SettingsViewState extends State<SettingsView> {
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Einstellungen'),
),
child: SafeArea(
child: Stack(
children: [
const Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: Icon(
CupertinoIcons.settings,
size: 100,
)),
],
),
Positioned(
bottom: 30,
left: 0,
right: 0,
child: FutureBuilder<PackageInfo>(
future: _getPackageInfo(),
builder: (context, snapshot) {
if (snapshot.hasData) {
return Text(
'Alpha ${snapshot.data!.version} '
'(Build ${snapshot.data!.buildNumber})',
textAlign: TextAlign.center,
);
} else if (snapshot.hasError) {
return const Text(
'App-Version -.-.- (Build -)',
textAlign: TextAlign.center,
);
}
return const Text(
'Lade Version...',
textAlign: TextAlign.center,
);
},
)),
],
)),
);
}
Future<PackageInfo> _getPackageInfo() async {
return await PackageInfo.fromPlatform();
}
}