赞
踩
AppBarDemo.dart
- import 'package:flutter/material.dart';
-
- class AppBarPage extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- //标题居中
- centerTitle: true,
- title: Text("AppBarDemo"),
- //背景颜色
- backgroundColor: Colors.red,
- //设置前面显示图片
- leading: IconButton(
- icon: Icon(Icons.menu),
- onPressed: () {},
- ),
-
- //后面放置图标
- actions: <Widget>[
- IconButton(
- icon: Icon(Icons.help),
- onPressed: () {},
- ),
- IconButton(
- icon: Icon(Icons.settings),
- onPressed: () {},
- ),
- ],
- ),
- body: Text("AppBarDemo页面内容区域"),
- );
- }
- }

显示效果:
AppBarDemo.dart
- import 'package:flutter/material.dart';
-
- class AppBarPage extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。