导航栏-1

 

 

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('登录页面'),
    );
  }
}
posted @ 2021-08-03 20:19  13522679763-任国强  阅读(32)  评论(0)    收藏  举报