123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- import 'dart:math';
- import 'package:flutter/material.dart';
- import 'package:hengyi/detail/country_detail.dart';
- import 'package:hengyi/home/about_us.dart';
- import 'package:hengyi/home/contact_us.dart';
- import 'package:hengyi/widget/common_footer.dart';
- import 'package:hengyi/widget/common_title.dart';
- class DetailPageWidget extends StatefulWidget {
- DetailPageWidget(this.countryId, {super.key});
- final int countryId;
- @override
- State<DetailPageWidget> createState() => _DetailPageWidgetState();
- }
- class _DetailPageWidgetState extends State<DetailPageWidget>
- 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 MaterialApp(
- title: "夫为",
- home: Scaffold(
- body: Column(
- children: [
- const CommonTitleWidget(),
- TabBar(
- labelColor: Colors.black,
- unselectedLabelColor: Colors.grey,
- controller: _tabController,
- onTap: (value) {
- if (value == 0) {
- Navigator.pop(context);
- }
- },
- tabs: tabs
- .map((e) => Tab(
- text: e,
- ))
- .toList()),
- Expanded(
- child: TabBarView(
- controller: _tabController,
- children: [
- CountryDetailWidget(widget.countryId),
- ContactUSWidget(),
- AboutUSWidget(),
- ],
- )),
- CommonFooterWidget(),
- ],
- ),
- ),
- );
- }
- @override
- void dispose() {
- _tabController.dispose();
- super.dispose();
- }
- }
|