底部导航
Flutter 底部导航
import 'package:flutter/material.dart';
void main() => {runApp(MyApp())};
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Demo')),
body: Column(
children: <Widget>[Text('Hello')],
),
bottomNavigationBar: BottomNavigationBar(
currentIndex: 0,
fixedColor: Colors.orange,
type: BottomNavigationBarType.fixed,
items: [
BottomNavigationBarItem(
title: Text('Home'),
icon: Icon(Icons.home),
),
BottomNavigationBarItem(
title: Text('Home'),
icon: Icon(Icons.home),
),
BottomNavigationBarItem(
title: Text('Home'),
icon: Icon(Icons.home),
),
],
),
),
);
}
}最后更新于