Skip to content

Commit

Permalink
Inshaa Allah kelar
Browse files Browse the repository at this point in the history
  • Loading branch information
mdaffailhami committed Jun 29, 2024
1 parent ebf4b5b commit 239bd0d
Show file tree
Hide file tree
Showing 17 changed files with 75 additions and 41 deletions.
4 changes: 2 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="gasku"
android:label="GasKu"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions flutter_launcher_icons.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
flutter_launcher_icons:
android: "launcher_icon"
image_path: "assets/gasku_logo.png"
2 changes: 1 addition & 1 deletion lib/components/laporan_modal_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class _MyLaporanModalBottomSheetState extends State<MyLaporanModalBottomSheet> {
));
} else {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text('Laporan terkirim'),
content: const Text('Laporan terkirim'),
backgroundColor: Theme.of(context).colorScheme.primary,
action: SnackBarAction(
label: 'Tutup',
Expand Down
2 changes: 1 addition & 1 deletion lib/components/ulasan_modal_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class _MyUlasanModalBottomSheetState extends State<MyUlasanModalBottomSheet> {
);

ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text('Ulasan terkirim'),
content: const Text('Ulasan terkirim'),
backgroundColor: Theme.of(context).colorScheme.primary,
action: SnackBarAction(
label: 'Tutup',
Expand Down
55 changes: 27 additions & 28 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:gasku/cubits/pengguna_masuk.dart';
import 'package:gasku/cubits/posisi_pengguna.dart';
import 'package:gasku/pages/main.dart';
import 'package:gasku/pages/masuk.dart';
import 'package:gasku/utils/show_loading_screen.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:shared_preferences/shared_preferences.dart';

Expand Down Expand Up @@ -46,36 +45,36 @@ class MyApp extends StatelessWidget {
dragHandleColor: Colors.white,
backgroundColor: Colors.transparent,
)),
home: MyMasukPage(),
// home: FutureBuilder(
// future: SharedPreferences.getInstance(),
// builder: (context, snapshot) {
// if (snapshot.connectionState == ConnectionState.waiting) {
// return const SizedBox.shrink();
// } else {
// final nikPengguna = snapshot.data!.getString('nik_pengguna_masuk');
// home: MyMasukPage(),
home: FutureBuilder(
future: SharedPreferences.getInstance(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const SizedBox.shrink();
} else {
final nikPengguna = snapshot.data!.getString('nik_pengguna_masuk');

// if (nikPengguna == null) return const MyMasukPage();
if (nikPengguna == null) return const MyMasukPage();

// return FutureBuilder(
// future: context
// .read<PenggunaMasukCubit>()
// .masukTanpaSandi(nik: nikPengguna),
// builder: (context, snapshot) {
// if (snapshot.connectionState == ConnectionState.done) {
// if (context.read<PenggunaMasukCubit>().state == null) {
// return const MyMasukPage();
// }
return FutureBuilder(
future: context
.read<PenggunaMasukCubit>()
.masukTanpaSandi(nik: nikPengguna),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (context.read<PenggunaMasukCubit>().state == null) {
return const MyMasukPage();
}

// return const MyMainPage();
// } else {
// return const SizedBox.shrink();
// }
// },
// );
// }
// },
// ),
return const MyMainPage();
} else {
return const SizedBox.shrink();
}
},
);
}
},
),
);
}
}
4 changes: 2 additions & 2 deletions lib/pages/detail_pangkalan.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ class MyDetailPangkalanPage extends StatelessWidget {
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
),
side: BorderSide(color: Colors.red),
side: const BorderSide(color: Colors.red),
),
child: Text(
child: const Text(
'Laporkan Pangkalan',
style: TextStyle(color: Colors.red),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/edit_profil.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class _MyEditProfilPageState extends State<MyEditProfilPage> {
await context.read<PenggunaMasukCubit>().edit(pengguna);

ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text('Edit profil berhasil'),
content: const Text('Edit profil berhasil'),
backgroundColor: Theme.of(context).colorScheme.primary,
action: SnackBarAction(
label: 'Tutup',
Expand Down Expand Up @@ -131,7 +131,7 @@ class _MyEditProfilPageState extends State<MyEditProfilPage> {
);
},
child: _foto == null
? CircleAvatar(
? const CircleAvatar(
radius: 70,
foregroundImage:
AssetImage('assets/default_pfp.jpg'),
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/masuk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class _MyMasukPageState extends State<MyMasukPage> {

Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (_) => MyMainPage()),
MaterialPageRoute(builder: (_) => const MyMainPage()),
(_) => false,
);
} catch (e) {
Expand All @@ -59,7 +59,7 @@ class _MyMasukPageState extends State<MyMasukPage> {
showDialog(
context: context,
builder: (context) {
return MyGantiKataSandiDialog();
return const MyGantiKataSandiDialog();
},
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/pages/pengajuan_pangkalan.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:gasku/widgets/faq_list_tile.dart';
import 'package:gasku/widgets/pengajuan_pangkalan_list_tile.dart';

class MyPengajuanPangkalanPage extends StatelessWidget {
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/profil.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,12 @@ class MyProfilPage extends StatelessWidget {
context: context,
builder: (context) {
return AlertDialog(
title: Text('E-Kartu'),
title: const Text('E-Kartu'),
actions: [
TextButton(
onPressed: () =>
Navigator.of(context).pop(),
child: Text('Tutup'),
child: const Text('Tutup'),
)
],
content: SelectableText(
Expand Down
32 changes: 32 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.0"
checked_yaml:
dependency: transitive
description:
name: checked_yaml
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
url: "https://pub.dev"
source: hosted
version: "2.0.3"
cli_util:
dependency: transitive
description:
name: cli_util
sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19
url: "https://pub.dev"
source: hosted
version: "0.4.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -198,6 +214,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.1.0"
flutter_launcher_icons:
dependency: "direct main"
description:
name: flutter_launcher_icons
sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea"
url: "https://pub.dev"
source: hosted
version: "0.13.1"
flutter_lints:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -400,6 +424,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.19.0"
json_annotation:
dependency: transitive
description:
name: json_annotation
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
url: "https://pub.dev"
source: hosted
version: "4.9.0"
leak_tracker:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dependencies:
url_launcher: ^6.3.0
geolocator: ^12.0.0
shared_preferences: ^2.2.3
flutter_launcher_icons: ^0.13.1

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 239bd0d

Please sign in to comment.