Flutter E-Commerce
  • Introduction
  • Technologies
  • Installation
    • System Requirements
    • The App
  • Guide
    • Customize
  • Packages
  • FAQ's
  • License
  • Release Notes
Powered by GitBook
On this page
  • Start Building Your App
  • How to navigate between screens

Was this helpful?

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());
  }
PreviousThe AppNextCustomize

Last updated 5 years ago

Was this helpful?