A new Flutter project template with Null-safety.
# dev
> flutter run
# run with Specify entry
> flutter run --target ex/exMain.dart
# build
> flutter build apk
stacked
: MVVM architectureroute
base onauto_route
, Generate using build_runnerservice
base onget_it, stacked_service
, for example [NavigationService,DialogService,BottomSheetService,SnackbarService] [ConnectivityService,OpenLinkService,ShareService,FileService,LocalStorageService...]model
base onbuilt_value
,Generate using build_runnerlocalization
base onflutter_localizations
,Built in Chinese and English [en,zh],Define in assets/langcommon utils
be located core/utils,Built in common colors,size[Colour,Distance,validators]
1. stacked
- A view file controls UI and a model file controls all data. eg: XX_view.dart && XX_view_model.dart
2. service
-
NavigationService: Router control,router listen
-
DialogService: Dialog
-
BottomSheetService: BottomSheet
-
SnackbarService: Snackbar
-
ConnectivityService :Connect to the service. Whether the application is in the foreground or zoomed to the background. Monitor the application lifecycle. use
connectivity_plus
package -
OpenLinkService : launching a URL . use
url_launcher
package -
ShareService : Share . use
share
package -
FileService : File upload, download and save service. use
path_provider
package -
LocalStorageService : Local storage service. use
shared_preferences
package -
AppSettingsService : AppSetting. use
app_settings
package -
EnvironmentService : Environment setting. use
flutter_dotenv
package -
device_info_plus : get device info . use
device_info_plus
package -
KeyboardService : Keyboard. use
flutter_keyboard_visibility
package -
HttpService : Http request. use
dio
package -
StoppableService : Stop called Service
Run in the project root directory:
> flutter packages pub run build_runner build --delete-conflicting-outputs
# or
> flutter packages pub run build_runner watch
Run in the project root directory:
# Generate routing, positioning, and logging models based on core/app/app.dart
# The result is located in /core/app/
> flutter pub run build_runner build --delete-conflicting-outputs stacked generate