This is a Web Viewer App that uses Provider & Mobx to handle state management, also it searches and checks if bluetooth devices are connected or not.
Used packages: Mobx & Provider
Used Mobx to handle state management of the app, while provider to provide the Mobx to the widget tree and listen to any changes happens, both used for easily readability of code and maintainability.
- It can handle the state of the webview screen if it is (loaded, error, etc...)
enum WebviewStoreState { loaded, error }
-
It also can observer the changes in the url and can reload or clear site from cache using the controller, etc... (some features added and some will be added later)
-
Can handle any error states, for ex: if device is offline will show cached site else if no cache data will handle the error and show it to the user and any other errors (Please check WebviewFailure class).
-
A CustomErrorWidget and beautiful loading indicators are shown to the user.
Used package: flutter_blue_plus.
Note: Unfortunately flutter_blue_plus was published from 11 days ago (from 6/5/2023) And found it is unstable, some time it shows Bluetooth Device State (connected, disconnected, etc...) and sometimes no (I will change the package later).
- Below you will see that i connected to my bluetooth air pods (named: Aukey), but when i tested on another device and connect to same bluetooth device it shows discconeted, some thing wrong with this package!
- It can show the state of devices's bluetooth if it is on or of
@observable
BluetoothState? state;
- Uses only one instance across the whole app (so no need to use service locater/dependency injection).
@observable
FlutterBluePlus flutterBluePlus = FlutterBluePlus.instance;
- The app can handle permissions required to run it, using package
permission_handler
.
Divided the app into two folders
core
andfeatures
.
core
folder, has the constants, Utils (functions, errors, etc..) and widgets that are used across the whole app.features
folder, the app is divided into features where each feature contains its own view, Mobx store and widgets (using MVVM pattern).