Flutter入门到放弃(四)制作appbar顶部标题栏

import 'package:flutter/material.dart';
import 'package:jifeng/widget/my_appbar.dart';

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}
class _HomePageState extends State{

  @override
  Widget build(BuildContext context){
    return Scaffold(
        appBar:AppBar(
          title: new Text('loins'),
          leading: new Icon(Icons.menu),
          backgroundColor: Color(0XFFF36926),
          centerTitle: true,
          actions: [
            // 非隐藏的菜单
            new IconButton(
                icon: new Icon(Icons.message),
                tooltip: 'Add Alarm',
                onPressed: () {}
            ),
            // 隐藏的菜单

          ],
        ),
        body: Container(
              child: ListView(
                children: [
                  Container(
                    child: Image.asset('assets/images/home/banner.jpg',fit: BoxFit.fill,),
                  )
                ],
              ),
        ),
    );
  }
}
Flutter入门到放弃(四)制作appbar顶部标题栏_第1张图片
image.png

你可能感兴趣的:(Flutter入门到放弃(四)制作appbar顶部标题栏)