Skip to content

Commit 98c730e

Browse files
committed
init
1 parent 1dcb225 commit 98c730e

File tree

10 files changed

+83
-129
lines changed

10 files changed

+83
-129
lines changed
Loading
Loading
Loading
Loading
Loading

assets/can.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

lib/laporan/laporan.dart

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,41 @@
1+
import 'package:cashier/controller/transaksicontroller.dart';
2+
import 'package:cashier/manage/formater.dart';
13
import 'package:flutter/material.dart';
4+
import 'package:get/get.dart';
5+
26
class Laporan extends StatefulWidget {
37
@override
48
_LaporanState createState() => _LaporanState();
59
}
610

711
class _LaporanState extends State<Laporan> {
8-
9-
1012
@override
1113
Widget build(BuildContext context) {
1214
return Scaffold(
13-
backgroundColor: Colors.white,
14-
body: Center(
15-
child: Text(
16-
"laporan",
15+
backgroundColor: Colors.white,
16+
appBar: AppBar(
17+
elevation: 0,
18+
shadowColor: Colors.black,
19+
backgroundColor: Colors.white,
20+
foregroundColor: Colors.black,
21+
title: Text(
22+
"Laporan",
23+
style: TextStyle(
24+
color: Colors.black,
25+
),
26+
),
1727
),
18-
),
19-
);
28+
body: SingleChildScrollView(
29+
child: GetBuilder<TransaksiController>(
30+
init: TransaksiController(),
31+
builder: (val) {
32+
int b = 0;
33+
val.transaksi.forEach((item) {
34+
b += item['data']['bayar'];
35+
});
36+
37+
return Text(uang.format(b));
38+
},
39+
)));
2040
}
2141
}

lib/transaksi/transaksi.dart

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'package:cashier/transaksi/widget/listsearch.dart';
66
import 'package:cashier/transaksi/widget/search.dart';
77
import 'package:flutter/material.dart';
88
import 'package:get/get.dart';
9+
import 'package:lottie/lottie.dart';
910

1011
class Transaksi extends StatefulWidget {
1112
@override
@@ -50,21 +51,29 @@ class _TransaksiState extends State<Transaksi> {
5051
final a = val.beli;
5152
return SingleChildScrollView(
5253
physics: BouncingScrollPhysics(),
53-
child: Column(
54-
children: [
55-
for (var i = 0; i < val.beli.length; i++)
56-
ListSearch(
57-
kode: a[i]['kode'],
58-
id: a[i]['id'],
59-
nama: a[i]['nama'],
60-
harga: a[i]['harga'],
61-
stock: a[i]['jumlah'],
62-
x: true,
63-
i: i,
64-
jumbel: a[i]['jumlahbeli'],
54+
child: val.beli.length < 0 || val.beli.isEmpty || val.beli == null
55+
? SizedBox(
56+
height: Get.height / 1.5,
57+
child: Center(
58+
child:
59+
Lottie.asset('assets/can.json', width: Get.width / 2),
60+
),
61+
)
62+
: Column(
63+
children: [
64+
for (var i = 0; i < val.beli.length; i++)
65+
ListSearch(
66+
kode: a[i]['kode'],
67+
id: a[i]['id'],
68+
nama: a[i]['nama'],
69+
harga: a[i]['harga'],
70+
stock: a[i]['jumlah'],
71+
x: true,
72+
i: i,
73+
jumbel: a[i]['jumlahbeli'],
74+
),
75+
],
6576
),
66-
],
67-
),
6877
);
6978
},
7079
),

pubspec.lock

Lines changed: 28 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Generated by pub
22
# See https://dart.dev/tools/pub/glossary#lockfile
33
packages:
4+
archive:
5+
dependency: transitive
6+
description:
7+
name: archive
8+
url: "https://pub.dartlang.org"
9+
source: hosted
10+
version: "3.1.2"
411
async:
512
dependency: transitive
613
description:
@@ -64,6 +71,13 @@ packages:
6471
url: "https://pub.dartlang.org"
6572
source: hosted
6673
version: "1.15.0"
74+
crypto:
75+
dependency: transitive
76+
description:
77+
name: crypto
78+
url: "https://pub.dartlang.org"
79+
source: hosted
80+
version: "3.0.1"
6781
cupertino_icons:
6882
dependency: "direct main"
6983
description:
@@ -78,20 +92,6 @@ packages:
7892
url: "https://pub.dartlang.org"
7993
source: hosted
8094
version: "1.2.0"
81-
ffi:
82-
dependency: transitive
83-
description:
84-
name: ffi
85-
url: "https://pub.dartlang.org"
86-
source: hosted
87-
version: "1.0.0"
88-
file:
89-
dependency: transitive
90-
description:
91-
name: file
92-
url: "https://pub.dartlang.org"
93-
source: hosted
94-
version: "6.1.0"
9595
firebase_core:
9696
dependency: "direct main"
9797
description:
@@ -139,13 +139,6 @@ packages:
139139
description: flutter
140140
source: sdk
141141
version: "0.0.0"
142-
flutter_plugin_android_lifecycle:
143-
dependency: transitive
144-
description:
145-
name: flutter_plugin_android_lifecycle
146-
url: "https://pub.dartlang.org"
147-
source: hosted
148-
version: "2.0.1"
149142
flutter_slidable:
150143
dependency: "direct main"
151144
description:
@@ -184,27 +177,6 @@ packages:
184177
url: "https://pub.dartlang.org"
185178
source: hosted
186179
version: "4.0.0"
187-
image_picker:
188-
dependency: "direct main"
189-
description:
190-
name: image_picker
191-
url: "https://pub.dartlang.org"
192-
source: hosted
193-
version: "0.7.4"
194-
image_picker_for_web:
195-
dependency: transitive
196-
description:
197-
name: image_picker_for_web
198-
url: "https://pub.dartlang.org"
199-
source: hosted
200-
version: "2.0.0"
201-
image_picker_platform_interface:
202-
dependency: transitive
203-
description:
204-
name: image_picker_platform_interface
205-
url: "https://pub.dartlang.org"
206-
source: hosted
207-
version: "2.1.0"
208180
intl:
209181
dependency: "direct main"
210182
description:
@@ -226,6 +198,20 @@ packages:
226198
url: "https://pub.dartlang.org"
227199
source: hosted
228200
version: "0.5.6"
201+
logging:
202+
dependency: transitive
203+
description:
204+
name: logging
205+
url: "https://pub.dartlang.org"
206+
source: hosted
207+
version: "1.0.1"
208+
lottie:
209+
dependency: "direct main"
210+
description:
211+
name: lottie
212+
url: "https://pub.dartlang.org"
213+
source: hosted
214+
version: "1.0.1"
229215
matcher:
230216
dependency: transitive
231217
description:
@@ -247,41 +233,6 @@ packages:
247233
url: "https://pub.dartlang.org"
248234
source: hosted
249235
version: "1.8.0"
250-
path_provider:
251-
dependency: "direct main"
252-
description:
253-
name: path_provider
254-
url: "https://pub.dartlang.org"
255-
source: hosted
256-
version: "2.0.1"
257-
path_provider_linux:
258-
dependency: transitive
259-
description:
260-
name: path_provider_linux
261-
url: "https://pub.dartlang.org"
262-
source: hosted
263-
version: "2.0.0"
264-
path_provider_macos:
265-
dependency: transitive
266-
description:
267-
name: path_provider_macos
268-
url: "https://pub.dartlang.org"
269-
source: hosted
270-
version: "2.0.0"
271-
path_provider_platform_interface:
272-
dependency: transitive
273-
description:
274-
name: path_provider_platform_interface
275-
url: "https://pub.dartlang.org"
276-
source: hosted
277-
version: "2.0.1"
278-
path_provider_windows:
279-
dependency: transitive
280-
description:
281-
name: path_provider_windows
282-
url: "https://pub.dartlang.org"
283-
source: hosted
284-
version: "2.0.1"
285236
pedantic:
286237
dependency: transitive
287238
description:
@@ -303,27 +254,13 @@ packages:
303254
url: "https://pub.dartlang.org"
304255
source: hosted
305256
version: "3.3.0"
306-
platform:
307-
dependency: transitive
308-
description:
309-
name: platform
310-
url: "https://pub.dartlang.org"
311-
source: hosted
312-
version: "3.0.0"
313257
plugin_platform_interface:
314258
dependency: transitive
315259
description:
316260
name: plugin_platform_interface
317261
url: "https://pub.dartlang.org"
318262
source: hosted
319263
version: "2.0.0"
320-
process:
321-
dependency: transitive
322-
description:
323-
name: process
324-
url: "https://pub.dartlang.org"
325-
source: hosted
326-
version: "4.2.1"
327264
qrscan:
328265
dependency: "direct main"
329266
description:
@@ -399,20 +336,6 @@ packages:
399336
url: "https://pub.dartlang.org"
400337
source: hosted
401338
version: "2.1.0"
402-
win32:
403-
dependency: transitive
404-
description:
405-
name: win32
406-
url: "https://pub.dartlang.org"
407-
source: hosted
408-
version: "2.0.5"
409-
xdg_directories:
410-
dependency: transitive
411-
description:
412-
name: xdg_directories
413-
url: "https://pub.dartlang.org"
414-
source: hosted
415-
version: "0.2.0"
416339
sdks:
417340
dart: ">=2.12.0 <3.0.0"
418341
flutter: ">=1.22.0"

pubspec.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencies:
3131
get:
3232
responsive_grid: ^2.0.0
3333
flutter_slidable: ^0.6.0
34-
path_provider: ^2.0.1
34+
# path_provider: ^2.0.1
3535
intl: ^0.17.0
3636
# flutter_keyboard_visibility: ^5.0.1
3737
keyboard_visibility: ^0.5.6
@@ -40,7 +40,8 @@ dependencies:
4040
firebase_core: ^1.1.0
4141
cloud_firestore: ^1.0.7
4242
firebase_storage: ^8.0.5
43-
image_picker: ^0.7.4
43+
# image_picker: ^0.7.4
44+
lottie: ^1.0.1
4445

4546
dev_dependencies:
4647
flutter_test:

0 commit comments

Comments
 (0)