Git Product home page Git Product logo

kakeibo-ui's People

Contributors

chrisvilches avatar

Stargazers

 avatar

Watchers

 avatar

kakeibo-ui's Issues

Remove `.env` files from repo

Add .env.sample (or something like that) and remove the .env.development, .env.production, etc from the repository.

Opening the app after token has expired skips the splash screen (and possibly causes other glitches/exceptions)

How to reproduce:

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).

  1. Login.
  2. Make the token expire (an easy way is to set token last a few seconds in Rails). Another way is to comment out the line that removes the token when logging out.
  3. Open/restart the app.

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

Expected outcome:

  • The splash screen is not skipped.
  • The user is redirected to the login view (when the splash screen ends), along with a message appearing (that says that the token has expired).
  • No exceptions are thrown.
  • Snackbars are not conflicting (only one is triggered).

Ideas for refactoring

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.

Bug when pressing "UNDO" outside the screen that triggered that snackbar

How to reproduce:

  1. Remove expense
  2. Go back in view history
  3. Press "UNDO" (snackbar is still there)

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:

  1. In the period detail list, the data does not update (charts, and the data shown in each day).
  2. When going back to the expenses screen, it doesn't display the expense list correctly.

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.

Expected outcome:

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.