123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- 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<IndexPage> createState() => _IndexPageState();
- }
- class _IndexPageState extends State<IndexPage> {
- final List<String> _list = <String>[];
- List<Widget> 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>[
- BottomNavigationBarItem(
- icon: Icon(Icons.home),
- label: 'Home',
- ),
- BottomNavigationBarItem(
- icon: Icon(Icons.business),
- label: 'Message',
- ),
- BottomNavigationBarItem(
- icon: Icon(Icons.school),
- label: 'Mine',
- ),
- ],
- ));
- }
- }
|