Summary: This article outlines the Flutter App requirements.
Technical Requirements
Lists and grids must use lazy loading to display the data, using the builder methods of container widgets to do so.
Listview.builder()
See more information in the official docs here:
- Working with long lists in the Cookbook
- Creating a ListView that loads one page at a time a community article by AbdulRahman AlHamali
When the widget tree gets big enough you must use a state management alternative when sending data from a parent widget to its grandchildren or vice versa.
You can use bloc, redux, provider package libraries, etc.
- https://pub.dev/packages/provider
- https://api.flutter.dev/flutter/widgets/InheritedWidget-class.html
- https://www.freecodecamp.org/news/how-to-handle-state-in-flutter-using-the-bloc-pattern-8ed2f1e49a13/
The main.dart file must not be very extensive.
You must declare routes, themes and other initial configuration variables in separate files for this.
Custom widgets must be as short as possible to have a modular app.
You must divide a widget into smaller ones and replace chunks of code with functions that return a widget.
For example:
Dart classes must use private methods and variables and they must be final whenever possible unless it is strictly necessary to use globals.
For example:
final _variable;
Widget _methodName() {...}
Flutter apps must use stateless widgets whenever possible except when it’s strictly necessary to use stateful widgets.
The quality of flutter apps can be verified by using the ‘flutter analyze’ command from the Flutter SDK as shown below:
- In the root folder of the flutter project run flutter analyze
With the release of Flutter 2.0 have to make sure your project does not throw any errors or warnings when executing the flutter analyze command in the previous point, if so, please update all of your flutter dependencies.
If your flutter app uses the web capabilities of the framework, make sure all the libraries are compatible with web browsers since not all the pub packages are 100% compatible.
Before submitting your app for our review make sure to run flutter clean command to erase all the unnecessary files and code.