12345678910111213141516171819202122232425262728293031323334 |
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:hengyi/data/country_entity.dart';
- import 'package:hengyi/detail/detail.dart';
- import 'package:hengyi/utils/common_util.dart';
- class CountryItemWidget extends StatelessWidget {
- const CountryItemWidget(this.country, {super.key});
- final CountryEntity country;
- @override
- Widget build(BuildContext context) {
- return GestureDetector(
- onTap: () {
- Util.gotoPage(context, DetailPageWidget(country.id));
- },
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Image(
- image: NetworkImage(country.countryImgUrl),
- width: 120.w,
- height: 120.w,
- ),
- Text(
- country.countryName,
- style: TextStyle(fontSize: 14, color: Colors.black),
- )
- ],
- ),
- );
- }
- }
|