8000 Penambahan fitur untuk menampilkan Info Tentang App · CoderJava/Food-Recipe@f348413 · GitHub
[go: up one dir, main page]

Skip to content

Commit f348413

Browse files
committed
Penambahan fitur untuk menampilkan Info Tentang App
1 parent 97649f1 commit f348413

File tree

11 files changed

+212
-5
lines changed

11 files changed

+212
-5
lines changed

assets/images/img_logo_512.png

88.1 KB
Loading

assets/images/img_logo_themealdb.png

15.4 KB
Loading

assets/images/img_yudi_setiawan.jpeg

54.3 KB
Loading

ios/Podfile.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ PODS:
33
- FMDB (2.7.5):
44
- FMDB/standard (= 2.7.5)
55
- FMDB/standard (2.7.5)
6+
- get_version (0.0.1):
7+
- Flutter
8+
- package_info (0.0.1):
9+
- Flutter
610
- path_provider (0.0.1):
711
- Flutter
812
- sqflite (0.0.1):
@@ -13,6 +17,8 @@ PODS:
1317

1418
DEPENDENCIES:
1519
- Flutter (from `.symlinks/flutter/ios`)
20+
- get_version (from `.symlinks/plugins/get_version/ios`)
21+
- package_info (from `.symlinks/plugins/package_info/ios`)
1622
- path_provider (from `.symlinks/plugins/path_provider/ios`)
1723
- sqflite (from `.symlinks/plugins/sqflite/ios`)
1824
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
@@ -24,6 +30,10 @@ SPEC REPOS:
2430
EXTERNAL SOURCES:
2531
Flutter:
2632
:path: ".symlinks/flutter/ios"
33+
get_version:
34+
:path: ".symlinks/plugins/get_version/ios"
35+
package_info:
36+
:path: ".symlinks/plugins/package_info/ios"
2737
path_provider:
2838
:path: ".symlinks/plugins/path_provider/ios"
2939
sqflite:
@@ -34,6 +44,8 @@ EXTERNAL SOURCES:
3444
SPEC CHECKSUMS:
3545
Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296
3646
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
47+
get_version: a59b7bd8fbf7543739bd853218b6685899419d05
48+
package_info: d7c98b64f60add4c2908b9d94d82a45d3c8827ad
3749
path_provider: 09407919825bfe3c2deae39453b7a5b44f467873
3850
sqflite: d1612813fa7db7c667bed9f1d1b508deffc56999
3951
url_launcher: 92b89c1029a0373879933c21642958c874539095

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@
225225
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
226226
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
227227
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
228+
"${BUILT_PRODUCTS_DIR}/get_version/get_version.framework",
229+
"${BUILT_PRODUCTS_DIR}/package_info/package_info.framework",
228230
"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
229231
"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
230232
"${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework",
@@ -235,6 +237,8 @@
235237
outputPaths = (
236238
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework",
237239
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
240+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/get_version.framework",
241< 9E7A /td>+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info.framework",
238242
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
239243
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
240244
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework",

lib/src/app.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:food_recipe/values/color_assets.dart';
33

44
import 'ui/favorite/favorite_screen.dart';
55
import 'ui/home/home_screen.dart';
6+
import 'ui/infoapp/info_app_screen.dart';
67
import 'ui/listmeals/list_meals_screen.dart';
78
import 'ui/searchmeals/search_meals_screen.dart';
89
import 'utils/utils.dart';
@@ -25,7 +26,10 @@ class _AppState extends State<App> {
2526
},
2627
navigatorSearchMeals: (context) {
2728
return SearchMealsScreen();
28-
}
29+
},
30+
navigatorInfoApp: (context) {
31+
return InfoAppScreen();
32+
},
2933
},
3034
theme: ThemeData(
3135
primaryColor: ColorAssets.primarySwatchColor,

lib/src/ui/home/home_screen.dart

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@ class _HomeScreenState extends State<HomeScreen> {
2727
SafeArea(
2828
child: ListView(
2929
children: <Widget>[
30+
Align(
31+
alignment: Alignment.topRight,
32+
child: GestureDetector(
33+
onTap: () {
34+
Navigator.pushNamed(context, navigatorInfoApp);
35+
},
36+
child: Padding(
37+
padding: const EdgeInsets.only(top: 16.0, right: 16.0),
38+
child: Icon(
39+
Icons.info_outline,
40+
color: Colors.white,
41+
),
42+
),
43+
),
44+
),
3045
_buildWidgetContent(),
3146
],
3247
),
@@ -60,7 +75,7 @@ class _HomeScreenState extends State<HomeScreen> {
6075
child: Column(
6176
crossAxisAlignment: CrossAxisAlignment.start,
6277
children: <Widget>[
63-
Padding(padding: EdgeInsets.only(top: 16.0 + mediaQuery.padding.top)),
78+
Padding(padding: EdgeInsets.only(top: 16.0)),
6479
Text(
6580
"What are you\nCooking today ?",
6681
style: Theme.of(context).textTheme.display1.merge(
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:get_version/get_version.dart';
3+
import 'package:flutter/services.dart';
4+
5+
class InfoAppScreen extends StatefulWidget {
6+
@override
7+
_InfoAppScreenState createState() => _InfoAppScreenState();
8+
}
9+
10+
class _InfoAppScreenState extends State<InfoAppScreen> {
11+
String versionName = "1.0.1";
12+
13+
@override
14+
void initState() {
15+
getVersionApp();
16+
super.initState();
17+
}
18+
19+
@override
20+
Widget build(BuildContext context) {
21+
return Scaffold(
22+
body: SafeArea(
23+
child: Padding(
24+
padding: const EdgeInsets.all(16.0),
25+
child: ListView(
26+
children: <Widget>[
27+
Image.asset(
28+
"assets/images/img_logo_512.png",
29+
width: 72.0,
30+
height: 72.0,
31+
),
32+
Padding(
33+
padding: EdgeInsets.only(
34+
top: 4.0,
35+
),
36+
),
37+
SizedBox(
38+
width: double.infinity,
39+
child: Text(
40+
"Food Recipe",
41+
textAlign: TextAlign.center,
42+
style: Theme
43+
.of(context)
44+
.textTheme
45+
.title,
46+
),
47+
),
48+
Center(
49+
child: Text(
50+
versionName,
51+
style: Theme
52+
.of(context)
53+
.textTheme
54+
.subtitle,
55+
),
56+
),
57+
SizedBox(
58+
width: double.infinity,
59+
child: Text(
60+
"Aplikasi yang menyajikan informasi resep makanan dari seluruh dunia",
61+
textAlign: TextAlign.center,
62+
style: Theme
63+
.of(context)
64+
.textTheme
65+
.subtitle,
66+
),
67+
),
68+
Padding(padding: EdgeInsets.only(top: 16.0)),
69+
Container(
70+
width: double.infinity,
71+
height: 1.0,
72+
color: Colors.grey,
73+
),
74+
Padding(padding: EdgeInsets.only(top: 16.0)),
75+
Text(
76+
"Developer",
77+
style: Theme
78+
.of(context)
79+
.textTheme
80+
.headline,
81+
textAlign: TextAlign.center,
82+
),
83+
Padding(padding: EdgeInsets.only(top: 8.0)),
84+
Center(
85+
child: ClipRRect(
86+
borderRadius: BorderRadius.circular(900.0),
87+
child: Container(
88+
width: 128.0,
89+
height: 128.0,
90+
child: Image.asset("assets/images/img_yudi_setiawan.jpeg"),
91+
),
92+
),
93+
),
94+
Padding(padding: EdgeInsets.only(top: 8.0)),
95+
Center(
96+
child: Text(
97+
"Yudi Setiawan",
98+
style: Theme
99+
.of(context)
100+
.textTheme
101+
.headline
102+
.merge(
103+
TextStyle(fontSize: 20.0),
104+
),
105+
),
106+
),
107+
Center(
108+
child: Text(
109+
"Software Developer\n specialize in Android development",
110+
textAlign: TextAlign.center,
111+
),
112+
),
113+
Padding(
114+
padding: EdgeInsets.only(top: 20.0),
115+
),
116+
Text(
117+
"API Service",
118+
style: Theme
119+
.of(context)
120+
.textTheme
121+
.headline,
122+
textAlign: TextAlign.center,
123+
),
124+
Padding(
125+
padding: const EdgeInsets.only(top: 8.0),
126+
child: Center(
127+
child: Image.asset("assets/images/img_logo_themealdb.png"),
128+
),
129+
),
130+
Center(
131+
child: Text(
132+
"An open source database of Recipes from around the world",
133+
textAlign: TextAlign.center,
134+
),
135+
),
136+
],
137+
),
138+
),
139+
),
140+
);
141+
}
142+
143+
getVersionApp() async {
144+
try {
145+
versionName = await GetVersion.projectVersion;
146+
setState(() {});
147+
} on PlatformException {
148+
versionName = "1.0.1";
149+
}
150+
}
151+
}

lib/src/utils/utils.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
55

66
const navigatorListMeals = "/list_meals";
77
const navigatorSearchMeals = "/search_meals";
8+
const navigatorInfoApp = "/info_app";
89

910
Widget buildCircularProgressIndicator() {
1011
if (Platform.isIOS) {

pubspec.lock

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Generated by pub
2-
# See https://www.dartlang.org/tools/pub/glossary#lockfile
2+
# See https://dart.dev/tools/pub/glossary#lockfile
33
packages:
44
analyzer:
55
dependency: transitive
@@ -179,6 +179,13 @@ packages:
179179
url: "https://pub.dartlang.org"
180180
source: hosted
181181
version: "0.1.18"
182+
get_version:
183+
dependency: "direct main"
184+
description:
185+
name: get_version
186+
url: "https://pub.dartlang.org"
187+
source: hosted
188+
version: "0.1.0"
182189
glob:
183190
dependency: transitive
184191
description:
@@ -291,6 +298,13 @@ packages:
291298
url: "https://pub.dartlang.org"
292299
source: hosted
293300
version: "1.0.5"
301+
package_info:
302+
dependency: transitive
303+
description:
304+
name: package_info
305+
url: "https://pub.dartlang.org"
306+
source: hosted
307+
version: "0.4.0+4"
294308
package_resolver:
295309
dependency: transitive
296310
description:
@@ -318,7 +332,7 @@ packages:
318332
name: pedantic
319333
url: "https://pub.dartlang.org"
320334
source: hosted
321-
version: "1.5.0"
335+
version: "1.7.0"
322336
pool:
323337
dependency: transitive
324338
description:

pubspec.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: food_recipe
22
description: Food Recipe - Challenge Dicoding (Create Beautiful Apps Using Flutter)
33

4-
version: 1.0.0+1
4+
version: 1.0.2+3
55

66
environment:
77
sdk: ">=2.1.0 <3.0.0"
@@ -35,6 +35,9 @@ dependencies:
3535
# Flutter plugin for getting commonly used locations on the Android & iOS.
3636
path_provider: ^1.1.0
3737

38+
# Get the version name, version code, platform, OS version and app ID.
39+
get_version: ^0.1.0
40+
3841
dev_dependencies:
3942
flutter_test:
4043
sdk: flutter
@@ -49,6 +52,9 @@ flutter:
4952
assets:
5053
- assets/images/img_not_found.jpg
5154
- assets/images/img_placeholder.jpg
55+
- assets/images/img_logo_512.png
56+
- assets/images/img_yudi_setiawan.jpeg
57+
- assets/images/img_logo_themealdb.png
5258

5359
# An image asset can refer to one or more resolution-specific "variants", see
5460
# https://flutter.dev/assets-and-images/#resolution-aware.

0 commit comments

Comments
 (0)
0