-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathexpansion_category.dart
57 lines (53 loc) · 1.55 KB
/
expansion_category.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../../../../route/screen_export.dart';
import '../../../../constants.dart';
class ExpansionCategory extends StatelessWidget {
const ExpansionCategory({
super.key,
required this.title,
required this.subCategory,
required this.svgSrc,
});
final String title, svgSrc;
final List subCategory;
@override
Widget build(BuildContext context) {
return ExpansionTile(
iconColor: Theme.of(context).textTheme.bodyLarge!.color,
collapsedIconColor: Theme.of(context).textTheme.bodyMedium!.color,
leading: SvgPicture.asset(
svgSrc,
height: 24,
width: 24,
colorFilter: ColorFilter.mode(
Theme.of(context).iconTheme.color!,
BlendMode.srcIn,
),
),
title: Text(
title,
style: const TextStyle(fontSize: 14),
),
textColor: Theme.of(context).textTheme.bodyLarge!.color,
childrenPadding: const EdgeInsets.only(left: defaultPadding * 3.5),
children: List.generate(
subCategory.length,
(index) => Column(
children: [
ListTile(
onTap: () {
Navigator.pushNamed(context, onSaleScreenRoute);
},
title: Text(
subCategory[index].title,
style: const TextStyle(fontSize: 14),
),
),
if (index < subCategory.length - 1) const Divider(height: 1),
],
),
),
);
}
}