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 -
1 -
index; // Berechnung des umgekehrten Index
final revtrans = transactionsList[reversedIndex]; final revtrans = transactionsList[reversedIndex];
final formattedDate = DateFormat.yMMMMd().add_Hm().format(revtrans.date); 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(
@ -494,7 +495,9 @@ class AccountDetailPageState extends State<AccountDetailPage>
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

@ -23,18 +23,14 @@ final ThemeData lightTheme = ThemeData(
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(

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: