From c4260348f1b467b20a1d438b1a35103fb64e2c14 Mon Sep 17 00:00:00 2001 From: Arlind <56867496+Lindi31@users.noreply.github.com> Date: Wed, 21 Jun 2023 21:35:27 +0200 Subject: [PATCH] final version --- lib/account/account.dart | 2 +- lib/account/account_detail.dart | 17 ++++--- lib/account/account_dialog.dart | 4 +- lib/main.dart | 2 - lib/preferences.dart | 2 - lib/saving_tips.dart | 1 - lib/theme/theme_constants.dart | 80 ++++++++++++++++----------------- pubspec.yaml | 17 +------ 8 files changed, 54 insertions(+), 71 deletions(-) diff --git a/lib/account/account.dart b/lib/account/account.dart index 6570c16..8d1fc39 100644 --- a/lib/account/account.dart +++ b/lib/account/account.dart @@ -23,4 +23,4 @@ class Account { 'balance': balance, }; } -} \ No newline at end of file +} diff --git a/lib/account/account_detail.dart b/lib/account/account_detail.dart index e570ad3..7fe1e42 100644 --- a/lib/account/account_detail.dart +++ b/lib/account/account_detail.dart @@ -470,19 +470,20 @@ class AccountDetailPageState extends State } Widget _buildTransactionsList(List transactionsList) { - return ListView.separated( physics: const BouncingScrollPhysics(), itemCount: transactionsList.length, itemBuilder: (context, index) { - final reversedIndex = transactionsList.length - 1 - index; // Berechnung des umgekehrten Index - final revtrans=transactionsList[reversedIndex]; - final formattedDate = DateFormat.yMMMMd().add_Hm().format(revtrans.date); + final reversedIndex = transactionsList.length - + 1 - + index; // Berechnung des umgekehrten Index + final revtrans = transactionsList[reversedIndex]; + final formattedDate = + DateFormat.yMMMMd().add_Hm().format(revtrans.date); return GestureDetector( onLongPress: () => _showDeleteConfirmationDialog(transactionsList[reversedIndex]), child: ListTile( - title: Text( transactionsList[reversedIndex].title, style: TextStyle( @@ -490,11 +491,13 @@ class AccountDetailPageState extends State ? Colors.white54 : Colors.black87), ), - subtitle:Text( + subtitle: Text( formattedDate, style: TextStyle( 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( diff --git a/lib/account/account_dialog.dart b/lib/account/account_dialog.dart index 12fb6a7..3a5564b 100644 --- a/lib/account/account_dialog.dart +++ b/lib/account/account_dialog.dart @@ -50,7 +50,9 @@ class AddAccountDialogState extends State { ), titleTextStyle: TextStyle( 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( key: _formKey, diff --git a/lib/main.dart b/lib/main.dart index 61aebd7..2c97900 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -71,7 +71,6 @@ class HomePageState extends State { if (prefs.getString(key) == "CHF") { _selectedCurrency = "CHF"; } - return prefs.getString(key) ?? 'Euro'; } @@ -100,7 +99,6 @@ class HomePageState extends State { Future loadAccounts() async { SharedPreferences prefs = await SharedPreferences.getInstance(); final accountList = prefs.getStringList('accounts') ?? []; - setState(() { accounts = accountList .map((accountJson) => Account.fromJson(accountJson)) diff --git a/lib/preferences.dart b/lib/preferences.dart index 835b22a..d3afe2c 100644 --- a/lib/preferences.dart +++ b/lib/preferences.dart @@ -20,7 +20,6 @@ class Settings extends StatefulWidget { class SettingsState extends State { String _selectedLanguage = 'English'; String _selectedCurrency = 'Euro'; - final List _languages = ['English', 'Deutsch']; final List _currencies = ['Euro', 'Dollar', 'CHF']; @@ -81,7 +80,6 @@ class SettingsState extends State { @override Widget build(BuildContext context) { checkForLanguage(context); - return Scaffold( appBar: AppBar( backgroundColor: Colors.transparent, diff --git a/lib/saving_tips.dart b/lib/saving_tips.dart index 4eb18e1..8bb15cf 100644 --- a/lib/saving_tips.dart +++ b/lib/saving_tips.dart @@ -20,7 +20,6 @@ class SavingsTipsDialog extends StatelessWidget { 'tip13'.tr(), 'tip14'.tr(), 'tip15'.tr(), - ]; SavingsTipsDialog({super.key}); diff --git a/lib/theme/theme_constants.dart b/lib/theme/theme_constants.dart index 4537e7d..5b21fd3 100644 --- a/lib/theme/theme_constants.dart +++ b/lib/theme/theme_constants.dart @@ -1,66 +1,62 @@ import 'package:flutter/material.dart'; -final grey200=Colors.grey[200]; -final grey300=Colors.grey[300]; -final grey400=Colors.grey[400]; -final grey700=Colors.grey[700]; -final grey800=Colors.grey[800]; -final grey600=Colors.grey[600]; +final grey200 = Colors.grey[200]; +final grey300 = Colors.grey[300]; +final grey400 = Colors.grey[400]; +final grey700 = Colors.grey[700]; +final grey800 = Colors.grey[800]; +final grey600 = Colors.grey[600]; final ThemeData lightTheme = ThemeData( scaffoldBackgroundColor: Colors.grey[100], textTheme: const TextTheme( - displayLarge:(TextStyle(color: Colors.black87)), + displayLarge: (TextStyle(color: Colors.black87)), displayMedium: (TextStyle(color: Colors.black87)), - displaySmall:(TextStyle(color: Colors.black87)), - labelLarge:(TextStyle(color: Colors.black87)), - labelMedium:(TextStyle(color: Colors.black87)), - labelSmall:(TextStyle(color: Colors.black87)), - headlineLarge:(TextStyle(color: Colors.black87)), - headlineMedium:(TextStyle(color: Colors.black87)), - headlineSmall:(TextStyle(color: Colors.black87)), - titleLarge:(TextStyle(color: Colors.black87)), - titleMedium:(TextStyle(color: Colors.black87)), - titleSmall:(TextStyle(color: Colors.black87)), + displaySmall: (TextStyle(color: Colors.black87)), + labelLarge: (TextStyle(color: Colors.black87)), + labelMedium: (TextStyle(color: Colors.black87)), + labelSmall: (TextStyle(color: Colors.black87)), + headlineLarge: (TextStyle(color: Colors.black87)), + headlineMedium: (TextStyle(color: Colors.black87)), + headlineSmall: (TextStyle(color: Colors.black87)), + titleLarge: (TextStyle(color: Colors.black87)), + titleMedium: (TextStyle(color: Colors.black87)), + titleSmall: (TextStyle(color: Colors.black87)), bodyLarge: (TextStyle(color: Colors.black54)), - bodyMedium:(TextStyle(color: Colors.black54)), - bodySmall: (TextStyle(color: Colors.black54)) - ), + bodyMedium: (TextStyle(color: Colors.black54)), + bodySmall: (TextStyle(color: Colors.black54))), brightness: Brightness.light, shadowColor: Colors.grey[300], cardColor: Colors.black87, unselectedWidgetColor: Colors.black54, fontFamily: "Montserrat", - buttonTheme: ButtonThemeData( - buttonColor: Colors.grey[100], - textTheme: ButtonTextTheme.primary - ), - + buttonTheme: ButtonThemeData( + buttonColor: Colors.grey[100], textTheme: ButtonTextTheme.primary), ); final ThemeData darkTheme = ThemeData( textTheme: const TextTheme( - displayLarge:(TextStyle(color: Colors.white70)), - displayMedium: (TextStyle(color: Colors.white70)), - displaySmall:(TextStyle(color: Colors.white70)), - labelLarge:(TextStyle(color: Colors.white70)), - labelMedium:(TextStyle(color: Colors.white70)), - labelSmall:(TextStyle(color: Colors.white70)), - headlineLarge:(TextStyle(color: Colors.white70)), - headlineMedium:(TextStyle(color: Colors.white70)), - headlineSmall:(TextStyle(color: Colors.white70)), - titleLarge:(TextStyle(color: Colors.white70)), - titleMedium:(TextStyle(color: Colors.white70)), - titleSmall:(TextStyle(color: Colors.white70)), - bodyLarge: (TextStyle(color: Colors.white54)), - bodyMedium:(TextStyle(color: Colors.white54)), - bodySmall: (TextStyle(color: Colors.white54)), + displayLarge: (TextStyle(color: Colors.white70)), + displayMedium: (TextStyle(color: Colors.white70)), + displaySmall: (TextStyle(color: Colors.white70)), + labelLarge: (TextStyle(color: Colors.white70)), + labelMedium: (TextStyle(color: Colors.white70)), + labelSmall: (TextStyle(color: Colors.white70)), + headlineLarge: (TextStyle(color: Colors.white70)), + headlineMedium: (TextStyle(color: Colors.white70)), + headlineSmall: (TextStyle(color: Colors.white70)), + titleLarge: (TextStyle(color: Colors.white70)), + titleMedium: (TextStyle(color: Colors.white70)), + titleSmall: (TextStyle(color: Colors.white70)), + bodyLarge: (TextStyle(color: Colors.white54)), + bodyMedium: (TextStyle(color: Colors.white54)), + bodySmall: (TextStyle(color: Colors.white54)), ), shadowColor: Colors.grey[700], fontFamily: "Montserrat", cardColor: Colors.white70, unselectedWidgetColor: Colors.white54, brightness: Brightness.dark, - buttonTheme: ButtonThemeData( + buttonTheme: ButtonThemeData( buttonColor: Colors.grey[900], ), -); \ No newline at end of file +); diff --git a/pubspec.yaml b/pubspec.yaml index e277d62..a12f682 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,21 +1,8 @@ name: tests -description: A new Flutter project. -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. +description: A Finance planner to keep control of budget. + 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 environment: