Fakultas Ilmu Komputer UI

Commit 256c9306 authored by wibias fuad's avatar wibias fuad
Browse files

feat: integrate with staging

parents 011d1017 f3da0889
Pipeline #77346 passed with stages
in 14 minutes and 41 seconds
......@@ -223,6 +223,12 @@
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "flutter_multi_carousel",
"rootUri": "file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_multi_carousel-1.0.3",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "flutter_plugin_android_lifecycle",
"rootUri": "file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.1",
......@@ -662,7 +668,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-05-17T00:55:07.249865Z",
"generated": "2021-05-17T02:00:32.676774Z",
"generator": "pub",
"generatorVersion": "2.12.2"
}
......@@ -142,6 +142,10 @@ flutter_keyboard_visibility_web
2.12
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility_web-2.0.0/
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility_web-2.0.0/lib/
flutter_multi_carousel
2.0
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_multi_carousel-1.0.3/
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_multi_carousel-1.0.3/lib/
flutter_plugin_android_lifecycle
2.12
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.1/
......
{"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-05-17 08:52:38.494237","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-05-17 09:09:28.713277","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-05-17 07:55:07.163561.
# Generated by pub on 2021-05-17 09:00:32.634786.
_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/
......@@ -41,6 +41,7 @@ flutter:file:///C:/flutter/flutter/packages/flutter/lib/
flutter_keyboard_visibility:file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility-5.0.0/lib/
flutter_keyboard_visibility_platform_interface:file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility_platform_interface-2.0.0/lib/
flutter_keyboard_visibility_web:file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility_web-2.0.0/lib/
flutter_multi_carousel:file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_multi_carousel-1.0.3/lib/
flutter_plugin_android_lifecycle:file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.1/lib/
flutter_secure_storage:file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.5/lib/
flutter_svg:file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.3/lib/
......
import 'dart:convert';
import 'dart:io';
import 'package:fundex_app/storage/storage.dart';
import 'package:http/http.dart' show Client;
......@@ -96,4 +97,270 @@ class Api {
print("Unknown");
}
}
Future patchMember(String name, int addressId, String phone) async {
var apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member)');
var token = await secureStorage.readSecureData('accessToken');
final apiResult = await client.patch(apiURL,
headers: <String, String>{
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({
'name': name,
'address_id': addressId,
'phone': phone
}));
if (apiResult.statusCode == 200) {
print('Patch member berhasil');
print(apiResult.statusCode);
print(apiResult.body);
return 'Simpan Berhasil!';
} else {
print('Patch member ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
}
}
Future<String> gender(String gen) async {
var apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member-attribute)');
var token = await secureStorage.readSecureData('accessToken');
final apiResult = await client.post(apiURL,
headers: <String, String>{
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({
'attribute_name': 'gender',
'attribute_value': '$gen'
}));
if (apiResult.statusCode == 200) {
print('gender berhasil');
print(apiResult.statusCode);
print(apiResult.body);
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var idMemberAttributeGender = jsonData['id'];
await secureStorage.writeSecureData('idMemberAttributeGender', idMemberAttributeGender);
print(await secureStorage.readSecureData('idMemberAttributeGender'));
return 'Simpan Berhasil!';
} else {
print('gender ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
}
}
Future birthdate(DateTime date) async {
var apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member-attribute)');
var token = await secureStorage.readSecureData('accessToken');
final apiResult = await client.post(apiURL,
headers: <String, String>{
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({
'attribute_name': 'birthdate',
'attribute_value': date
}));
if (apiResult.statusCode == 200) {
print('birthdate berhasil');
print(apiResult.statusCode);
print(apiResult.body);
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var idMemberAttributeBirthdate = jsonData['id'];
await secureStorage.writeSecureData('idMemberAttributeBirthdate', idMemberAttributeBirthdate);
print(await secureStorage.readSecureData('idMemberAttributeBirthdate'));
return 'Simpan Berhasil!';
} else {
print('birthdate ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
}
}
Future birthplace(String nameCity) async {
var apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member-attribute)');
var token = await secureStorage.readSecureData('accessToken');
final apiResult = await client.post(apiURL,
headers: <String, String>{
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode({
'attribute_name': 'birthplace',
'attribute_value': nameCity
}));
if (apiResult.statusCode == 200) {
print('birthplace berhasil');
print(apiResult.statusCode);
print(apiResult.body);
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var idMemberAttributeBirthplace = jsonData['id'];
await secureStorage.writeSecureData('idMemberAttributeBirthplace', idMemberAttributeBirthplace);
print(await secureStorage.readSecureData('idMemberAttributeBirthplace'));
return 'Simpan Berhasil!';
} else {
print('birthplace ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
}
}
Future getMember() async {
final apiURL = Uri.parse('https://canary.fundex.id/api/v1.1/member');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
};
var apiResult = await client.get(apiURL, headers: headers);
print(await secureStorage.readSecureData('accessToken'));
print(apiResult.reasonPhrase);
print(apiResult.request);
print("get member: " + (apiResult.statusCode).toString());
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var jsonMember = (jsonData as Map<String, dynamic>)['member'];
return jsonMember;
} else {
throw Exception('Get Failed');
}
}
Future getRefCity() async {
final apiURL = Uri.parse('https://canary.fundex.id/api/v1.1/ref-cities?offset=&limit=');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
};
var apiResult = await client.get(apiURL, headers: headers);
print(await secureStorage.readSecureData('accessToken'));
print(apiResult.reasonPhrase);
print(apiResult.request);
print("get ref cities: " + (apiResult.statusCode).toString());
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
List<dynamic> refCities = jsonData['ref_cities'];
final List<String> city = <String>[];
for (var i = 0; i < refCities.length; i++) {
city.add(refCities[i]['name']);
}
return city;
} else {
throw Exception('Get Failed');
}
}
Future getRefState() async {
final apiURL = Uri.parse('https://canary.fundex.id/api/v1.1/ref-states?offset=&limit=');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
};
var apiResult = await client.get(apiURL, headers: headers);
print(await secureStorage.readSecureData('accessToken'));
print(apiResult.reasonPhrase);
print(apiResult.request);
print("get ref state: " + (apiResult.statusCode).toString());
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
List<dynamic> refCities = jsonData['ref_states'];
final List<String> state = <String>[];
for (var i = 0; i < refCities.length; i++) {
state.add(refCities[i]['name']);
}
return state;
} else {
throw Exception('Get Failed');
}
}
Future getRefDistrict() async {
final apiURL = Uri.parse('https://canary.fundex.id/api/v1.1/ref-districts?offset=&limit=');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token',
};
var apiResult = await client.get(apiURL, headers: headers);
print(await secureStorage.readSecureData('accessToken'));
print(apiResult.reasonPhrase);
print(apiResult.request);
print("get ref state: " + (apiResult.statusCode).toString());
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
List<dynamic> refCities = jsonData['ref_districts'];
final List<String> distr = <String>[];
for (var i = 0; i < refCities.length; i++) {
distr.add(refCities[i]['name']);
}
return distr;
} else {
throw Exception('Get Failed');
}
}
Future postAddress(
String address,
String district,
String city,
String province,
String zipCode
) async {
var apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/address)');
var token = await secureStorage.readSecureData('accessToken');
final apiResult = await client.post(apiURL,
headers: <String, String>{
HttpHeaders.authorizationHeader: 'Bearer $token',
},
body: jsonEncode(<String, String>{
"address": address,
"district": district,
"city": city,
"province": province,
"country": "Indonesia",
"zip_code": zipCode
}));
if (apiResult.statusCode == 200) {
// var jsonObject = json.decode(apiResult.body);
// var data = (jsonObject as Map<String, dynamic>)['data'];
// var name = data['name'];
// Map<String, dynamic> map = {'name': name};
print('Patch member berhasil');
print(apiResult.statusCode);
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
return 'Simpan Berhasil!';
} else {
print(apiResult.statusCode);
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
}
}
}
import 'package:flutter/material.dart';
const primary = Color(0xFF12284B);
const secondary = Color(0xFF0091C9);
const white = Color(0xFFFFFFFF);
const black1 = Color(0xFF000000);
const gray4 = Color(0xFFBDBDBD);
\ No newline at end of file
// To parse this JSON data, do
//
// final user = userFromJson(jsonString);
import 'dart:convert';
User userFromJson(String str) => User.fromJson(json.decode(str));
String userToJson(User data) => json.encode(data.toJson());
class User {
User({
this.email,
this.password,
this.role,
this.isCompany,
});
String email;
String password;
String role;
bool isCompany;
factory User.fromJson(Map<String, dynamic> json) => User(
email: json["email"],
password: json["password"],
role: json["role"],
isCompany: json["is_company"],
);
Map<String, dynamic> toJson() => {
"email": email,
"password": password,
"role": role,
"is_company": isCompany,
};
}
This diff is collapsed.
This diff is collapsed.
import 'package:flutter/material.dart';
import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
import 'package:fundex_app/pages/kyc/biodata_body.dart';
......@@ -82,7 +83,75 @@ class _AlamatBodyState extends State<AlamatBody> {
final TextEditingController _typeAheadControllerPro = TextEditingController();
final TextEditingController _typeAheadControllerKab = TextEditingController();
final TextEditingController _typeAheadControllerKec = TextEditingController();
final TextEditingController _typeAheadControllerKel = TextEditingController();
List<String> city;
List<String> states;
List<String> distr;
void initState(){
super.initState();
init();
}
Future init() async {
final List<String> listCity = await Api().getRefCity();
final List<String> listStates = await Api().getRefState();
final List<String> listDistr = await Api().getRefDistrict();
city = listCity;
distr= listDistr;
states = listStates;
setState(() {
this.distr= distr;
this.states = states;
this.city = city;
});
}
List<String> getSuggestionsCity(String query) {
List<String> matches = [];
matches.addAll(city);
matches.retainWhere((s) => s.toLowerCase().contains(query.toLowerCase()));
return matches;
}
List<String> getSuggestionsStates(String query) {
List<String> matches = [];
matches.addAll(states);
matches.retainWhere((s) => s.toLowerCase().contains(query.toLowerCase()));
return matches;
}
List<String> getSuggestionsDistr(String query) {
List<String> matches = [];
matches.addAll(distr);
matches.retainWhere((s) => s.toLowerCase().contains(query.toLowerCase()));
return matches;
}
List<String> getSuggestionsCityTambahan(String query) {
List<String> matches = [];
matches.addAll(city);
matches.retainWhere((s) => s.toLowerCase().contains(query.toLowerCase()));
return matches;
}
List<String> getSuggestionsStatesTambahan(String query) {
List<String> matches = [];
matches.addAll(states);
matches.retainWhere((s) => s.toLowerCase().contains(query.toLowerCase()));
return matches;
}
List<String> getSuggestionsDistrTambahan(String query) {
List<String> matches = [];
matches.addAll(distr);
matches.retainWhere((s) => s.toLowerCase().contains(query.toLowerCase()));
return matches;
}
@override
Widget build(BuildContext context) {
......@@ -354,8 +423,7 @@ class _AlamatBodyState extends State<AlamatBody> {
controller: this._typeAheadControllerPro,
decoration: formInputDecoration()),
suggestionsCallback: (pattern) {
return namaProvinsi
.getSuggestionsPro(pattern);
return getSuggestionsStates(pattern);
},
itemBuilder: (context, suggestion) {
return ListTile(
......@@ -393,8 +461,7 @@ class _AlamatBodyState extends State<AlamatBody> {
controller: this._typeAheadControllerKab,
decoration: formInputDecoration()),
suggestionsCallback: (pattern) {
return namaKabupaten
.getSuggestionsKab(pattern);
return getSuggestionsCity(pattern);
},
itemBuilder: (context, suggestion) {
return ListTile(
......@@ -433,8 +500,7 @@ class _AlamatBodyState extends State<AlamatBody> {
controller: this._typeAheadControllerKec,
decoration: formInputDecoration()),
suggestionsCallback: (pattern) {
return namaKecamatan
.getSuggestionsKec(pattern);
return getSuggestionsDistr(pattern);
},
itemBuilder: (context, suggestion) {
return ListTile(
......@@ -467,32 +533,13 @@ class _AlamatBodyState extends State<AlamatBody> {
Container(
width: 343,
child: TypeAheadFormField(
key: Key('typeaheadKelurahan'),
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
child: TextFormField(
keyboardType: TextInputType.text,
decoration: formInputDecoration(),
validator: ValidasiKelurahan.validate,
onSaved: (value) =>
this._pilihKelurahan = value,
onSaved: (String pilihKelurahan) {
_pilihKelurahan = pilihKelurahan;
},
),
),
......@@ -576,9 +623,6 @@ class _AlamatBodyState extends State<AlamatBody> {
MaterialPageRoute(builder: (context) {
return BiodataBody();
}));
// _formkey.currentState.save();
// print(_noKTP);
// print(_noPWP);
},
child: Text(
"Sebelumnya",
......@@ -606,7 +650,14 @@ class _AlamatBodyState extends State<AlamatBody> {
onPressed: () {
if (!_formkey.currentState.validate()) {
print("Failed");
return;
}
if (_checkBox == true) {
Api().postAddress(_alamatDomisili, _pilihKecamatanTambahan, _pilihKabupatenTambahan, _pilihProvinsiTambahan, _kodePosTambahan);
}
Api().postAddress(_alamatLengkap, _pilihKecamatan, _pilihKabupaten, _selectedCity, _kodePos);
Navigator.push(context,
MaterialPageRoute(builder: (context) {
return BiodataKeluarga();
......@@ -699,8 +750,7 @@ class _AlamatBodyState extends State<AlamatBody> {
controller: this._typeAheadControllerPro,
decoration: formInputDecoration()),
suggestionsCallback: (pattern) {
return namaProvinsi
.getSuggestionsPro(pattern);
return getSuggestionsStatesTambahan(pattern);
},
itemBuilder: (context, suggestion) {
return ListTile(
......@@ -738,8 +788,7 @@ class _AlamatBodyState extends State<AlamatBody> {
controller: this._typeAheadControllerKab,
decoration: formInputDecoration()),
suggestionsCallback: (pattern) {
return namaKabupaten
.getSuggestionsKab(pattern);
return getSuggestionsCityTambahan(pattern);
},
itemBuilder: (context, suggestion) {
return ListTile(
......@@ -777,8 +826,7 @@ class _AlamatBodyState extends State<AlamatBody> {
controller: this._typeAheadControllerKec,
decoration: formInputDecoration()),
suggestionsCallback: (pattern) {
return namaKecamatan
.getSuggestionsKec(pattern);
return getSuggestionsDistrTambahan(pattern);
},
itemBuilder: (context, suggestion) {
return ListTile(
......@@ -810,32 +858,13 @@ class _AlamatBodyState extends State<AlamatBody> {