chrisvilches / kakeibo-ui Goto Github PK
View Code? Open in Web Editor NEWA simple money management app made in Flutter.
A simple money management app made in Flutter.
Add .env.sample
(or something like that) and remove the .env.development
, .env.production
, etc from the repository.
Update: This error happens when the token has expired, or when the token has been removed. Fix both cases (should be similar, or the same).
At this point, an error message should appear, the splash screen gets skipped, and redirects to the login view. Also, some exceptions are probably being raised during all of this (not sure).
Note that as far as I can remember, the app can still be used perfectly, but it just looks a bit weird that the splash screen gets skipped.
Also, the snackbars don't look bad, but they are conflicting. Both these errors are logged (this logging may have been removed in the future):
flutter: (global_error_handler_service.dart) Exception caught in '_handleException'. Message: Not logged in, type: NotLoggedInException
flutter: (main.dart) onTokenRemoved executed. Snackbar message: Please login
Group all _view
files into a /views
folder, and separate them from normal widgets (decoration stuff).
There are more ways to refactor it though, for example by having one folder for each view, and store the controller and other files there as well.
The app is still small so I don't know.
I think it's important to keep views/widgets away from other stuff like "localization" and "services" (REST and GraphQL wrapper), etc.
There are a few widgets in /widgets that contain a Scaffold. This might mean that the widget is intended to be a view rather than a small widget.
It's not tested in Android yet.
Error happens:
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Null check operator used on a null value
#0 Element.widget (package:flutter/src/widgets/framework.dart:3087:31)
#1 RenderObjectElement.widget (package:flutter/src/widgets/framework.dart:5380:42)
#2 SliverMultiBoxAdaptorElement.widget (package:flutter/src/widgets/sliver.dart:1113:51)
#3 Provider._inheritedElementOf (package:provider/src/provider.dart:341:17)
#4 Provider.of (package:provider/src/provider.dart:293:30)
#5 ExpenseListContainerWidget._undoRemoveExpense (package:kakeibo_ui/src/widgets/day_detail/expenses_tab/expense_list_container_widget.dart:27:22)
<asynchronous suspension>
This is bad for two reasons:
It only works when going back to period list, and then clicking again on the period where the bug happened (it reloads the period data).
The code that triggers the error is here (as of 2022/01/23):
lib/src/widgets/day_detail/expenses_tab/expense_list_container_widget.dart
Future<void> _undoRemoveExpense(BuildContext context, Expense expense) async {
await expense.destroy(undo: true);
try {
await Provider.of<NavigationStore>(context, listen: false).reloadExpenses();
} catch (e) {
debugPrint("""Expense was restored, however the period data could not be reloaded,
due to issue with context (this happens when the UNDO button is clicked
outside the expense management screen). Exception message: $e""");
}
}
So it seems that Provider.of
doesn't work because the context has probably been removed, or something along those lines.
For now the error is patched with a try/catch.
The period is reloaded after pressing UNDO, affecting the data shown in each day in the list, charts, and the expense list when going to the expense list screen again.
A message is displayed, so maybe it's done. (Needs a lot of testing).
Also try to find similar errors.
Currently there are none (only tested manually)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.