first commit

This commit is contained in:
Ryan Ariana
2024-03-25 14:37:46 +07:00
commit fb10375183
229 changed files with 14721 additions and 0 deletions

View File

@@ -0,0 +1,190 @@
import 'package:bbm_tracking/model/kendaraan_m.dart';
import 'package:flutter/material.dart';
class MainCardKendaraan extends StatelessWidget {
final KendaraanModel? kendaraanModel;
MainCardKendaraan(this.kendaraanModel);
@override
Widget build(BuildContext context) {
return Container(
child: Stack(
children: [
kendaraanModel != null
? Image.asset(
"assets/images/card.png",
width: double.infinity,
fit: BoxFit.fill,
)
: Image.asset(
"assets/images/card_empty.png",
width: double.infinity,
fit: BoxFit.fill,
),
Container(
child: Padding(
padding: EdgeInsets.all(20),
child: Column(
children: [
Container(
width: double.infinity,
child: Text(
"Data Pribadi Kendaraan Anda",
style: TextStyle(
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 16,
color: Color(0xFF3B3C48),
),
),
),
Container(
child: Row(
children: [
kendaraanModel != null
? kendaraanModel?.jenisKendaraan != "motor"
? Image.asset(
"assets/images/car.png",
width: 110,
height: 110,
)
: Image.asset(
"assets/images/motor.png",
width: 110,
height: 110,
)
: Image.asset(
"assets/images/img_empty.png",
width: 110,
height: 110,
),
SizedBox(
width: 10,
),
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
// width: double.infinity,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"Tipe Kendaraan : ",
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 11,
fontWeight: FontWeight.w400,
color: Color(0xFF25235B),
),
),
SizedBox(
height: 5,
),
Text(
kendaraanModel != null
? kendaraanModel!.namaKendaraan
: "-",
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.w700,
color: Color(0xFFffffff),
),
),
],
),
),
SizedBox(
width: 20,
),
Container(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"Nomor Plat :",
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 11,
fontWeight: FontWeight.w400,
color: Color(0xFF25235B),
),
),
SizedBox(
height: 5,
),
Text(
kendaraanModel != null
? kendaraanModel!.nomorPlat
: "-",
// "AS 7713 JJA",
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.w700,
color: Color(0xFFffffff),
),
),
],
),
),
],
),
),
SizedBox(
height: 10,
),
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Bahan Bakar saat ini",
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 11,
fontWeight: FontWeight.w400,
color: Color(0xFF25235B),
),
),
// SizedBox(
// height: 5,
// ),
Text(
kendaraanModel != null
? kendaraanModel!.bahanBakar
: "-",
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.w700,
color: Color(0xFFffffff),
),
),
],
),
)
],
),
),
],
),
),
],
),
),
),
],
),
);
}
}

View File

@@ -0,0 +1,92 @@
// import 'package:fl_chart_app/presentation/resources/app_resources.dart';
// import 'package:fl_chart_app/util/extensions/color_extensions.dart';
import 'package:bbm_tracking/model/transaksiPerMonth_m.dart';
import 'package:bbm_tracking/model/transaksi_m.dart';
import 'package:syncfusion_flutter_charts/sparkcharts.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
class BarChartSample3 extends StatefulWidget {
List<TransaksiPerMonthModel> dataTransaksi;
String param;
BarChartSample3({required this.dataTransaksi, required this.param, Key? key}): super(key: key);
@override
State<StatefulWidget> createState() => BarChartSample3State();
}
class BarChartSample3State extends State<BarChartSample3> {
List<double> dtTotalBayar = [];
List<double> dtTotalLiter = [];
late List<TransaksiPerMonthModel> dtTransaksi;
DateTime today = DateTime.now();
@override
void initState() {
// TODO: implement initState
super.initState();
dtTransaksi = widget.dataTransaksi;
final daysInMonth = DateTime(today.year, today.month + 1, 0).day;
for (var i = 1; i <= daysInMonth; i++) {
if (dtTransaksi.length > 0) {
for(int j = 0; j < dtTransaksi.length; j++)
{
if(i == dtTransaksi[j].tanggalTransaksi.day)
{
dtTotalBayar.add(dtTransaksi[j].totalBayar.toDouble());
dtTotalLiter.add(dtTransaksi[j].totalLiter);
break;
}else{
dtTotalBayar.add(0);
dtTotalLiter.add(0);
break;
}
}
} else {
dtTotalBayar.add(0);
dtTotalLiter.add(0);
}
}
}
@override
Widget build(BuildContext context) {
print(widget.param);
return AspectRatio(
aspectRatio: 1.6,
child: widget.param == "Harga"
? SfSparkLineChart(
//Enable the trackball
trackball: SparkChartTrackball(
activationMode: SparkChartActivationMode.tap,
color: Colors.black,
),
//Enable marker
marker: SparkChartMarker(
displayMode: SparkChartMarkerDisplayMode.all,
color: Colors.black),
//Enable data label
labelDisplayMode: SparkChartLabelDisplayMode.none,
color: Color(0xFFFC8D05),
// dashArray: [],
data: dtTotalBayar,
)
: SfSparkLineChart(
//Enable the trackball
trackball: SparkChartTrackball(
activationMode: SparkChartActivationMode.tap,
color: Colors.black,
),
//Enable marker
marker: SparkChartMarker(
displayMode: SparkChartMarkerDisplayMode.all,
color: Colors.black),
//Enable data label
labelDisplayMode: SparkChartLabelDisplayMode.none,
color: Color(0xFFFC8D05),
// dashArray: [],
data: dtTotalLiter,
),
);
}
}

View File

@@ -0,0 +1,11 @@
import 'package:intl/intl.dart';
class CurrencyFormat {
static String convertToIdr(dynamic number, int decimalDigit) {
NumberFormat currencyFormatter = NumberFormat.currency(
locale: 'id',
symbol: 'Rp. ',
decimalDigits: decimalDigit,
);
return currencyFormatter.format(number);
}
}

View File

@@ -0,0 +1,103 @@
import 'package:bbm_tracking/model/bensin_m.dart';
import 'package:flutter/material.dart';
List<BensinModel> listBensin = [
BensinModel(
id: 1,
value: "pertalite",
text: "Pertalite",
perusahaan: "Pertamina",
harga: 10000,
),
BensinModel(
id: 2,
value: "pertamax",
text: "Pertamax",
perusahaan: "Pertamina",
harga: 12400,
),
BensinModel(
id: 3,
value: "pertamax_turbo",
text: "Pertamax Turbo",
perusahaan: "Pertamina",
harga: 14000,
),
BensinModel(
id: 4,
value: "pertamina_dex",
text: "Pertamina Dex",
perusahaan: "Pertamina",
harga: 13550,
),
BensinModel(
id: 5,
value: "dexlite",
text: "Dexlite",
perusahaan: "Pertamina",
harga: 13150,
),
BensinModel(
id: 6,
value: "solar",
text: "Solar",
perusahaan: "Pertamina",
harga: 6800,
),
BensinModel(
id: 7,
value: "shell_v_power_nitro",
text: "Shell V-Power Nitro+",
perusahaan: "Shell",
harga: 14120,
),
BensinModel(
id: 8,
value: "shell_v_power",
text: "Shell V-Power",
perusahaan: "Shell",
harga: 13780,
),
BensinModel(
id: 9,
value: "shell_super",
text: "Shell Super",
perusahaan: "Shell",
harga: 12920,
),
BensinModel(
id: 10,
value: "shell_v_power_diesel",
text: "Shell V-Power Diesel",
perusahaan: "Shell",
harga: 13590,
),
BensinModel(
id: 11,
value: "shell_diesel_extra",
text: "Shell Diesel Extra",
perusahaan: "Shell",
harga: 13160,
),
BensinModel(
id: 12,
value: "revvo_90",
text: "Revvo 90",
perusahaan: "Revvo",
harga: 11200,
),
BensinModel(
id: 13,
value: "revvo_92",
text: "Revvo 92",
perusahaan: "Revvo",
harga: 12400,
),
BensinModel(
id: 14,
value: "revvo_95",
text: "Revvo 95",
perusahaan: "Revvo",
harga: 13200,
),
];

View File

@@ -0,0 +1 @@
List<String> bulan = ["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"];

View File

@@ -0,0 +1 @@
List<String> tahun = ["2023","2024","2025","2026","2027","2028","2029","2030"];

View File

@@ -0,0 +1,180 @@
import 'package:bbm_tracking/resource/resource.dart';
import 'package:flutter/material.dart';
class MonthPicker extends StatefulWidget {
// final Function onChangeNextMonth;
final Function onChangeDate;
// final String bulan;
const MonthPicker({
super.key,
required this.onChangeDate,
// required this.onChangBeforeMonth,
// required this.bulan
});
@override
State<MonthPicker> createState() => _MonthPickerState();
}
class _MonthPickerState extends State<MonthPicker> {
late Function onChangeDate;
int _month = 0;
int _year = 2023;
String mon = "";
@override
void initState() {
super.initState();
onChangeDate = widget.onChangeDate;
}
void nextMonth() {
setState(() {
_month == 11 ? _month = 0 : _month = _month + 1;
});
// print(bulan.elementAt(_month));
}
void beforeMonth() {
setState(() {
_month == 0 ? _month = 11 : _month = _month - 1;
});
// print(bulan.elementAt(_month));
}
void nextYear() {
setState(() {
_year = _year + 1;
});
// print(bulan.elementAt(_month));
}
void beforeYear() {
setState(() {
_year > 2023 ? _year = _year - 1 : null;
});
// print(bulan.elementAt(_month));
}
@override
Widget build(BuildContext context) {
return Dialog(
elevation: 1,
backgroundColor: Color(0xffE3EAEA),
child: Container(
height: 250,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"Pilih Tanggal",
style: TextStyle(
color: Color(0xFF677D81),
fontSize: 18,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
),
textAlign: TextAlign.center,
),
SizedBox(
height: 20,
),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
children: [
InkWell(
onTap: () => nextMonth(),
child: Icon(
Icons.arrow_drop_up,
size: 50,
),
),
Text(
bulan.elementAt(_month),
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 15,
fontWeight: FontWeight.w600,
),
),
InkWell(
onTap: () => beforeMonth(),
child: Icon(
Icons.arrow_drop_down,
size: 50,
),
),
],
),
Column(
children: [
InkWell(
onTap: () => nextYear(),
child: Icon(
Icons.arrow_drop_up,
size: 50,
),
),
Text(
_year.toString(),
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 15,
fontWeight: FontWeight.w600,
),
),
InkWell(
onTap: () => beforeYear(),
child: Icon(
Icons.arrow_drop_down,
size: 50,
),
),
],
),
],
),
),
SizedBox(
height: 16,
),
InkWell(
onTap: () {
if (_month < 10) {
mon = "0" + (_month + 1).toString();
}
onChangeDate(mon.toString(), _year.toString());
Navigator.of(context).pop();
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 17,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(9)),
color: Color(0xFF2ECC71),
),
child: Text(
"Selesai",
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 12,
fontWeight: FontWeight.w600,
color: Colors.white,
),
),
),
)
],
),
),
);
}
}

View File

@@ -0,0 +1,49 @@
import 'package:flutter/material.dart';
class PopUp extends StatefulWidget {
String text, param;
PopUp({super.key, required this.text, required this.param});
@override
State<PopUp> createState() => _PopUpState();
}
class _PopUpState extends State<PopUp> {
@override
Widget build(BuildContext context) {
return Dialog(
elevation: 1,
backgroundColor: Color(0xffE3EAEA),
child: Container(
height: 200,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
widget.param == "negative" ? "assets/images/sad_person.png" : "assets/images/about_person.png",
width: 70,
),
SizedBox(
height: 10,
),
Text(
widget.text,
style: TextStyle(
color: Color(0xFF677D81),
fontSize: 13,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
textAlign: TextAlign.center,
),
],
),
),
),
);
}
}

View File

@@ -0,0 +1,9 @@
export 'data-bensin/data-bensin.dart';
export 'text/text-kebijakan.dart';
export 'component-bersama/card_kendaraan.dart';
export 'component-bersama/chart.dart';
export 'data-tanggal/bulan.dart';
export 'data-tanggal/tahun.dart';
export 'dialog-pickdate/month-pickcer.dart';
export 'convert_money/convert_money.dart';

View File

@@ -0,0 +1,11 @@
String Kebijakan1 = "BBM-Tracking menghormati segala sesuatu yang berhubungan dengan privasi Anda. Kami menyusun kebijakan privasi ini untuk membantu Anda memahami data apa pun yang diperoleh, dikumpulkan, diproses, dianalisis, digunakan, dikirim, ditampilkan, diumumkan, diperluas, dihapus, dikirim, dan dimusnahkan pada data pribadi Anda yang disediakan di Aplikasi ini.";
String Kebijakan2 = "Data yang disebutkan di atas diatur sesuai dengan kebijakan privasi di aplikasi ini dan disesuaikan kembali dengan peraturan perundang-undangan yang berlaku.";
String Kebijakan3 = "Kami berharap Anda benar-benar membaca dan memahami kebijakan privasi ini dengan seksama sehingga Anda mengertikan bagaimana kami mengelola dan melindungi data yang Anda simpan. Dengan menggunakan BBM-Tracking, Anda mengakui bahwa Anda telah membaca dan memahami semua ketentuan yang terdapat dalam kebijakan dan privasi aplikasi ini.";
String about1 = "Dengan BBM-Tracking App Anda dapat menyimpan riwayat bahan bakar kendaraan yang sedang Anda gunakan. Aplikasi ini membantu Anda memantau setiap kebutuhan kendaraan secara akurat dan tentunya lebih efisien.";
String about2 = "Aplikasi BBM-Tracking mencatat semua bahan bakar yang digunakan, biaya dan pelacak jarak tempuh kendaraan yang digunakan. Konsumsi bahan bakar dapat diprediksi sehingga penghematan biaya kendaraan Anda akan jauh lebih baik.";
String about3 = "Ayo download aplikasi BBM-Tracking sekarang juga dan nikmati kemudahan tracking BBM kendaraan Anda.";
String Salam1 = "Salam Hormat,";
String Salam2 = "Management System";