import 'package:flutter/material.dart';
class AppBarDemoPage extends StatelessWidget { const AppBarDemoPage({Key? key}) : super(key: key);
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("AppBarDemoPage"), // backgroundColor: Colors.red, // 背景颜色 centerTitle: true, // 文字居中 leading: IconButton( icon: Icon(Icons.menu), onPressed: () { print('menu'); }, ), actions: [ IconButton( icon: Icon(Icons.search), onPressed: () { print('search'); }, ), IconButton( icon: Icon(Icons.settings), onPressed: () { print('settings'); }, ), ], ), body: Text('登录页面'), ); } }