final version

main
Arlind 2023-06-21 21:35:27 +02:00
parent 8c21a2888b
commit c4260348f1
8 changed files with 54 additions and 71 deletions

View File

@ -470,19 +470,20 @@ class AccountDetailPageState extends State<AccountDetailPage>
} }
Widget _buildTransactionsList(List<Transaction> transactionsList) { Widget _buildTransactionsList(List<Transaction> transactionsList) {
return ListView.separated( return ListView.separated(
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
itemCount: transactionsList.length, itemCount: transactionsList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final reversedIndex = transactionsList.length - 1 - index; // Berechnung des umgekehrten Index final reversedIndex = transactionsList.length -
final revtrans=transactionsList[reversedIndex]; 1 -
final formattedDate = DateFormat.yMMMMd().add_Hm().format(revtrans.date); index; // Berechnung des umgekehrten Index
final revtrans = transactionsList[reversedIndex];
final formattedDate =
DateFormat.yMMMMd().add_Hm().format(revtrans.date);
return GestureDetector( return GestureDetector(
onLongPress: () => onLongPress: () =>
_showDeleteConfirmationDialog(transactionsList[reversedIndex]), _showDeleteConfirmationDialog(transactionsList[reversedIndex]),
child: ListTile( child: ListTile(
title: Text( title: Text(
transactionsList[reversedIndex].title, transactionsList[reversedIndex].title,
style: TextStyle( style: TextStyle(
@ -490,11 +491,13 @@ class AccountDetailPageState extends State<AccountDetailPage>
? Colors.white54 ? Colors.white54
: Colors.black87), : Colors.black87),
), ),
subtitle:Text( subtitle: Text(
formattedDate, formattedDate,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: Theme.of(context).brightness == Brightness.dark ? Colors.grey[600] : Colors.grey[400], color: Theme.of(context).brightness == Brightness.dark
? Colors.grey[600]
: Colors.grey[400],
), ),
), ),
trailing: Text( trailing: Text(

View File

@ -50,7 +50,9 @@ class AddAccountDialogState extends State<AddAccountDialog> {
), ),
titleTextStyle: TextStyle( titleTextStyle: TextStyle(
fontSize: 20, fontSize: 20,
color: Theme.of(context).brightness==Brightness.dark?Colors.white70:Colors.black87, color: Theme.of(context).brightness == Brightness.dark
? Colors.white70
: Colors.black87,
), ),
content: Form( content: Form(
key: _formKey, key: _formKey,

View File

@ -71,7 +71,6 @@ class HomePageState extends State<HomePage> {
if (prefs.getString(key) == "CHF") { if (prefs.getString(key) == "CHF") {
_selectedCurrency = "CHF"; _selectedCurrency = "CHF";
} }
return prefs.getString(key) ?? 'Euro'; return prefs.getString(key) ?? 'Euro';
} }
@ -100,7 +99,6 @@ class HomePageState extends State<HomePage> {
Future<void> loadAccounts() async { Future<void> loadAccounts() async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
final accountList = prefs.getStringList('accounts') ?? []; final accountList = prefs.getStringList('accounts') ?? [];
setState(() { setState(() {
accounts = accountList accounts = accountList
.map((accountJson) => Account.fromJson(accountJson)) .map((accountJson) => Account.fromJson(accountJson))

View File

@ -20,7 +20,6 @@ class Settings extends StatefulWidget {
class SettingsState extends State<Settings> { class SettingsState extends State<Settings> {
String _selectedLanguage = 'English'; String _selectedLanguage = 'English';
String _selectedCurrency = 'Euro'; String _selectedCurrency = 'Euro';
final List<String> _languages = ['English', 'Deutsch']; final List<String> _languages = ['English', 'Deutsch'];
final List<String> _currencies = ['Euro', 'Dollar', 'CHF']; final List<String> _currencies = ['Euro', 'Dollar', 'CHF'];
@ -81,7 +80,6 @@ class SettingsState extends State<Settings> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
checkForLanguage(context); checkForLanguage(context);
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,

View File

@ -20,7 +20,6 @@ class SavingsTipsDialog extends StatelessWidget {
'tip13'.tr(), 'tip13'.tr(),
'tip14'.tr(), 'tip14'.tr(),
'tip15'.tr(), 'tip15'.tr(),
]; ];
SavingsTipsDialog({super.key}); SavingsTipsDialog({super.key});

View File

@ -1,66 +1,62 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
final grey200=Colors.grey[200]; final grey200 = Colors.grey[200];
final grey300=Colors.grey[300]; final grey300 = Colors.grey[300];
final grey400=Colors.grey[400]; final grey400 = Colors.grey[400];
final grey700=Colors.grey[700]; final grey700 = Colors.grey[700];
final grey800=Colors.grey[800]; final grey800 = Colors.grey[800];
final grey600=Colors.grey[600]; final grey600 = Colors.grey[600];
final ThemeData lightTheme = ThemeData( final ThemeData lightTheme = ThemeData(
scaffoldBackgroundColor: Colors.grey[100], scaffoldBackgroundColor: Colors.grey[100],
textTheme: const TextTheme( textTheme: const TextTheme(
displayLarge:(TextStyle(color: Colors.black87)), displayLarge: (TextStyle(color: Colors.black87)),
displayMedium: (TextStyle(color: Colors.black87)), displayMedium: (TextStyle(color: Colors.black87)),
displaySmall:(TextStyle(color: Colors.black87)), displaySmall: (TextStyle(color: Colors.black87)),
labelLarge:(TextStyle(color: Colors.black87)), labelLarge: (TextStyle(color: Colors.black87)),
labelMedium:(TextStyle(color: Colors.black87)), labelMedium: (TextStyle(color: Colors.black87)),
labelSmall:(TextStyle(color: Colors.black87)), labelSmall: (TextStyle(color: Colors.black87)),
headlineLarge:(TextStyle(color: Colors.black87)), headlineLarge: (TextStyle(color: Colors.black87)),
headlineMedium:(TextStyle(color: Colors.black87)), headlineMedium: (TextStyle(color: Colors.black87)),
headlineSmall:(TextStyle(color: Colors.black87)), headlineSmall: (TextStyle(color: Colors.black87)),
titleLarge:(TextStyle(color: Colors.black87)), titleLarge: (TextStyle(color: Colors.black87)),
titleMedium:(TextStyle(color: Colors.black87)), titleMedium: (TextStyle(color: Colors.black87)),
titleSmall:(TextStyle(color: Colors.black87)), titleSmall: (TextStyle(color: Colors.black87)),
bodyLarge: (TextStyle(color: Colors.black54)), bodyLarge: (TextStyle(color: Colors.black54)),
bodyMedium:(TextStyle(color: Colors.black54)), bodyMedium: (TextStyle(color: Colors.black54)),
bodySmall: (TextStyle(color: Colors.black54)) bodySmall: (TextStyle(color: Colors.black54))),
),
brightness: Brightness.light, brightness: Brightness.light,
shadowColor: Colors.grey[300], shadowColor: Colors.grey[300],
cardColor: Colors.black87, cardColor: Colors.black87,
unselectedWidgetColor: Colors.black54, unselectedWidgetColor: Colors.black54,
fontFamily: "Montserrat", fontFamily: "Montserrat",
buttonTheme: ButtonThemeData( buttonTheme: ButtonThemeData(
buttonColor: Colors.grey[100], buttonColor: Colors.grey[100], textTheme: ButtonTextTheme.primary),
textTheme: ButtonTextTheme.primary
),
); );
final ThemeData darkTheme = ThemeData( final ThemeData darkTheme = ThemeData(
textTheme: const TextTheme( textTheme: const TextTheme(
displayLarge:(TextStyle(color: Colors.white70)), displayLarge: (TextStyle(color: Colors.white70)),
displayMedium: (TextStyle(color: Colors.white70)), displayMedium: (TextStyle(color: Colors.white70)),
displaySmall:(TextStyle(color: Colors.white70)), displaySmall: (TextStyle(color: Colors.white70)),
labelLarge:(TextStyle(color: Colors.white70)), labelLarge: (TextStyle(color: Colors.white70)),
labelMedium:(TextStyle(color: Colors.white70)), labelMedium: (TextStyle(color: Colors.white70)),
labelSmall:(TextStyle(color: Colors.white70)), labelSmall: (TextStyle(color: Colors.white70)),
headlineLarge:(TextStyle(color: Colors.white70)), headlineLarge: (TextStyle(color: Colors.white70)),
headlineMedium:(TextStyle(color: Colors.white70)), headlineMedium: (TextStyle(color: Colors.white70)),
headlineSmall:(TextStyle(color: Colors.white70)), headlineSmall: (TextStyle(color: Colors.white70)),
titleLarge:(TextStyle(color: Colors.white70)), titleLarge: (TextStyle(color: Colors.white70)),
titleMedium:(TextStyle(color: Colors.white70)), titleMedium: (TextStyle(color: Colors.white70)),
titleSmall:(TextStyle(color: Colors.white70)), titleSmall: (TextStyle(color: Colors.white70)),
bodyLarge: (TextStyle(color: Colors.white54)), bodyLarge: (TextStyle(color: Colors.white54)),
bodyMedium:(TextStyle(color: Colors.white54)), bodyMedium: (TextStyle(color: Colors.white54)),
bodySmall: (TextStyle(color: Colors.white54)), bodySmall: (TextStyle(color: Colors.white54)),
), ),
shadowColor: Colors.grey[700], shadowColor: Colors.grey[700],
fontFamily: "Montserrat", fontFamily: "Montserrat",
cardColor: Colors.white70, cardColor: Colors.white70,
unselectedWidgetColor: Colors.white54, unselectedWidgetColor: Colors.white54,
brightness: Brightness.dark, brightness: Brightness.dark,
buttonTheme: ButtonThemeData( buttonTheme: ButtonThemeData(
buttonColor: Colors.grey[900], buttonColor: Colors.grey[900],
), ),
); );

View File

@ -1,21 +1,8 @@
name: tests name: tests
description: A new Flutter project. description: A Finance planner to keep control of budget.
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1 version: 1.0.0+1
environment: environment: