A flutter app that allows you to create short urls and keep track of the amount of people who clicked on them. This app consumes this Rails API.
This project uses the BLoC pattern with a little twist.
The twist here is that I'm using an AppProvider class to hold all the other blocs/services before the widgets in the widget tree.
But why?
This structure allows me to have access to blocs from anywhere in the app, thus all changes that occur in any of the blocs are quickly reflected everywhere in the app via the streams.
Clone the repository, get the dependencies and you're good to go. You'll also need to have a backend for this or use this sample backend project.
The main objective of this project is to have a base project structure that I can use for other medium-sized projects.
BLoC inspired pattern
The class AppProvider contains references to all the blocs used in the app,
this is done so that all blocs can be acessed from anywhere in the app by
requesting them from the context, which allows you to update different
screens by listening to the bloc from the context.
Basic session control
If you don't logout before closing the app, your JWT token remains stored
and will be used the next time you open the app until it is no longer valid.
If you do logout before closing the app, you'll be greeted with the login screen.
Basic API routing
The Routes class contains the core URL references for a given API,
and other classes can extend it, thus adding more routes to it and allowing
routes to be called via a method.
(eg.: yourHttpClient.post(AuthenticationRoutes.login(), authenticationData);).