nivisi / later Goto Github PK
View Code? Open in Web Editor NEW๐ฐ Later is an app that allows you to save your reading for... later.
License: MIT License
๐ฐ Later is an app that allows you to save your reading for... later.
License: MIT License
As we're following clean architecture, our BLoC must not know about repositories or whatsoever, only use cases.
So, we need a use case that will allow HomeBloc
(#3) to watch for all the home records.
We need to get to know how we will work in this repo. This is a test ticket where we need to add a test.dart
file to the lib
folder.
In the repositories we'll need to use data sources in order to access the data.
Steps:
RecordModel
to RecordDbModel
and move it under the data/models
folderRecordModel
with all the fields made final. Put it under domain/models
folder.RecordsDataSource
with these methods:
watchAll
create
getById
RecordsLocalDataSource
that make it work with Isar
(see the logic in the current RecordsRepository
). This local data source must be correctly annotated for injectable
, see the documentation.RecordsRepository
work with this local data source. Map RecordDbModel
s to RecordModel
s.As we follow the BLoC pattern, we need to setup HomeCubit
. At the moment the only dependency should be WatchAllRecordsUseCase
to access the records stream.
As a user, I would like to know why the Save
button is locked and what should I do to resolve it.
We have the following validation rules:
Once a user starts typing, we can start validating fields. On error, make fields that have errors red and display corresponding error messages under the fields. Lookup how to do it with a form widget.
Important: an input must not display an error if it has not been edited yet. It's a reference to the form widget... It can validate fields that hasn't been edited, and a user will see the error even if they haven't typed anything yet. It's a bad UX, we must avoid it.
RecordModel must have:
After #7 is done, we are now able to finish adding a record. On the page, at the moment, the only data that we can enter is title
, description
and url
We need to:
We'll work on validation in #9
Isar can be opened only once, so we must fix it (make repositories to depend on isar
instance, not to open it inside of the repos)
On the AddRecordPage
we'll be able to add our records.
In this ticket, we'll need to add the following:
AddRecordPage
with:
New
No logic needed for now.
It would be great if we started using theming right away. Then, later on, we could easily introduce new theme palettes and change it on the fly.
Investigate what's out there on pub.dev we can use for theme. Let's chose one of them.
See #1 for the reference. Here we'll do actual implementation of the theme.
For now, let's define these colours in our palette:
And also text styles:
We'll add everything that is missing later (๐) on.
For cubit states classes we are using the freezed
message. This will allow us to emit new states easier by simply doing emit(state.copyWith(/* something */))
.
Let's create a simple HomeCubit
state that will contain a list of RecordModel
s. Also, let's have a method called init
in the cubit that will:
WatchAllRecordsUseCase
and listen to the streamP.S. Feel free to play with the state in any way. For example, create a simple button that will execute the method in the cubit that will emit a random number, or something like this. The primary goal is to get to know the package and its purpose.
Let's setup our HomePage
. It must have:
later
text; // for the app bar, let's create and use a custom widget called LaterAppBar
Pretty empty here! ๐ \n Let's create your first later record.
and a button Create
;Something went wrong during loading record...
and a button Try again
BlocProvider
. Note: please use injector
for creating a bloc.Having separate widgets for buttons such as PrimaryButton
and SecondaryButton
is a good tone: if we'll need to adjust something, we would need to do it only in one place.
So:
VoidCallback? onTap
and String title
;build
method to return a TextButton
. If needed, we'll change it to something else in the future;lib/widgets/buttons
folder.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.