Guide

Start Building Your App

This App guides you throughout building your app, providing the steps and procedure to customize.
Contents discussed in this section:
  • How to add new Component?
  • How to add new Stylesheet?
  • How to navigate between screens?
How to add new Component
  • Create a new folder, say NewComponent and place it under /lib/views/ .
  • Create a new file index.dart within this folder.
  • Name the class same as that of folder name.
1
class NewComponent extends StatefulWidget {
2
@override
3
NewComponentState createState() => new NewComponentState();
4
. . .
5
. . .
6
}
7
class NewComponentState extends State<NewComponent> {
8
. . .
9
. . .
10
11
}
Copied!

How to navigate between screens

Create a file router.dart , place it under /lib/.
importnewly created Views into the Router Component.
1
import 'package:appname/views/NewComponent/index.dart';
2
3
const String newComponentViewRoute = 'new_component';
4
5
Route<dynamic> generateRoute(RouteSettings settings) {
6
switch (settings.name) {
7
case newComponentViewRoute :
8
return MaterialPageRoute(builder: (_) => NewComponent());
9
}
10
Copied!
Last modified 2yr ago