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.

class NewComponent extends StatefulWidget {
 @override
  NewComponentState createState() => new NewComponentState();
    . . .
    . . .
}
class NewComponentState extends State<NewComponent> {
   . . .
   . . .

}

How to navigate between screens

Create a file router.dart , place it under /lib/.

importnewly created Views into the Router Component.

import 'package:appname/views/NewComponent/index.dart';

const String newComponentViewRoute = 'new_component';

Route<dynamic> generateRoute(RouteSettings settings) {
  switch (settings.name) {
   case newComponentViewRoute :
      return MaterialPageRoute(builder: (_) => NewComponent());
  }

Last updated