Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
country_list_tile.dart
Go to the documentation of this file.
1import 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3
4import '../../models/country_model.dart';
5
6class CountryListTile extends StatelessWidget {
8 final bool isSelected;
9 final void Function()? onTap;
10
12 super.key,
13 required this.country,
14 required this.isSelected,
15 required this.onTap,
16 });
17
18 @override
19 Widget build(BuildContext context) {
20 return Padding(
21 padding: EdgeInsets.symmetric(horizontal: 5.sp),
22 child: ListTile(
23 contentPadding: EdgeInsets.symmetric(
24 horizontal: 2.sp,
25 vertical: 1.sp,
26 ),
27 leading: Text(
28 country.flag,
29 style: Theme.of(context).textTheme.displayMedium,
30 ),
31 title: Text(
32 '${country.name} (${country.language})',
33 style: Theme.of(context).textTheme.bodySmall?.copyWith(
35 ? Theme.of(context).colorScheme.primary
36 : Theme.of(context).hintColor,
37 fontWeight: isSelected ? FontWeight.bold : FontWeight.normal,
38 ),
39 ),
40 trailing: Text(
41 country.currency,
42 style: Theme.of(context).textTheme.displaySmall?.copyWith(
44 ? Theme.of(context).colorScheme.primary
45 : Theme.of(context).hintColor,
46 fontWeight: isSelected ? FontWeight.bold : FontWeight.normal,
47 ),
48 ),
49 onTap: onTap,
50 ),
51 );
52 }
53}
final VoidCallback onTap
final String title
final Widget child
override Widget build(BuildContext context)
final void Function()? onTap
final CountryModel country
const CountryListTile({ super.key, required this.country, required this.isSelected, required this.onTap, })