Flutter [self] 4.1 Material Design using the font icon (icon)

4.1 Material Design using the font icon (icon)

1. Source Code

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget{
  @override
  Widget build(BuildContext context ){
    return MaterialApp(
      title:'All Widget Usages',
      home:Scaffold(
          body:
          Center(
              child:
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  Icon(Icons.airline_seat_legroom_normal,color: Colors.green,),
                  Icon(Icons.access_alarms,color: Colors.green,),
                  Icon(Icons.aspect_ratio,color: Colors.green,),
                ],
              ),
          )
      ),
    );
  }
}

2. Explain the source code

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget{
  @override
  Widget build(BuildContext context ){
    return MaterialApp(
      title:'All Widget Usages',
      home:Scaffold(
          body:
          Center(
              child:
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  //本地icon的使用
                  Icon(Icons.airline_seat_legroom_normal,color: Colors.green,),
                  Icon(Icons.access_alarms,color: Colors.green,),
                  Icon(Icons.aspect_ratio,color: Colors.green,),
                ],
              ),
          )
      ),
    );
  }
}

3. renderings

Renderings

Guess you like

Origin blog.csdn.net/weixin_43266090/article/details/93502520