Semibox mobx base utils
This is a package with functions and widgets to make app development faster and more convenient, currently it is developed by one developer.
Support
1. Base screen
BaseScreen is a base class for all screens in the app.
- It provides some useful methods for screens.
- Every screen should extend this class.
- Example:
class MyHomePage extends BaseScreen {
const MyHomePage({Key? key}) : super(key: key);
@override
State<MyHomePage> createState() => _MyHomePageState();
}
BaseScreenState is a base class for all screen states in the app.
- It provides the
store
. - AutomaticKeepAliveClientMixin is used to keep the screen alive when the user navigates to another screen.
- It also provides the
initState
method to initialize thestore
instance. - It also provides the
build
method to build the screen. - Every screen state should extend this class.
- BaseScreenState is a stateful widget.
- Example:
class _MyHomePageState extends BaseScreenState<MyHomePage, MainStore> {}
2. Store
State managements
/// Clean before updating:
/// flutter packages pub run build_runner watch --delete-conflicting-outputs
part 'example_store.g.dart';
class ExampleStore = _ExampleStore with _$ExampleStore;
abstract class _ExampleStore with Store, BaseStoreMixin {
@override
void onInit(BuildContext context) {}
@override
void onDispose() {}
}