12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import 'package:flutter/material.dart';
- import 'package:hengyi/home/about_us.dart';
- import 'package:hengyi/home/contact_us.dart';
- import 'package:hengyi/home/country_list.dart';
- import 'package:hengyi/widget/common_footer.dart';
- import 'package:hengyi/widget/common_title.dart';
- class HomePage extends StatefulWidget {
- HomePage({super.key});
- @override
- State<HomePage> createState() => _HomePageState();
- }
- class _HomePageState extends State<HomePage>
- with SingleTickerProviderStateMixin {
- late TabController _tabController;
- List tabs = ["了解目的地", "联系我们", "关于我们"];
- @override
- void initState() {
- super.initState();
- _tabController = TabController(length: tabs.length, vsync: this);
- }
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Column(
- children: [
- const CommonTitleWidget(),
- TabBar(
- labelColor: Colors.black,
- unselectedLabelColor: Colors.grey,
- controller: _tabController,
- tabs: tabs
- .map((e) => Tab(
- text: e,
- ))
- .toList()),
- Expanded(
- child: TabBarView(
- controller: _tabController,
- children: [
- CountryListWidget(),
- ContactUSWidget(),
- AboutUSWidget(),
- ],
- )),
- CommonFooterWidget(),
- ],
- ),
- );
- }
- @override
- void dispose() {
- _tabController.dispose();
- super.dispose();
- }
- }
|