Flutter App Example | Flutter Tutorial | For Flutter Developer

Flutter Basic Concept with Example

Before you start writing the actual code let's begin with a basic understanding of the generated code from flutter project πŸ€”

Step 1: Create the starter Flutter app


import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Welcome to Flutter'),
        ),
        body: Center(
          child: Text('Hello World'),
        ),
      ),
    );
  }
}

  1. First-line above code to import the default flutter package which contains the material design.
  2. `void main()=> runApp(MyApp());` : - The main method is bootstrapper here for running the app, which required a Class (MyApp).
  3. The MyApp class is StatelessWidget, as I explained the other part in this series in flutter everything mostly considered as a widget. there are two types of widget 
  4. A) Stateless.  B) Stateful
  5. there are few builds in methods for all the widgets & we can override them according to our need
  6. In build method - it's returning a Material App which is having many default properties like Title, Home, Theme, etc. to support the Material concept.
  7. home: - require Scaffold and Scaffold can contain many props like appBar(its App Title) etc. Scaffold also requires the main props is "body" its the whole app screen body where you can place the different layout in other work you can drow anything in this canvas.
  8. the body may contain different widgets according to your need in this example we are having the Center and again Center widget is having Text Widget. and this process goes on with layout builder like in HTML divs.
 

Upcomming Blogs I will explore the most amazing features of Flutter App development 



                Happy Fluttering πŸ‘¨πŸ»‍πŸ’» 

















Popular posts from this blog

Why You Should Learn Flutter App Development in 2020