import 'package:flutter/material.dart'; import 'package:flutter_provider_demo/pages/home_page.dart'; import 'package:flutter_provider_demo/pages/message_page.dart'; import 'package:flutter_provider_demo/pages/mine_page.dart'; /// Description: index page /// Time : 09/03/2023 Sunday /// Author : liuyuqi.gov@msn.cn class IndexPage extends StatefulWidget { const IndexPage({super.key}); @override State createState() => _IndexPageState(); } class _IndexPageState extends State { final List _list = []; List pages = [ const HomePage(), const MessagePage(), const MinePage() ]; @override Widget build(BuildContext context) { return Scaffold( body: const Placeholder(), appBar: AppBar( title: const Text('Index Page'), ), floatingActionButton: FloatingActionButton( onPressed: () { setState(() { _list.add('Item ${_list.length}'); }); }, tooltip: 'Add Item', child: const Icon(Icons.add), ), bottomNavigationBar: BottomNavigationBar( items: const [ BottomNavigationBarItem( icon: Icon(Icons.home), label: 'Home', ), BottomNavigationBarItem( icon: Icon(Icons.business), label: 'Message', ), BottomNavigationBarItem( icon: Icon(Icons.school), label: 'Mine', ), ], )); } }