Fakultas Ilmu Komputer UI

Commit a71d8097 authored by wibias fuad's avatar wibias fuad
Browse files

feat: resolve conflict, ready to merge

parents 22fc5c85 bf0e25de
Pipeline #73075 passed with stages
in 17 minutes
......@@ -662,7 +662,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-04-25T22:23:57.330641Z",
"generated": "2021-04-25T23:24:23.097131Z",
"generator": "pub",
"generatorVersion": "2.12.2"
}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_keyboard_visibility","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-2.0.1\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility_web-2.0.0\\\\","dependencies":[]},{"name":"image_picker_for_web","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker_for_web-2.0.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_keyboard_visibility","dependencies":["flutter_keyboard_visibility_web"]},{"name":"flutter_keyboard_visibility_web","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle","image_picker_for_web"]},{"name":"image_picker_for_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-04-26 05:47:21.672440","version":"2.0.3"}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_keyboard_visibility","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-2.0.1\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility_web-2.0.0\\\\","dependencies":[]},{"name":"image_picker_for_web","path":"C:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker_for_web-2.0.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_keyboard_visibility","dependencies":["flutter_keyboard_visibility_web"]},{"name":"flutter_keyboard_visibility_web","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle","image_picker_for_web"]},{"name":"image_picker_for_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-04-26 06:25:39.362930","version":"2.0.3"}
\ No newline at end of file
......@@ -3,7 +3,7 @@
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2021-04-26 05:23:57.295654.
# Generated by pub on 2021-04-26 06:24:23.057142.
_fe_analyzer_shared:file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-14.0.0/lib/
analyzer:file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/
args:file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.0.0/lib/
......
{"assets/icons/AkunIcons.ttf":["assets/icons/AkunIcons.ttf"],"assets/icons/MyFlutterApp.ttf":["assets/icons/MyFlutterApp.ttf"],"assets/icons/selectedHomeIcon.svg":["assets/icons/selectedHomeIcon.svg"],"assets/icons/unselectedAccount.svg":["assets/icons/unselectedAccount.svg"],"assets/icons/unselectedHelp.svg":["assets/icons/unselectedHelp.svg"],"assets/icons/unselectedPortfolio.svg":["assets/icons/unselectedPortfolio.svg"],"assets/icons/unselectedTransaction.svg":["assets/icons/unselectedTransaction.svg"],"assets/images/camera-icon.png":["assets/images/camera-icon.png"],"assets/images/cardLogo.png":["assets/images/cardLogo.png"],"assets/images/contohFoto.png":["assets/images/contohFoto.png"],"assets/images/fundex-logo.png":["assets/images/fundex-logo.png"],"assets/images/fundex.png":["assets/images/fundex.png"],"assets/images/icon-register-success.png":["assets/images/icon-register-success.png"],"assets/images/logofundex60.png":["assets/images/logofundex60.png"],"assets/images/pizzaInc.jpg":["assets/images/pizzaInc.jpg"],"assets/images/ukmLogo.png":["assets/images/ukmLogo.png"],"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"]}
\ No newline at end of file
{"assets/icons/AkunIcons.ttf":["assets/icons/AkunIcons.ttf"],"assets/icons/MyFlutterApp.ttf":["assets/icons/MyFlutterApp.ttf"],"assets/icons/selectedHomeIcon.svg":["assets/icons/selectedHomeIcon.svg"],"assets/icons/unselectedAccount.svg":["assets/icons/unselectedAccount.svg"],"assets/icons/unselectedHelp.svg":["assets/icons/unselectedHelp.svg"],"assets/icons/unselectedPortfolio.svg":["assets/icons/unselectedPortfolio.svg"],"assets/icons/unselectedTransaction.svg":["assets/icons/unselectedTransaction.svg"],"assets/images/camera-icon.png":["assets/images/camera-icon.png"],"assets/images/cardLogo.png":["assets/images/cardLogo.png"],"assets/images/contohFoto.png":["assets/images/contohFoto.png"],"assets/images/fundex-logo.png":["assets/images/fundex-logo.png"],"assets/images/fundex.png":["assets/images/fundex.png"],"assets/images/gymInc.png":["assets/images/gymInc.png"],"assets/images/gymLogo.png":["assets/images/gymLogo.png"],"assets/images/icon-register-success.png":["assets/images/icon-register-success.png"],"assets/images/logofundex60.png":["assets/images/logofundex60.png"],"assets/images/pizzaInc.jpg":["assets/images/pizzaInc.jpg"],"assets/images/ukmLogo.png":["assets/images/ukmLogo.png"],"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"]}
\ No newline at end of file
import 'package:intl/intl.dart';
class Ukm {
final String ukmName;
final String ukmCompanyName;
final String ukmLogo;
final String ukmPic;
String ukmStatus;
final String ukmBusinessField;
double fundTarget;
double unitPrice;
Duration remainingTime;
int minInvest;
int fundCollectedPercentage;
double fundCollected;
int investorSum;
Ukm(
this.ukmName,
this.ukmCompanyName,
this.ukmPic,
this.ukmLogo,
this.ukmStatus,
this.ukmBusinessField,
this.fundTarget,
this.unitPrice,
this.remainingTime,
this.minInvest,
this.fundCollectedPercentage,
this.fundCollected,
this.investorSum);
String get beautifyUnitPrice {
final currencyFormatter = NumberFormat.currency(locale: 'ID');
return currencyFormatter.format(this.unitPrice);
}
String get beautifyFundTarget {
if (this.fundTarget >= 1000000.00 && this.fundTarget < 999999999.99) {
double result = this.fundTarget / 1000000;
return "IDR" + result.toInt().toString() + " Juta";
} else if (this.fundTarget >= 1000000000.00 &&
this.fundTarget < 999999999999.99) {
double result = this.fundTarget / 1000000000;
return "IDR" + result.toInt().toString() + " Milyar";
}
final currencyFormatter = NumberFormat.currency(locale: 'ID');
return currencyFormatter.format(this.fundTarget);
}
}
This diff is collapsed.
import 'package:flutter/material.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
import 'package:fundex_app/pages/kyc/biodata_body.dart';
import 'package:fundex_app/pages/kyc/biodata_keluarga_body.dart';
import 'package:fundex_app/pages/kyc/design.dart';
......@@ -34,6 +35,12 @@ class ValidasiKelurahan {
}
}
class ValidasiDomisili {
static String validate(String value) {
return value.isEmpty ? 'Harus di isi' : null;
}
}
class ValidasiKodePos {
static String validate(String val) {
Pattern pattern = r'^\d+(?:\.\d+)?$';
......@@ -69,7 +76,6 @@ class _AlamatBodyState extends State<AlamatBody> {
String _pilihKecamatan;
// ignore: unused_field
String _pilihKelurahan;
bool _checkBox = false;
// ignore: unused_field
var _onPressed;
......@@ -544,41 +550,83 @@ class _AlamatBodyState extends State<AlamatBody> {
]),
),
formTambahan(),
// button
Container(
margin: const EdgeInsets.fromLTRB(0, 21, 0, 16),
child: SizedBox(
width: 343,
height: 52,
child: ElevatedButton(
key: Key('selanjutnya button'),
style: ElevatedButton.styleFrom(
primary: primary,
onPrimary: secondary,
),
onPressed: () {
if (_formkey.currentState.validate() &&
_checkBox == true) {
Navigator.push(context,
MaterialPageRoute(builder: (context) {
return BiodataKeluarga();
}));
_formkey.currentState.save();
} else {
print("Failed");
}
},
child: Text(
"Selanjutnya",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
fontFamily: 'Inter',
color: white,
),
margin: const EdgeInsets.fromLTRB(0, 42, 0, 16),
child: Row(
children: <Widget>[
Container(
margin: const EdgeInsets.fromLTRB(0, 0, 16, 0),
child: SizedBox(
width: 163.5,
height: 52,
child: ElevatedButton(
key: Key('sebelumnyaButton'),
style: ElevatedButton.styleFrom(
primary: red1,
onPrimary: secondary,
),
onPressed: () {
if (!_formkey.currentState.validate()) {
print("Failed");
}
Navigator.push(context,
MaterialPageRoute(builder: (context) {
return BiodataBody();
}));
// _formkey.currentState.save();
// print(_noKTP);
// print(_noPWP);
},
child: Text(
"Sebelumnya",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
fontFamily: 'Inter',
color: white,
),
),
),
),
),
Container(
// margin: const EdgeInsets.fromLTRB(0, 42, 0, 16),
child: SizedBox(
width: 163.5,
height: 52,
child: ElevatedButton(
key: Key('selanjutnyaButton'),
style: ElevatedButton.styleFrom(
primary: primary,
onPrimary: secondary,
),
onPressed: () {
if (!_formkey.currentState.validate()) {
print("Failed");
}
Navigator.push(context,
MaterialPageRoute(builder: (context) {
return BiodataKeluarga();
}));
_formkey.currentState.save();
},
child: Text(
"Selanjutnya",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
fontFamily: 'Inter',
color: white,
),
),
),
),
)
],
),
),
),
),
],
),
......@@ -594,6 +642,233 @@ class _AlamatBodyState extends State<AlamatBody> {
),
));
}
// ignore: unused_field
String _alamatDomisili;
// ignore: unused_field
String _pilihProvinsiTambahan;
// ignore: unused_field
String _pilihKabupatenTambahan;
// ignore: unused_field
String _pilihKecamatanTambahan;
// ignore: unused_field
String _pilihKelurahanTambahan;
// ignore: unused_field
String _kodePosTambahan;
Widget formTambahan() {
if(_checkBox == true){
return Container(
child: Row(children: <Widget>[
Column(children: <Widget>[
// form domisili
Container(
width: 343,
margin: const EdgeInsets.fromLTRB(0, 16, 0, 0),
child: Text(
"Alamat Domisili *",
style: miniTitleTextStyle(),
),
),
Container(
width: 343,
margin: EdgeInsets.fromLTRB(0, 4, 0, 0),
child: TextFormField(
keyboardType: TextInputType.text,
decoration: formInputDecoration(),
validator: ValidasiDomisili.validate,
onSaved: (String alamatDomisili) {
_alamatDomisili = alamatDomisili;
},
),
),
// provinsi
Container(
width: 343,
margin: const EdgeInsets.fromLTRB(0, 16, 0, 4),
child: Text(
"Provinsi *",
style: miniTitleTextStyle(),
),
),
Container(
width: 343,
child: TypeAheadFormField(
key: Key('typeaheadTambahan'),
textFieldConfiguration: TextFieldConfiguration(
controller: this._typeAheadControllerPro,
decoration: formInputDecoration()),
suggestionsCallback: (pattern) {
return namaProvinsi
.getSuggestionsPro(pattern);
},
itemBuilder: (context, suggestion) {
return ListTile(
title: Text(suggestion),
);
},
transitionBuilder:
(context, suggestionsBox, controller) {
return suggestionsBox;
},
onSuggestionSelected: (suggestion) {
this._typeAheadControllerPro.text =
suggestion;
},
// ignore: missing_return
validator: ValidasiTempat.validate,
onSaved: (value) => this._pilihProvinsiTambahan = value,
),
),
// kabupaten
Container(
width: 343,
margin: const EdgeInsets.fromLTRB(0, 16, 0, 4),
child: Text(
"Kabupaten / Kota *",
style: miniTitleTextStyle(),
),
),
Container(
width: 343,
child: TypeAheadFormField(
key: Key('typeaheadKabupatenTambahan'),
textFieldConfiguration: TextFieldConfiguration(
controller: this._typeAheadControllerKab,
decoration: formInputDecoration()),
suggestionsCallback: (pattern) {
return namaKabupaten
.getSuggestionsKab(pattern);
},
itemBuilder: (context, suggestion) {
return ListTile(
title: Text(suggestion),
);
},
transitionBuilder:
(context, suggestionsBox, controller) {
return suggestionsBox;
},
onSuggestionSelected: (suggestion) {
this._typeAheadControllerKab.text =
suggestion;
},
// ignore: missing_return
validator: ValidasiKabupaten.validate,
onSaved: (value) =>
this._pilihKabupatenTambahan = value,
),
),
Container(
width: 343,
margin: const EdgeInsets.fromLTRB(0, 16, 0, 4),
child: Text(
"Kecamatan *",
style: miniTitleTextStyle(),
),
),
Container(
width: 343,
child: TypeAheadFormField(
key: Key('typeaheadKecamatanTambahan'),
textFieldConfiguration: TextFieldConfiguration(
controller: this._typeAheadControllerKec,
decoration: formInputDecoration()),
suggestionsCallback: (pattern) {
return namaKecamatan
.getSuggestionsKec(pattern);
},
itemBuilder: (context, suggestion) {
return ListTile(
title: Text(suggestion),
);
},
transitionBuilder:
(context, suggestionsBox, controller) {
return suggestionsBox;
},
onSuggestionSelected: (suggestion) {
this._typeAheadControllerKec.text =
suggestion;
},
// ignore: missing_return
validator: ValidasiKecamatan.validate,
onSaved: (value) =>
this._pilihKecamatanTambahan = value,
),
),
Container(
width: 343,
margin: const EdgeInsets.fromLTRB(0, 16, 0, 4),
child: Text(
"Kelurahan *",
style: miniTitleTextStyle(),
),
),
Container(
width: 343,
child: TypeAheadFormField(
key: Key('typeaheadKelurahanTambahan'),
textFieldConfiguration: TextFieldConfiguration(
controller: this._typeAheadControllerKel,
decoration: formInputDecoration()),
suggestionsCallback: (pattern) {
return namaKelurahan
.getSuggestionsKel(pattern);
},
itemBuilder: (context, suggestion) {
return ListTile(
title: Text(suggestion),
);
},
transitionBuilder:
(context, suggestionsBox, controller) {
return suggestionsBox;
},
onSuggestionSelected: (suggestion) {
this._typeAheadControllerKel.text =
suggestion;
},
// ignore: missing_return
validator: ValidasiKelurahan.validate,
onSaved: (value) =>
this._pilihKelurahanTambahan = value,
),
),
// form kode pos
Container(
width: 343,
margin:
const EdgeInsets.fromLTRB(0, 12, 0, 0),
child: Text(
"Kode Pos *",
style: miniTitleTextStyle(),
),
),
Container(
width: 343,
margin: EdgeInsets.fromLTRB(0, 4, 0, 0),
child: TextFormField(
keyboardType: TextInputType.number,
decoration: formInputDecoration(),
validator: ValidasiKodePos.validate,
onSaved: (String kode) {
_kodePosTambahan = kode;
},
),
),
])
]));
}
else{
return Container();
}
}
}
// ignore: camel_case_types
......
This diff is collapsed.
import 'package:flutter/material.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:fundex_app/main.dart';
import 'package:fundex_app/pages/kyc/data_identitas.dart';
import 'package:fundex_app/pages/kyc/design.dart';
// import 'package:grouped_buttons/grouped_buttons.dart';
......@@ -617,7 +618,7 @@ class _DataPendukungState extends State<DataPendukung> {
}
Navigator.push(context,
MaterialPageRoute(builder: (context) {
return MyApp();
return DataIdentitas();
}));
// _formkey.currentState.save();
// print(_noKTP);
......
......@@ -3,8 +3,8 @@ import 'dart:io';
import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/material.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:fundex_app/main.dart';
import 'package:fundex_app/pages/kyc/biodata_keluarga_body.dart';
import 'package:fundex_app/pages/kyc/biodata_pendukung.dart';
import 'package:fundex_app/pages/kyc/design.dart';
import 'package:image_picker/image_picker.dart';
......@@ -459,7 +459,7 @@ class _DataIdentitasState extends State<DataIdentitas> {
}
Navigator.push(context,
MaterialPageRoute(builder: (context) {
return MyApp();
return DataPendukung();
}));
_formkey.currentState.save();
print(_noKTP);
......
......@@ -164,13 +164,23 @@ void main() {
});
testWidgets('Button selanjutnya', (WidgetTester tester) async {
final buttonSelanjutnya = find.byKey(Key('selanjutnya button'));
final buttonSelanjutnya = find.byKey(Key('selanjutnyaButton'));
await tester.pumpWidget(MaterialApp(home: AlamatBody()));
expect(buttonSelanjutnya, findsOneWidget);
expect(find.text("Selanjutnya"), findsOneWidget);
await tester.tap(buttonSelanjutnya);
await tester.pumpAndSettle();
await tester.pumpAndSettle();
});
testWidgets('Button sebelumnya', (WidgetTester tester) async {
final buttonSebelumnya= find.byKey(Key('sebelumnyaButton'));
await tester.pumpWidget(MaterialApp(home: AlamatBody()));
expect(buttonSebelumnya, findsOneWidget);
expect(find.text("Sebelumnya"), findsOneWidget);
await tester.tap(buttonSebelumnya);
await tester.pumpAndSettle();
});
}
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:fundex_app/pages/business/Ukm.dart';
import 'package:fundex_app/pages/business/exploreBusiness.dart';
void main() {
......@@ -13,7 +14,18 @@ void main() {
final transactionIcon = find.byKey(Key('transactionIcon'));
final helpIcon = find.byKey(Key('helpIcon'));
final accountIcon = find.byKey(Key('accountIcon'));
final jenisPenawaranDropDownButton =
find.byKey(Key('jenisPenawaranDropDownButton'));
final progressDropDownButton = find.byKey(Key('progressDropDownButton'));
final urutkanDropDownButton = find.byKey(Key('urutkanDropDownButton'));
final clearFilterTextButton = find.byKey(Key('clearFilterTextButton'));
final jenisPenawaranDropDownMenuItem =
find.byKey(Key('jenisPenawaranDropDownMenuItem'));
final progressDropDownMenuItem =
find.byKey(Key('progressDropDownMenuItem'));
final urutkanDropDownMenuItem = find.byKey(Key('urutkanDropDownMenuItem'));
final ukmCard = find.byKey(Key('ukmCard'));
final List<Ukm> ukmList = ExploreBusiness().createState().ukmList;
// execute
await tester.pumpWidget(MaterialApp(home: ExploreBusiness()));
......@@ -26,6 +38,14 @@ void main() {
expect(transactionIcon, findsOneWidget);
expect(helpIcon, findsOneWidget);
expect(accountIcon, findsOneWidget);
expect(jenisPenawaranDropDownButton, findsOneWidget);
expect(progressDropDownButton, findsOneWidget);
expect(urutkanDropDownButton, findsOneWidget);
expect(jenisPenawaranDropDownMenuItem, findsNWidgets(10));
expect(progressDropDownMenuItem, findsNWidgets(3));
expect(urutkanDropDownMenuItem, findsNWidgets(3));
expect(clearFilterTextButton, findsOneWidget);
expect(ukmCard, findsNWidgets(ukmList.length));
});
testWidgets('Back Icon navigate into Dashboard when pressed',
......@@ -42,10 +62,62 @@ void main() {
await tester.pumpAndSettle();
// check outputs
//positive
expect(penawaranString, findsOneWidget);
//negative
expect(backIcon, findsNothing);
});
testWidgets('Testing filter and sort', (WidgetTester tester) async {
// initialize
final exploreBusiness = ExploreBusiness();
final ukmCard = find.byKey(Key('ukmCard'));
final jenisPenawaranDropDown =
find.byKey(Key('jenisPenawaranDropDownButton'));
final progressDropDown = find.byKey(Key('progressDropDownButton'));
final urutkanDropDown = find.byKey(Key('urutkanDropDownButton'));
final clearFilter = find.byKey(Key('clearFilterTextButton'));
List<Ukm> ukmList = exploreBusiness.createState().ukmList;