Checkout MyThemeBox.com for Ionic & Flutter Themes

Implementing Material Design on Flutter

Flutter Tutorial Series #2: In this article, we're going to implement the material design with your flutter app.

Since we don't have any state for our current project.we need to create a StatelessWidget , which returns widgets of MaterialApp() also Scaffold() , AppBar() , Container()

class FirstApp extends StatelessWidget {
  
  Widget build(BuildContext context) {
    return MaterialApp(home: Scaffold(
      appBar: AppBar( title: Text('My First Flutter App'),),
      body: Container(
        child: Text('Hello World'),
      ),
    ),);
  }
}

then, we're calling FirstApp() inside runApp()

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

Final Source code ( main.dart )

import 'package:flutter/material.dart';

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

class FirstApp extends StatelessWidget {
  
  Widget build(BuildContext context) {
    return MaterialApp(home: Scaffold(
      appBar: AppBar( title: Text('My First Flutter App'),),
      body: Container(
        child: Text('Hello World'),
      ),
    ),);
  }
}