📒
Mobile Development Reference-TCE-C01
  • Welcome
  • Introduction
    • Project Description
  • First Steps
    • Creating Project
    • Setting up Workspace
      • Project structure
      • Setting up the app
  • Routing
    • Setting up auto route
    • Creating the first screen
    • Setting up router
    • Adding router to Material App
  • Products Feature
    • Creating models
      • Introduction to freezed
      • Introduction to JSON annotations
      • Creating products model
    • Creating products cubit
      • Creating Products States
      • Creating Products Cubit
      • Implementing Get Products Functionality
    • Creating products repository
      • Setting up Dio
      • Making your first http request with DIO
    • Implementing Products Screen UI
      • Adding Products Grid
      • Adding Products Tile
      • Add Products Error Widget
    • Consuming the products cubit
      • Setting up Dependency injection
      • Creating Bloc Provider for ProductsCubit
      • Mapping Products Cubit states to UI
  • Testing
    • Widget Testing
    • Unit Testing
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. First Steps
  2. Setting up Workspace

Setting up the app

Alright so let's begin assuming you created the project and can currently run the hello world app, first thing to do is remove all the boilerplate and keep only the main method.

void main() async {
  runApp(Application());
}

After this, you need to create the "Application" widget. In order to do that create a new folder under src and create a new file called "application.dart"

import 'package:flutter/material.dart';

class Application extends StatelessWidget {
  const Application({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Tech camp Flutter',
        debugShowCheckedModeBanner: false,
        home: Scaffold()
    );
  }
}

So all of this is straightforward. The next step is to define our routes.

PreviousProject structureNextSetting up auto route

Last updated 4 years ago

Was this helpful?