Compare commits

..

10 commits

Author SHA1 Message Date
cdbd355c91 fix(deps): update dependency flutter_iconpicker to <3.4.6 2024-06-14 14:12:12 +02:00
Matyáš Caras
80f2ae9f7f
docs: add app bar fix to changelog 2024-04-22 17:04:59 +02:00
Matyáš Caras
481716a3b2
chore: bump version 2024-04-22 17:03:51 +02:00
Matyáš Caras
8ff63c9492
fix: set correct graph type when opening graph view
fixes #41
2024-04-22 16:59:08 +02:00
Matyáš Caras
1faa5e2f78
fix: don't display 'Add new wallet' when returning from a screen 2024-04-22 16:36:20 +02:00
Matyáš Caras
5cbb9a12dc
fix: remove deprecated code 2024-04-22 16:25:59 +02:00
Matyáš Caras
58dd06f39f
fix: use controllers for textfields
Fixes #39
2024-04-22 16:18:48 +02:00
Matyáš Caras
d832080a6d
fix: implement breaking change from fl_chart 2024-04-22 15:53:38 +02:00
Matyáš Caras
a90a39feff fix(deps): update dependency fl_chart to ^0.67.0 (#42)
Reviewed-on: #42
2024-04-22 15:52:32 +02:00
41d45e96fb fix(deps): update dependency fl_chart to ^0.67.0 2024-04-22 15:37:21 +02:00
13 changed files with 82 additions and 69 deletions

View file

@ -1,3 +1,11 @@
# 1.1.1
- Removed deprecated code
- Updated dependencies
- Fix wrong graph type upon opening graph view
- Fix text fields behaving unexpectedly
- Fix `Add new wallet` showing in the app bar when returning from another view
- Fix new wallet name being rewritten to the default placeholder
# 1.1.0 # 1.1.0
- Fix indicators for Pie Chart - Fix indicators for Pie Chart
- Fix entries not showing up immediately after creation - Fix entries not showing up immediately after creation

View file

@ -20,11 +20,9 @@ const lightColorScheme = ColorScheme(
errorContainer: Color(0xFFFFDAD6), errorContainer: Color(0xFFFFDAD6),
onError: Color(0xFFFFFFFF), onError: Color(0xFFFFFFFF),
onErrorContainer: Color(0xFF410002), onErrorContainer: Color(0xFF410002),
background: Color(0xFFFBFDF8),
onBackground: Color(0xFF191C19),
surface: Color(0xFFFBFDF8), surface: Color(0xFFFBFDF8),
onSurface: Color(0xFF191C19), onSurface: Color(0xFF191C19),
surfaceVariant: Color(0xFFDCE5DB), surfaceContainerHighest: Color(0xFFDCE5DB),
onSurfaceVariant: Color(0xFF414942), onSurfaceVariant: Color(0xFF414942),
outline: Color(0xFF717971), outline: Color(0xFF717971),
onInverseSurface: Color(0xFFF0F1EC), onInverseSurface: Color(0xFFF0F1EC),
@ -54,11 +52,9 @@ const darkColorScheme = ColorScheme(
errorContainer: Color(0xFF93000A), errorContainer: Color(0xFF93000A),
onError: Color(0xFF690005), onError: Color(0xFF690005),
onErrorContainer: Color(0xFFFFDAD6), onErrorContainer: Color(0xFFFFDAD6),
background: Color(0xFF191C19),
onBackground: Color(0xFFE1E3DE),
surface: Color(0xFF191C19), surface: Color(0xFF191C19),
onSurface: Color(0xFFE1E3DE), onSurface: Color(0xFFE1E3DE),
surfaceVariant: Color(0xFF414942), surfaceContainerHighest: Color(0xFF414942),
onSurfaceVariant: Color(0xFFC0C9BF), onSurfaceVariant: Color(0xFFC0C9BF),
outline: Color(0xFF8B938A), outline: Color(0xFF8B938A),
onInverseSurface: Color(0xFF191C19), onInverseSurface: Color(0xFF191C19),

View file

@ -71,7 +71,8 @@ class ExpensesLineChart extends StatelessWidget {
LineChartData( LineChartData(
lineTouchData: LineTouchData( lineTouchData: LineTouchData(
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Theme.of(context).colorScheme.secondaryContainer, getTooltipColor: (group) =>
Theme.of(context).colorScheme.secondaryContainer,
getTooltipItems: (spots) => List<LineTooltipItem>.generate( getTooltipItems: (spots) => List<LineTooltipItem>.generate(
spots.length, spots.length,
(index) => LineTooltipItem( (index) => LineTooltipItem(

View file

@ -12,7 +12,7 @@ void showAbout(BuildContext context) {
context: context, context: context,
applicationLegalese: AppLocalizations.of(context).license, applicationLegalese: AppLocalizations.of(context).license,
applicationName: "Prašule", applicationName: "Prašule",
applicationVersion: "1.1.0", applicationVersion: "1.1.1",
applicationIcon: const CircleAvatar( applicationIcon: const CircleAvatar(
backgroundImage: AssetImage("assets/icon/full_ico.png"), backgroundImage: AssetImage("assets/icon/full_ico.png"),
), ),

View file

@ -16,7 +16,8 @@ class CreateSingleEntryView extends StatefulWidget {
/// Used when user wants to add new entry /// Used when user wants to add new entry
const CreateSingleEntryView({ const CreateSingleEntryView({
required this.w, required this.w,
required this.locale, super.key, required this.locale,
super.key,
this.editEntry, this.editEntry,
}); });
@ -28,6 +29,7 @@ class CreateSingleEntryView extends StatefulWidget {
/// Is null unless we are editing an existing entry /// Is null unless we are editing an existing entry
final WalletSingleEntry? editEntry; final WalletSingleEntry? editEntry;
/// Locale as set on user's system
final String locale; final String locale;
@override @override
@ -36,6 +38,9 @@ class CreateSingleEntryView extends StatefulWidget {
class _CreateSingleEntryViewState extends State<CreateSingleEntryView> { class _CreateSingleEntryViewState extends State<CreateSingleEntryView> {
late WalletSingleEntry newEntry; late WalletSingleEntry newEntry;
final _entryNameController = TextEditingController();
final _entryBalanceController = TextEditingController();
final _entryDescriptionController = TextEditingController();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -50,6 +55,9 @@ class _CreateSingleEntryViewState extends State<CreateSingleEntryView> {
category: widget.w.categories.first, category: widget.w.categories.first,
); );
} }
_entryNameController.text = newEntry.data.name;
_entryBalanceController.text = newEntry.data.amount.toString();
_entryDescriptionController.text = newEntry.data.description;
setState(() {}); setState(() {});
} }
@ -71,10 +79,7 @@ class _CreateSingleEntryViewState extends State<CreateSingleEntryView> {
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
child: PlatformField( child: PlatformField(
labelText: AppLocalizations.of(context).name, labelText: AppLocalizations.of(context).name,
controller: TextEditingController(text: newEntry.data.name), controller: _entryNameController,
onChanged: (v) {
newEntry.data.name = v;
},
), ),
), ),
const SizedBox( const SizedBox(
@ -84,9 +89,7 @@ class _CreateSingleEntryViewState extends State<CreateSingleEntryView> {
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
child: PlatformField( child: PlatformField(
labelText: AppLocalizations.of(context).amount, labelText: AppLocalizations.of(context).amount,
controller: TextEditingController( controller: _entryBalanceController,
text: newEntry.data.amount.toString(),
),
keyboardType: keyboardType:
const TextInputType.numberWithOptions(decimal: true), const TextInputType.numberWithOptions(decimal: true),
inputFormatters: [ inputFormatters: [
@ -94,9 +97,6 @@ class _CreateSingleEntryViewState extends State<CreateSingleEntryView> {
RegExp(r'\d+[\.,]{0,1}\d{0,}'), RegExp(r'\d+[\.,]{0,1}\d{0,}'),
), ),
], ],
onChanged: (v) {
newEntry.data.amount = double.parse(v);
},
), ),
), ),
const SizedBox( const SizedBox(
@ -183,12 +183,7 @@ class _CreateSingleEntryViewState extends State<CreateSingleEntryView> {
child: PlatformField( child: PlatformField(
keyboardType: TextInputType.multiline, keyboardType: TextInputType.multiline,
maxLines: null, maxLines: null,
controller: TextEditingController( controller: _entryDescriptionController,
text: newEntry.data.description,
),
onChanged: (v) {
newEntry.data.description = v;
},
), ),
), ),
const SizedBox( const SizedBox(
@ -197,10 +192,10 @@ class _CreateSingleEntryViewState extends State<CreateSingleEntryView> {
Text(AppLocalizations.of(context).date), Text(AppLocalizations.of(context).date),
PlatformButton( PlatformButton(
style: ButtonStyle( style: ButtonStyle(
backgroundColor: MaterialStateProperty.all( backgroundColor: WidgetStateProperty.all(
Theme.of(context).colorScheme.primary, Theme.of(context).colorScheme.primary,
), ),
foregroundColor: MaterialStateProperty.all( foregroundColor: WidgetStateProperty.all(
Theme.of(context).colorScheme.onPrimary, Theme.of(context).colorScheme.onPrimary,
), ),
), ),
@ -224,13 +219,18 @@ class _CreateSingleEntryViewState extends State<CreateSingleEntryView> {
PlatformButton( PlatformButton(
text: AppLocalizations.of(context).save, text: AppLocalizations.of(context).save,
onPressed: () { onPressed: () {
if (newEntry.data.name.isEmpty) { if (_entryNameController.text.isEmpty) {
showMessage( showMessage(
AppLocalizations.of(context).errorEmptyName, AppLocalizations.of(context).errorEmptyName,
context, context,
); );
return; return;
} }
newEntry.data.name = _entryNameController.text;
newEntry.data.amount =
double.parse(_entryBalanceController.text);
newEntry.data.description =
_entryDescriptionController.text;
if (widget.editEntry != null) { if (widget.editEntry != null) {
Navigator.of(context).pop(newEntry); Navigator.of(context).pop(newEntry);
return; return;

View file

@ -7,7 +7,6 @@ import 'package:prasule/api/entry_data.dart';
import 'package:prasule/api/recurring_entry.dart'; import 'package:prasule/api/recurring_entry.dart';
import 'package:prasule/api/wallet.dart'; import 'package:prasule/api/wallet.dart';
import 'package:prasule/api/wallet_manager.dart'; import 'package:prasule/api/wallet_manager.dart';
import 'package:prasule/main.dart';
import 'package:prasule/pw/platformbutton.dart'; import 'package:prasule/pw/platformbutton.dart';
import 'package:prasule/pw/platformfield.dart'; import 'package:prasule/pw/platformfield.dart';
import 'package:prasule/util/show_message.dart'; import 'package:prasule/util/show_message.dart';
@ -39,6 +38,10 @@ class CreateRecurringEntryView extends StatefulWidget {
class _CreateRecurringEntryViewState extends State<CreateRecurringEntryView> { class _CreateRecurringEntryViewState extends State<CreateRecurringEntryView> {
late RecurringWalletEntry newEntry; late RecurringWalletEntry newEntry;
final _entryNameController = TextEditingController();
final _entryBalanceController = TextEditingController();
final _entryDescriptionController = TextEditingController();
final _repeatAfterController = TextEditingController();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -55,6 +58,10 @@ class _CreateRecurringEntryViewState extends State<CreateRecurringEntryView> {
recurType: RecurType.month, recurType: RecurType.month,
); );
} }
_entryNameController.text = newEntry.data.name;
_entryBalanceController.text = newEntry.data.amount.toString();
_entryDescriptionController.text = newEntry.data.description;
_repeatAfterController.text = newEntry.repeatAfter.toString();
setState(() {}); setState(() {});
} }
@ -76,10 +83,7 @@ class _CreateRecurringEntryViewState extends State<CreateRecurringEntryView> {
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
child: PlatformField( child: PlatformField(
labelText: AppLocalizations.of(context).name, labelText: AppLocalizations.of(context).name,
controller: TextEditingController(text: newEntry.data.name), controller: _entryNameController,
onChanged: (v) {
newEntry.data.name = v;
},
), ),
), ),
const SizedBox( const SizedBox(
@ -89,9 +93,7 @@ class _CreateRecurringEntryViewState extends State<CreateRecurringEntryView> {
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
child: PlatformField( child: PlatformField(
labelText: AppLocalizations.of(context).amount, labelText: AppLocalizations.of(context).amount,
controller: TextEditingController( controller: _entryBalanceController,
text: newEntry.data.amount.toString(),
),
keyboardType: keyboardType:
const TextInputType.numberWithOptions(decimal: true), const TextInputType.numberWithOptions(decimal: true),
inputFormatters: [ inputFormatters: [
@ -99,10 +101,6 @@ class _CreateRecurringEntryViewState extends State<CreateRecurringEntryView> {
RegExp(r'\d+[\.,]{0,1}\d{0,}'), RegExp(r'\d+[\.,]{0,1}\d{0,}'),
), ),
], ],
onChanged: (v) {
logger.i(v);
newEntry.data.amount = double.parse(v);
},
), ),
), ),
const SizedBox( const SizedBox(
@ -189,12 +187,7 @@ class _CreateRecurringEntryViewState extends State<CreateRecurringEntryView> {
child: PlatformField( child: PlatformField(
keyboardType: TextInputType.multiline, keyboardType: TextInputType.multiline,
maxLines: null, maxLines: null,
controller: TextEditingController( controller: _entryDescriptionController,
text: newEntry.data.description,
),
onChanged: (v) {
newEntry.data.description = v;
},
), ),
), ),
const SizedBox( const SizedBox(
@ -215,9 +208,7 @@ class _CreateRecurringEntryViewState extends State<CreateRecurringEntryView> {
SizedBox( SizedBox(
width: 50, width: 50,
child: PlatformField( child: PlatformField(
controller: TextEditingController( controller: _repeatAfterController,
text: newEntry.repeatAfter.toString(),
),
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.digitsOnly, FilteringTextInputFormatter.digitsOnly,
FilteringTextInputFormatter.deny( FilteringTextInputFormatter.deny(
@ -313,13 +304,20 @@ class _CreateRecurringEntryViewState extends State<CreateRecurringEntryView> {
PlatformButton( PlatformButton(
text: AppLocalizations.of(context).save, text: AppLocalizations.of(context).save,
onPressed: () { onPressed: () {
if (newEntry.data.name.isEmpty) { if (_entryNameController.text.isEmpty) {
showMessage( showMessage(
AppLocalizations.of(context).errorEmptyName, AppLocalizations.of(context).errorEmptyName,
context, context,
); );
return; return;
} }
newEntry.data.name = _entryNameController.text;
newEntry.data.amount =
double.parse(_entryBalanceController.text);
newEntry.repeatAfter =
int.parse(_repeatAfterController.text);
newEntry.data.description =
_entryDescriptionController.text;
if (widget.editEntry != null) { if (widget.editEntry != null) {
Navigator.of(context).pop(newEntry); Navigator.of(context).pop(newEntry);
return; return;

View file

@ -97,7 +97,8 @@ class _GraphViewState extends State<GraphView> {
super.initState(); super.initState();
loadWallet(); loadWallet();
SharedPreferences.getInstance().then((s) { SharedPreferences.getInstance().then((s) {
chartType = s.getInt("monthlygraph") ?? 2; chartType = s.getInt("yearlygraph") ?? 1;
logger.d(chartType);
setState(() {}); setState(() {});
}); });
} }
@ -197,7 +198,9 @@ class _GraphViewState extends State<GraphView> {
title: DropdownButton<int>( title: DropdownButton<int>(
value: (selectedWallet == null) value: (selectedWallet == null)
? -1 ? -1
: wallets.indexOf(selectedWallet!), : wallets.indexOf(
wallets.where((w) => w.name == selectedWallet!.name).first,
),
items: [ items: [
...wallets.map( ...wallets.map(
(e) => DropdownMenuItem( (e) => DropdownMenuItem(
@ -333,7 +336,7 @@ class _GraphViewState extends State<GraphView> {
? Theme.of(context) ? Theme.of(context)
.colorScheme .colorScheme
.secondaryContainer .secondaryContainer
: Theme.of(context).colorScheme.background, : Theme.of(context).colorScheme.surface,
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
@ -427,7 +430,7 @@ class _GraphViewState extends State<GraphView> {
? Theme.of(context) ? Theme.of(context)
.colorScheme .colorScheme
.secondaryContainer .secondaryContainer
: Theme.of(context).colorScheme.background, : Theme.of(context).colorScheme.surface,
), ),
width: MediaQuery.of(context).size.width * 0.95, width: MediaQuery.of(context).size.width * 0.95,
height: MediaQuery.of(context).size.height * 0.4, height: MediaQuery.of(context).size.height * 0.4,
@ -557,7 +560,7 @@ class _GraphViewState extends State<GraphView> {
? Theme.of(context) ? Theme.of(context)
.colorScheme .colorScheme
.secondaryContainer .secondaryContainer
: Theme.of(context).colorScheme.background, : Theme.of(context).colorScheme.surface,
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
@ -650,7 +653,7 @@ class _GraphViewState extends State<GraphView> {
? Theme.of(context) ? Theme.of(context)
.colorScheme .colorScheme
.secondaryContainer .secondaryContainer
: Theme.of(context).colorScheme.background, : Theme.of(context).colorScheme.surface,
), ),
width: MediaQuery.of(context).size.width * 0.95, width: MediaQuery.of(context).size.width * 0.95,
height: MediaQuery.of(context).size.height * 0.4, height: MediaQuery.of(context).size.height * 0.4,

View file

@ -166,7 +166,11 @@ class _HomeViewState extends State<HomeView> {
secondChild: DropdownButton<int>( secondChild: DropdownButton<int>(
value: (selectedWallet == null) value: (selectedWallet == null)
? -1 ? -1
: wallets.indexOf(selectedWallet!), : wallets.indexOf(
wallets
.where((w) => w.name == selectedWallet!.name)
.first,
),
items: [ items: [
...wallets.map( ...wallets.map(
(e) => DropdownMenuItem( (e) => DropdownMenuItem(
@ -355,7 +359,7 @@ class _HomeViewState extends State<HomeView> {
style: TextStyle( style: TextStyle(
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme
.onBackground, .onSurface,
), ),
), ),
TextSpan( TextSpan(
@ -405,7 +409,7 @@ class _HomeViewState extends State<HomeView> {
style: TextStyle( style: TextStyle(
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme
.onBackground, .onSurface,
), ),
), ),
], ],
@ -590,7 +594,7 @@ class _HomeViewState extends State<HomeView> {
style: TextStyle( style: TextStyle(
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme
.background .surface
.calculateTextColor(), .calculateTextColor(),
), ),
), ),

View file

@ -63,8 +63,11 @@ class _RecurringEntriesViewState extends State<RecurringEntriesView> {
drawer: makeDrawer(context, 3), drawer: makeDrawer(context, 3),
appBar: AppBar( appBar: AppBar(
title: DropdownButton<int>( title: DropdownButton<int>(
value: value: (selectedWallet == null)
(selectedWallet == null) ? -1 : wallets.indexOf(selectedWallet!), ? -1
: wallets.indexOf(
wallets.where((w) => w.name == selectedWallet!.name).first,
),
items: [ items: [
...wallets.map( ...wallets.map(
(e) => DropdownMenuItem( (e) => DropdownMenuItem(

View file

@ -37,7 +37,7 @@ class _GraphTypeSettingsViewState extends State<GraphTypeSettingsView> {
body: SettingsList( body: SettingsList(
applicationType: ApplicationType.both, applicationType: ApplicationType.both,
darkTheme: SettingsThemeData( darkTheme: SettingsThemeData(
settingsListBackground: Theme.of(context).colorScheme.background, settingsListBackground: Theme.of(context).colorScheme.surface,
titleTextColor: Theme.of(context).colorScheme.primary, titleTextColor: Theme.of(context).colorScheme.primary,
), ),
sections: [ sections: [

View file

@ -42,7 +42,7 @@ class _SettingsViewState extends State<SettingsView> {
body: SettingsList( body: SettingsList(
applicationType: ApplicationType.both, applicationType: ApplicationType.both,
darkTheme: SettingsThemeData( darkTheme: SettingsThemeData(
settingsListBackground: Theme.of(context).colorScheme.background, settingsListBackground: Theme.of(context).colorScheme.surface,
titleTextColor: Theme.of(context).colorScheme.primary, titleTextColor: Theme.of(context).colorScheme.primary,
), ),
sections: [ sections: [

View file

@ -277,10 +277,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: fl_chart name: fl_chart
sha256: "00b74ae680df6b1135bdbea00a7d1fc072a9180b7c3f3702e4b19a9943f5ed7d" sha256: "2b7c1f5d867da9a054661641c8f499c55c47c39acccb97b3bc673f5fa9a39e74"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.66.2" version: "0.67.0"
flex_color_picker: flex_color_picker:
dependency: "direct main" dependency: "direct main"
description: description:

View file

@ -1,7 +1,7 @@
name: prasule name: prasule
description: Open-source private expense tracker description: Open-source private expense tracker
version: 1.1.0+7 version: 1.1.1+8
environment: environment:
sdk: '>=3.1.0-262.2.beta <4.0.0' sdk: '>=3.1.0-262.2.beta <4.0.0'
@ -18,12 +18,12 @@ dependencies:
currency_picker: ^2.0.16 currency_picker: ^2.0.16
dio: ^5.3.0 dio: ^5.3.0
dynamic_color: ^1.6.6 dynamic_color: ^1.6.6
fl_chart: ^0.66.0 fl_chart: ^0.67.0
flex_color_picker: ^3.3.0 flex_color_picker: ^3.3.0
flutter: flutter:
sdk: flutter sdk: flutter
flutter_file_dialog: ^3.0.2 flutter_file_dialog: ^3.0.2
flutter_iconpicker: <3.4.5 flutter_iconpicker: <3.4.6
flutter_localizations: flutter_localizations:
sdk: flutter sdk: flutter
flutter_slidable: ^3.0.0 flutter_slidable: ^3.0.0