Implemented placeholder SettingsView
This commit is contained in:
@@ -3,7 +3,7 @@ import 'package:cabo_counter/utility/globals.dart';
|
|||||||
import 'package:cabo_counter/utility/local_storage_service.dart';
|
import 'package:cabo_counter/utility/local_storage_service.dart';
|
||||||
import 'package:cabo_counter/views/active_game_view.dart';
|
import 'package:cabo_counter/views/active_game_view.dart';
|
||||||
import 'package:cabo_counter/views/create_game_view.dart';
|
import 'package:cabo_counter/views/create_game_view.dart';
|
||||||
import 'package:cabo_counter/views/information_view.dart';
|
import 'package:cabo_counter/views/settings_view.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -35,12 +35,12 @@ class _MainMenuViewState extends State<MainMenuView> {
|
|||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
CupertinoPageRoute(
|
CupertinoPageRoute(
|
||||||
builder: (context) => const InformationView(),
|
builder: (context) => const SettingsView(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
CupertinoIcons.info_circle,
|
CupertinoIcons.settings,
|
||||||
size: 30,
|
size: 30,
|
||||||
)),
|
)),
|
||||||
middle: const Text('Cabo Counter'),
|
middle: const Text('Cabo Counter'),
|
||||||
|
|||||||
65
lib/views/settings_view.dart
Normal file
65
lib/views/settings_view.dart
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@ name: cabo_counter
|
|||||||
description: "Mobile app for the card game Cabo"
|
description: "Mobile app for the card game Cabo"
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.1.5+110
|
version: 0.1.5+113
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
|
|||||||
Reference in New Issue
Block a user