8000 Tambahkan widget Hero untuk label item category dari UI Home ke List … · CoderJava/Food-Recipe@87ec080 · GitHub
[go: up one dir, main page]

Skip to content

Commit 87ec080

Browse files
committed
Tambahkan widget Hero untuk label item category dari UI Home ke List Meals
1 parent 1d0c658 commit 87ec080

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

lib/src/ui/home/home_screen.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,14 @@ class _HomeScreenState extends State<HomeScreen> {
126126
horizontal: 8.0, vertical: 12.0),
127127
child: Column(
128128
children: <Widget>[
129-
Text(
130-
category.strCategory,
131-
textAlign: TextAlign.center,
132-
style: TextStyle(
133-
color: Colors.white,
129+
Hero(
130+
tag: "label_item_category_${category.idCategory}",
131+
child: Text(
132+
category.strCategory,
133+
textAlign: TextAlign.center,
134+
style: TextStyle(
135+
color: Colors.white,
136+
),
134137
),
135138
),
136139
Padding(padding: const EdgeInsets.only(top: 8.0)),

lib/src/ui/listmeals/list_meals.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,16 @@ class _ListMealsState extends State<ListMeals> {
4444
crossAxisAlignment: CrossAxisAlignment.start,
4545
children: <Widget>[
4646
Padding(padding: EdgeInsets.only(top: 16.0)),
47-
Text(
48-
categoryItem.strCategory,
49-
style: Theme.of(context)
50-
.textTheme
51-
.display2
52-
.merge(TextStyle(fontWeight: FontWeight.bold)),
53-
maxLines: 1,
47+
Hero(
48+
tag: "label_item_category_${categoryItem.idCategory}",
49+
child: Text(
50+
categoryItem.strCategory,
51+
style: Theme.of(context)
52+
.textTheme
53+
.display2
54+
.merge(TextStyle(fontWeight: FontWeight.bold)),
55+
maxLines: 1,
56+
),
5457
),
5558
Padding(padding: EdgeInsets.only(top: 16.0)),
5659
Expanded(

0 commit comments

Comments
 (0)
0