Skip to content

Commit 37a18f5

Browse files
committed
Update departures UI
1 parent 204f86d commit 37a18f5

File tree

1 file changed

+32
-30
lines changed

1 file changed

+32
-30
lines changed

lib/departuresComponent/views/departures_details_row_view.dart

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class DeparturesDetailsRowView extends ConsumerWidget {
1515
return Row(
1616
children: [
1717
_lineNumberRectangle(context, ref),
18+
if (departure.lineInfos != null) _warningButton(context, ref),
1819
Expanded(
1920
child: Text(
2021
departure.servingLine.direction,
@@ -30,7 +31,30 @@ class DeparturesDetailsRowView extends ConsumerWidget {
3031
}
3132

3233
Widget _lineNumberRectangle(BuildContext context, WidgetRef ref) {
33-
return GestureDetector(
34+
return Padding(
35+
padding: const EdgeInsets.only(right: 15),
36+
child: Container(
37+
decoration: BoxDecoration(
38+
borderRadius: BorderRadius.circular(5),
39+
color: departure.servingLine.color,
40+
),
41+
width: 55,
42+
height: 35,
43+
child: Center(
44+
child: Text(
45+
departure.servingLine.number,
46+
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
47+
color: Colors.white,
48+
fontWeight: FontWeight.bold,
49+
),
50+
),
51+
),
52+
),
53+
);
54+
}
55+
56+
Widget _warningButton(BuildContext context, WidgetRef ref) {
57+
return InkWell(
3458
onTap: () async {
3559
if (departure.lineInfos != null) {
3660
if (departure.lineInfos?.element != null) {
@@ -46,43 +70,21 @@ class DeparturesDetailsRowView extends ConsumerWidget {
4670
}
4771
}
4872
},
49-
child: Stack(
50-
clipBehavior: Clip.none,
73+
child: Row(
5174
children: [
75+
const Icon(
76+
Icons.warning_outlined,
77+
color: Color(0xffFFCC01),
78+
size: 20,
79+
),
5280
Padding(
53-
padding: const EdgeInsets.only(right: 15),
54-
child: Container(
55-
decoration: BoxDecoration(
56-
borderRadius: BorderRadius.circular(5),
57-
color: departure.servingLine.color,
58-
),
59-
width: 55,
60-
height: 35,
61-
child: Center(
62-
child: Text(
63-
departure.servingLine.number,
64-
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
65-
color: Colors.white,
66-
fontWeight: FontWeight.bold,
67-
),
68-
),
69-
),
70-
),
81+
padding: EdgeInsets.symmetric(horizontal: context.halfPadding),
7182
),
72-
if (departure.lineInfos != null) _warningOverlay,
7383
],
7484
),
7585
);
7686
}
7787

78-
Widget get _warningOverlay {
79-
return const Positioned(
80-
width: 53 * 2,
81-
bottom: 22,
82-
child: Icon(Icons.warning_outlined, color: Color(0xffFFCC01), size: 20),
83-
);
84-
}
85-
8688
Widget get _delayText {
8789
if (departure.servingLine.delay != null) {
8890
final delay = departure.servingLine.delay!;

0 commit comments

Comments
 (0)