Skip to content

Commit 9e52922

Browse files
committed
Buat widget arrow back menu di UI List Meals
1 parent 1491f56 commit 9e52922

File tree

1 file changed

+36
-16
lines changed

1 file changed

+36
-16
lines changed

lib/src/ui/listmeals/list_meals.dart

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:io';
2+
13
import 'package:flutter/cupertino.dart';
24
import 'package:flutter/material.dart';
35

@@ -11,26 +13,44 @@ class _ListMealsState extends State<ListMeals> {
1113
Widget build(BuildContext context) {
1214
var mediaQuery = MediaQuery.of(context);
1315
return Scaffold(
14-
body: Stack(
15-
children: <Widget>[
16-
_buildWidgetBackgroundCircle(mediaQuery),
17-
],
16+
body: Container(
17+
width: double.infinity,
18+
height: double.infinity,
19+
child: Stack(
20+
children: <Widget>[
21+
_buildWidgetBackgroundCircle(mediaQuery),
22+
_buildWidgetArrowBackMenu(),
23+
],
24+
),
1825
),
1926
);
2027
}
2128

22-
Positioned _buildWidgetBackgroundCircle(MediaQueryData mediaQuery) {
23-
return Positioned(
24-
top: -100.0,
25-
left: -100.0,
26-
child: Container(
27-
width: mediaQuery.size.height / 2.2,
28-
height: mediaQuery.size.height / 2.2,
29-
decoration: BoxDecoration(
30-
color: Color(0x3FE8364B),
31-
shape: BoxShape.circle,
29+
Widget _buildWidgetArrowBackMenu() {
30+
return SafeArea(
31+
minimum: EdgeInsets.symmetric(horizontal: 16.0),
32+
child: CircleAvatar(
33+
child: Platform.isIOS
34+
? Icon(Icons.arrow_back_ios, color: Colors.black)
35+
: Icon(Icons.arrow_back, color: Colors.black),
36+
maxRadius: 24.0,
37+
backgroundColor: Colors.white,
3238
),
33-
),
34-
);
39+
);
40+
}
41+
42+
Widget _buildWidgetBackgroundCircle(MediaQueryData mediaQuery) {
43+
return Positioned(
44+
top: -100.0,
45+
left: -100.0,
46+
child: Container(
47+
width: mediaQuery.size.height / 2.2,
48+
height: mediaQuery.size.height / 2.2,
49+
decoration: BoxDecoration(
50+
color: Color(0x3FE8364B),
51+
shape: BoxShape.circle,
52+
),
53+
),
54+
);
3555
}
3656
}

0 commit comments

Comments
 (0)