A new Flutter project with mason
.
Note:
The login
feature was altered, and I created the LoginFAB
to add functionality to the LoginScreen
.
I created additional tests to cover the new functionality.
The signup
feature was created from scratch using mason
. The reason that I didn't change anything is for you to see the default code generated by mason
.
-
1. Run the
mason_cli
command:dart pub global activate mason_cli
-
2. Run the
mason
init command:mason init
-
3. Run the
mason
install command:mason add feature_brick
-
4. use the
Makefile
I created like:make create_feature_brick name=login
-
5. List the
lib/features
directory and see the newly created feature:ls lib/features
-
6. Add
flutter_riverpod
dependency topubspec.yaml
:flutter pub add flutter_riverpod
You will get an error saying:
The imported package 'riverpod' isn't a dependency of the importing package lib/features/login/provider/login_provider.dart:1:8 depend_on_referenced_packages
Change the import to:
import 'package:flutter_riverpod/flutter_riverpod.dart';
And you're done!