slight changes
This commit is contained in:
6
.env
6
.env
@ -1 +1,5 @@
|
||||
URL=http://192.168.189.237:9000/
|
||||
URL=http://192.168.218.237:9000/
|
||||
# URL=http://192.168.12.227:9000/
|
||||
# URL=https://garis-tangan-lagi.herokuapp.com/
|
||||
# URL=http://garis-tangan1.kicap-karan.com/
|
||||
# URL=https://garistangan-serov.pitunnel.com/
|
||||
@ -26,7 +26,8 @@ apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion flutter.compileSdkVersion
|
||||
// compileSdkVersion flutter.compileSdkVersion
|
||||
compileSdkVersion 33
|
||||
ndkVersion flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.cek_tapak_tangan">
|
||||
<application
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<application
|
||||
android:label="cek_tapak_tangan"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
|
||||
@ -26,6 +26,11 @@ class _AmbilFotoState extends State<AmbilFoto> {
|
||||
Uint8List? imagebytes;
|
||||
String? ramalannya;
|
||||
|
||||
List<String> gender = ['Laki-laki', 'Perempuan'];
|
||||
String genderValue = 'Laki-laki';
|
||||
List<String> umur = ['Anak-anak', 'Dewasa', 'Lanjut Usia'];
|
||||
String umurValue = 'Anak-anak';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@ -49,7 +54,8 @@ class _AmbilFotoState extends State<AmbilFoto> {
|
||||
});
|
||||
}
|
||||
await EasyLoading.show(
|
||||
status: "Periksa Foto",
|
||||
// status: "Periksa Foto",
|
||||
status: "Membaca Garis Tangan Dari Telapak Tangan Kiri Anda",
|
||||
maskType: EasyLoadingMaskType.black,
|
||||
);
|
||||
Map? cekFoto = await ApiServices.cekFoto(_imgPath);
|
||||
@ -57,25 +63,26 @@ class _AmbilFotoState extends State<AmbilFoto> {
|
||||
// dev.i(cekFoto);
|
||||
if (cekFoto!['status'] == 500) return mySnackBar(cekFoto['message'], 1);
|
||||
if (cekFoto['status'] == 404) return mySnackBar(cekFoto['message'], 2);
|
||||
await EasyLoading.show(
|
||||
status: "Membaca Garis Tangan Dari Telapak Tangan Kiri Anda",
|
||||
maskType: EasyLoadingMaskType.black,
|
||||
);
|
||||
setState(() {
|
||||
ramalannya = null;
|
||||
});
|
||||
// await EasyLoading.show(
|
||||
// status: "Membaca Garis Tangan Dari Telapak Tangan Kiri Anda",
|
||||
// maskType: EasyLoadingMaskType.black,
|
||||
// );
|
||||
// setState(() {
|
||||
// ramalannya = null;
|
||||
// });
|
||||
|
||||
Map? cekRamalan = await ApiServices.cekRamalan(_imgPath);
|
||||
await EasyLoading.dismiss();
|
||||
// dev.i(cekFoto);
|
||||
if (cekRamalan!['status'] == 500) {
|
||||
return mySnackBar(cekRamalan['message'], 1);
|
||||
}
|
||||
if (cekRamalan['status'] == 404) {
|
||||
return mySnackBar(cekRamalan['message'], 2);
|
||||
}
|
||||
// Map? cekRamalan = await ApiServices.cekRamalan(_imgPath);
|
||||
// await EasyLoading.dismiss();
|
||||
// // dev.i(cekFoto);
|
||||
// if (cekRamalan!['status'] == 500) {
|
||||
// return mySnackBar(cekRamalan['message'], 1);
|
||||
// }
|
||||
// if (cekRamalan['status'] == 404) {
|
||||
// return mySnackBar(cekRamalan['message'], 2);
|
||||
// }
|
||||
setState(() {
|
||||
ramalannya = cekRamalan['message'];
|
||||
ramalannya = cekFoto['message'];
|
||||
// ramalannya = cekRamalan['message'];
|
||||
});
|
||||
await EasyLoading.dismiss();
|
||||
|
||||
@ -218,6 +225,108 @@ class _AmbilFotoState extends State<AmbilFoto> {
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
child: DropdownButtonFormField(
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Jenis Kelamin',
|
||||
labelStyle: const TextStyle(
|
||||
color: ThemeInfo.primary,
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
borderSide: const BorderSide(
|
||||
color: ThemeInfo.primary,
|
||||
),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
borderSide: const BorderSide(
|
||||
color: ThemeInfo.primary,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
borderSide: const BorderSide(
|
||||
color: ThemeInfo.primary,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
value: genderValue,
|
||||
items: gender.map((String value) {
|
||||
return DropdownMenuItem(
|
||||
value: value,
|
||||
child: Text(
|
||||
value,
|
||||
style: const TextStyle(
|
||||
color: ThemeInfo.primary,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (item) {
|
||||
// log(item.toString() + " ini item");
|
||||
setState(() {
|
||||
genderValue = item.toString();
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
child: DropdownButtonFormField(
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Umur',
|
||||
labelStyle: const TextStyle(
|
||||
color: ThemeInfo.primary,
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
borderSide: const BorderSide(
|
||||
color: ThemeInfo.primary,
|
||||
),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
borderSide: const BorderSide(
|
||||
color: ThemeInfo.primary,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
borderSide: const BorderSide(
|
||||
color: ThemeInfo.primary,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
value: umurValue,
|
||||
items: umur.map((String value) {
|
||||
return DropdownMenuItem(
|
||||
value: value,
|
||||
child: Text(
|
||||
value,
|
||||
style: const TextStyle(
|
||||
color: ThemeInfo.primary,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (item) {
|
||||
// log(item.toString() + " ini item");
|
||||
setState(() {
|
||||
umurValue = item.toString();
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: ThemeInfo.primary,
|
||||
|
||||
@ -7,11 +7,12 @@ import 'package:path/path.dart';
|
||||
class ApiServices {
|
||||
static final dev = Logger();
|
||||
static final url = dotenv.env['URL'];
|
||||
// static final url = "http://192.168.218.21:9000/";
|
||||
|
||||
static final options = BaseOptions(
|
||||
baseUrl: url!,
|
||||
connectTimeout: 5000,
|
||||
receiveTimeout: 5000,
|
||||
connectTimeout: 120000,
|
||||
receiveTimeout: 120000,
|
||||
);
|
||||
|
||||
static Dio dio = Dio(options);
|
||||
|
||||
35
pubspec.lock
35
pubspec.lock
@ -331,6 +331,41 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
permission_handler:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: permission_handler
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "10.1.0"
|
||||
permission_handler_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_android
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "10.1.0"
|
||||
permission_handler_apple:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_apple
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "9.0.6"
|
||||
permission_handler_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.9.0"
|
||||
permission_handler_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_windows
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.1"
|
||||
platform:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@ -50,7 +50,7 @@ dependencies:
|
||||
http_parser:
|
||||
path:
|
||||
animated_snack_bar:
|
||||
|
||||
permission_handler:
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@ -6,6 +6,9 @@
|
||||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <permission_handler_windows/permission_handler_windows_plugin.h>
|
||||
|
||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
PermissionHandlerWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
permission_handler_windows
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
||||
Reference in New Issue
Block a user