|
@@ -2,100 +2,130 @@ import 'dart:html';
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
+import 'package:hengyi/utils/dio_util.dart';
|
|
|
|
|
|
class CountryDetailWidget extends StatelessWidget {
|
|
|
- const CountryDetailWidget({super.key});
|
|
|
+ CountryDetailWidget(this.countryId, {super.key});
|
|
|
+
|
|
|
+ final int countryId;
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- return Column(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: [
|
|
|
- Expanded(
|
|
|
- flex: 1,
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- margin: const EdgeInsets.only(top: 20),
|
|
|
- height: 150,
|
|
|
- child: Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: [
|
|
|
- const Text(
|
|
|
- "美国",
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 24,
|
|
|
- fontWeight: FontWeight.bold,
|
|
|
- color: Colors.black),
|
|
|
- ),
|
|
|
- Image(
|
|
|
- image: const AssetImage("images/logo.png"),
|
|
|
- width: 200.w,
|
|
|
- height: 150.w,
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- Container(
|
|
|
- color: Colors.grey[300],
|
|
|
- height: 60.h,
|
|
|
- width: 800.w,
|
|
|
- margin: EdgeInsets.only(top: 20.w),
|
|
|
- child: Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Row(
|
|
|
+ return FutureBuilder(
|
|
|
+ future: NetworkUtil().getCountryDetail(countryId),
|
|
|
+ builder: (context, snapshot) {
|
|
|
+ if (snapshot.connectionState == ConnectionState.done) {
|
|
|
+ if (snapshot.hasData) {
|
|
|
+ return Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ flex: 1,
|
|
|
+ child: Column(
|
|
|
children: [
|
|
|
- Text(
|
|
|
- "签证须知:",
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 14.sp,
|
|
|
- color: Colors.red,
|
|
|
- fontWeight: FontWeight.bold),
|
|
|
+ Container(
|
|
|
+ margin: const EdgeInsets.only(top: 20),
|
|
|
+ height: 150,
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ snapshot.data?.countryName ?? "",
|
|
|
+ style: const TextStyle(
|
|
|
+ fontSize: 24,
|
|
|
+ fontWeight: FontWeight.bold,
|
|
|
+ color: Colors.black),
|
|
|
+ ),
|
|
|
+ Image(
|
|
|
+ image: NetworkImage(
|
|
|
+ snapshot.data?.countryImgUrl ?? ""),
|
|
|
+ width: 200.w,
|
|
|
+ height: 150.w,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
- Text(
|
|
|
- "具体内容",
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 14.sp,
|
|
|
- color: Colors.black,
|
|
|
- fontWeight: FontWeight.bold),
|
|
|
+ Container(
|
|
|
+ color: Colors.grey[300],
|
|
|
+ height: 60.h,
|
|
|
+ width: 800.w,
|
|
|
+ margin: EdgeInsets.only(top: 20.w),
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ "签证须知:",
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14.sp,
|
|
|
+ color: Colors.red,
|
|
|
+ fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ snapshot.data?.countryContent ?? "",
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14.sp,
|
|
|
+ color: Colors.black,
|
|
|
+ fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ if (snapshot.data != null &&
|
|
|
+ snapshot.data!.countryVisitVisaUrl.isNotEmpty) {
|
|
|
+ downLoadFile(snapshot.data!.countryVisitVisaUrl);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(top: 20.w),
|
|
|
+ child: Text(
|
|
|
+ "${snapshot.data?.countryName ?? ""}-旅游签证材料清单",
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14.sp,
|
|
|
+ color: Colors.red,
|
|
|
+ fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ if (snapshot.data != null &&
|
|
|
+ snapshot.data!.countryVisitVisaUrl.isNotEmpty) {
|
|
|
+ downLoadFile(
|
|
|
+ snapshot.data!.countryBusinessVisaUrl);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(top: 20.w),
|
|
|
+ child: Text(
|
|
|
+ "${snapshot.data?.countryName ?? ""}-商务签证材料清单",
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14.sp,
|
|
|
+ color: Colors.red,
|
|
|
+ fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ )
|
|
|
],
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- GestureDetector(
|
|
|
- onTap: () {
|
|
|
- downLoadFile(
|
|
|
- "https://cos.appmeta.cn/eeaac010563eb2cf6c32d828a7be8956b775d811.apk?sign=f673649c442673cfbc0f17693955f0f3&t=1678935183");
|
|
|
- },
|
|
|
- child: Container(
|
|
|
- margin: EdgeInsets.only(top: 20.w),
|
|
|
- child: Text(
|
|
|
- "美国-旅游签证材料清单",
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 14.sp,
|
|
|
- color: Colors.red,
|
|
|
- fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- ),
|
|
|
- Container(
|
|
|
- margin: EdgeInsets.only(top: 20.w),
|
|
|
- child: Text(
|
|
|
- "美国-商务签证材料清单",
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 14.sp,
|
|
|
- color: Colors.red,
|
|
|
- fontWeight: FontWeight.bold),
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- );
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return Text("Error:${snapshot.error}");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return Container(
|
|
|
+ alignment: Alignment.center,
|
|
|
+ child: const CircularProgressIndicator(),
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
///调用浏览器的下载功能下载文件
|