学习笔记
1.AppBar的简单使用
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({
Key? key}) : super(key: key);
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(primarySwatch: Colors.blue),
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({
Key? key}) : super(key: key);
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Flutter demo"),
backgroundColor: Colors.green,
leading: IconButton
Flutter应用实践:AppBar与TabBar组件详解

本文介绍了Flutter中AppBar的使用,包括设置标题、导航图标和操作按钮。接着讲解了如何结合TabBar和TabBarView实现菜单栏功能,通过TabController进行联动,并展示了相关属性的调整,如滚动、指示器颜色和大小等。
最低0.47元/天 解锁文章
2634

被折叠的 条评论
为什么被折叠?



