The basic skeleton of the project is created without any external dependencies. If you would like to create similar project to learn about Flutter widgets, you can reuse all the codes of the base branch. I hope it is useful to you and save you some efforts and times.
Note: While the code in the base branch still working fine, the Fluwix no longer using the code structure described below. Please refer to the lib/main.dart
of the main branch for latest code structure and the blog post to find out the reason I adopted flutter_modular package.
The project following certain naming conventions and directory stucture as per the following image and description:
-
The
common/presentation/widgets
directory stored the codes of reusable widgets of the project -
Each widget will be coded in separate branch and come with it's own
README.md
file. The recommended naming convention is the directory name inlib
andimages
directory is same with the branch name and the main file of the widget isbranch_name
_screen. -
The
nested_list
is a good example on the image above and please check out the branch.
In the lib\main.dart
file:
- Add the name of new widget to the
names
list:
List<String> names = [
'Nested List',
'Tab Buttons',
'Stock Chart',
'New Widget', // example
];
- Open the new widget's screen in
onTap
event of the list view,3
is the position of new widget innames
list:
onTap: () {
switch (position) {
case 0:
_gotoScreen(context, NestedListScreen());
break;
case 3: // example
_gotoScreen(context, NewWidgetScreen()); // example
break; // example
}
},