fixing depedency

This commit is contained in:
pahmiudahgede 2025-05-23 01:30:23 +07:00
parent 972de38377
commit a832485e86
11 changed files with 275 additions and 108 deletions

View File

@ -18,6 +18,21 @@ migration:
- platform: android - platform: android
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- platform: ios
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- platform: linux
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- platform: macos
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- platform: web
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- platform: windows
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
# User provided section # User provided section

View File

@ -8,7 +8,7 @@ plugins {
android { android {
namespace = "com.example.rijig_mobile" namespace = "com.example.rijig_mobile"
compileSdk = flutter.compileSdkVersion compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion ndkVersion = "28.1.13356709"
compileOptions { compileOptions {
sourceCompatibility = JavaVersion.VERSION_11 sourceCompatibility = JavaVersion.VERSION_11

View File

@ -1,10 +1,12 @@
import 'package:rijig_mobile/core/utils/exportimportview.dart'; import 'package:rijig_mobile/core/utils/exportimportview.dart';
import 'package:rijig_mobile/features/auth/presentation/screen/collector/clogin_screen.dart'; import 'package:rijig_mobile/features/auth/presentation/screen/collector/clogin_screen.dart';
import 'package:rijig_mobile/features/auth/presentation/screen/collector/identity_validation_screen.dart';
import 'package:rijig_mobile/features/auth/presentation/screen/collector/welcome_collector_screen.dart'; import 'package:rijig_mobile/features/auth/presentation/screen/collector/welcome_collector_screen.dart';
final router = GoRouter( final router = GoRouter(
routes: [ routes: [
GoRoute(path: '/', builder: (context, state) => SplashScreen()), // GoRoute(path: '/', builder: (context, state) => SplashScreen()),
GoRoute(path: '/', builder: (context, state) => UploadKtpScreen()),
GoRoute( GoRoute(
path: '/onboarding', path: '/onboarding',
builder: (context, state) => OnboardingPageScreen(), builder: (context, state) => OnboardingPageScreen(),

View File

@ -0,0 +1,122 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:google_mlkit_text_recognition/google_mlkit_text_recognition.dart';
import 'package:image_picker/image_picker.dart';
import 'package:rijig_mobile/core/utils/guide.dart';
import 'package:rijig_mobile/widget/buttoncard.dart';
class UploadKtpScreen extends StatefulWidget {
const UploadKtpScreen({super.key});
@override
State<UploadKtpScreen> createState() => _UploadKtpScreenState();
}
class _UploadKtpScreenState extends State<UploadKtpScreen> {
File? _ktpImage;
String nik = '';
String nama = '';
String alamat = '';
bool isLoading = false;
Future<void> _pickImage() async {
final pickedFile = await ImagePicker().pickImage(source: ImageSource.camera);
if (pickedFile != null) {
setState(() {
isLoading = true;
_ktpImage = File(pickedFile.path);
});
await _processImage(File(pickedFile.path));
setState(() => isLoading = false);
}
}
//dari kode ini
Future<void> _processImage(File imageFile) async {
final inputImage = InputImage.fromFile(imageFile);
final textRecognizer = TextRecognizer(script: TextRecognitionScript.latin);
final RecognizedText recognizedText = await textRecognizer.processImage(inputImage);
await textRecognizer.close();
final text = recognizedText.text;
setState(() {
nik = _extractValue("NIK", text);
nama = _extractValue("Nama", text);
alamat = _extractValue("Alamat", text);
});
}
// terdapat error 'textRecognizer' is deprecated and shouldn't be used. Use [google_mlkit_text_recognition] plugin instead of [google_ml_kit].
// Try replacing the use of the deprecated member with the replacement.dartdeprecated_member_use
// (deprecated) TextRecognizer textRecognizer({dynamic script = TextRecognitionScript.latin})
// Type: TextRecognizer Function({dynamic script})
// package:google_ml_kit/src/vision.dart
// Return an instance of [TextRecognizer].
String _extractValue(String key, String fullText) {
final regex = RegExp('${key}s*[:s]?s*(.*)', caseSensitive: false);
final match = regex.firstMatch(fullText);
return match?.group(1)?.split("\n").first.trim() ?? '';
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: whiteColor,
appBar: AppBar(
title: const Text("Upload KTP"),
backgroundColor: primaryColor,
foregroundColor: whiteColor,
),
body: SafeArea(
child: SingleChildScrollView(
padding: const EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
_ktpImage != null
? Image.file(_ktpImage!, height: 200)
: Container(
height: 200,
color: Colors.grey.shade300,
child: const Center(child: Text("Belum ada gambar KTP")),
),
const SizedBox(height: 20),
isLoading
? const CircularProgressIndicator()
: CardButtonOne(
textButton: "Upload Foto KTP",
fontSized: 16,
colorText: whiteColor,
color: primaryColor,
borderRadius: 10,
horizontal: double.infinity,
vertical: 50,
onTap: _pickImage,
usingRow: false,
),
const SizedBox(height: 30),
TextField(
decoration: const InputDecoration(labelText: 'NIK'),
controller: TextEditingController(text: nik),
onChanged: (val) => nik = val,
),
TextField(
decoration: const InputDecoration(labelText: 'Nama'),
controller: TextEditingController(text: nama),
onChanged: (val) => nama = val,
),
TextField(
decoration: const InputDecoration(labelText: 'Alamat'),
controller: TextEditingController(text: alamat),
onChanged: (val) => alamat = val,
),
],
),
),
),
);
}
}

View File

@ -6,9 +6,13 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <file_selector_linux/file_selector_plugin.h>
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h> #include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) { void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);

View File

@ -3,6 +3,7 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
file_selector_linux
flutter_secure_storage_linux flutter_secure_storage_linux
) )

View File

@ -7,6 +7,7 @@ import Foundation
import connectivity_plus import connectivity_plus
import device_info_plus import device_info_plus
import file_selector_macos
import flutter_secure_storage_macos import flutter_secure_storage_macos
import path_provider_foundation import path_provider_foundation
import shared_preferences_foundation import shared_preferences_foundation
@ -14,6 +15,7 @@ import shared_preferences_foundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))

View File

@ -105,6 +105,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.1" version: "2.0.1"
cross_file:
dependency: transitive
description:
name: cross_file
sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670"
url: "https://pub.dev"
source: hosted
version: "0.3.4+2"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
@ -185,6 +193,38 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "7.0.1" version: "7.0.1"
file_selector_linux:
dependency: transitive
description:
name: file_selector_linux
sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33"
url: "https://pub.dev"
source: hosted
version: "0.9.3+2"
file_selector_macos:
dependency: transitive
description:
name: file_selector_macos
sha256: "271ab9986df0c135d45c3cdb6bd0faa5db6f4976d3e4b437cf7d0f258d941bfc"
url: "https://pub.dev"
source: hosted
version: "0.9.4+2"
file_selector_platform_interface:
dependency: transitive
description:
name: file_selector_platform_interface
sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b
url: "https://pub.dev"
source: hosted
version: "2.6.2"
file_selector_windows:
dependency: transitive
description:
name: file_selector_windows
sha256: "320fcfb6f33caa90f0b58380489fc5ac05d99ee94b61aa96ec2bff0ba81d3c2b"
url: "https://pub.dev"
source: hosted
version: "0.9.3+4"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:
@ -230,6 +270,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.0.0" version: "5.0.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: f948e346c12f8d5480d2825e03de228d0eb8c3a737e4cdaa122267b89c022b5e
url: "https://pub.dev"
source: hosted
version: "2.0.28"
flutter_screenutil: flutter_screenutil:
dependency: "direct main" dependency: "direct main"
description: description:
@ -336,22 +384,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.2.1" version: "6.2.1"
google_ml_kit:
dependency: "direct main"
description:
name: google_ml_kit
sha256: a2da12a62353a6cad71534b52ada3af14a5b842e6c9b1014ce4d243652b30f4b
url: "https://pub.dev"
source: hosted
version: "0.20.0"
google_mlkit_barcode_scanning:
dependency: transitive
description:
name: google_mlkit_barcode_scanning
sha256: b38505df2d3fdf7830979d60fee55039c2f442d189b2e06fcb2fe494ba65d0db
url: "https://pub.dev"
source: hosted
version: "0.14.1"
google_mlkit_commons: google_mlkit_commons:
dependency: transitive dependency: transitive
description: description:
@ -360,102 +392,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.11.0" version: "0.11.0"
google_mlkit_digital_ink_recognition:
dependency: transitive
description:
name: google_mlkit_digital_ink_recognition
sha256: "8d2b89401bdeeba97158377167429dbc5cb339ebbd21e0889dca773f1c79a884"
url: "https://pub.dev"
source: hosted
version: "0.14.1"
google_mlkit_entity_extraction:
dependency: transitive
description:
name: google_mlkit_entity_extraction
sha256: "145bc26422b7e62d50cc4eca1ac394d13ac6a97e4c09b8baf7ff058b64d2f9cc"
url: "https://pub.dev"
source: hosted
version: "0.15.1"
google_mlkit_face_detection:
dependency: transitive
description:
name: google_mlkit_face_detection
sha256: f336737d5b8a86797fd4368f42a5c26aeaa9c6dcc5243f0a16b5f6f663cfb70a
url: "https://pub.dev"
source: hosted
version: "0.13.1"
google_mlkit_face_mesh_detection:
dependency: transitive
description:
name: google_mlkit_face_mesh_detection
sha256: "3683daed2463d9631c7f01b31bfc40d22a1fd4c0392d82a24ce275af06bc811f"
url: "https://pub.dev"
source: hosted
version: "0.4.1"
google_mlkit_image_labeling:
dependency: transitive
description:
name: google_mlkit_image_labeling
sha256: "2cac5f7a02dcc23cd3357f89bf1a79df793ae3afce5035a896de467ffa0192e8"
url: "https://pub.dev"
source: hosted
version: "0.14.1"
google_mlkit_language_id:
dependency: transitive
description:
name: google_mlkit_language_id
sha256: fc57bca69cb1dcd8ef67b929f0315e9a8baa80c03c75f7a1226becd7ad2529ff
url: "https://pub.dev"
source: hosted
version: "0.13.0"
google_mlkit_object_detection:
dependency: transitive
description:
name: google_mlkit_object_detection
sha256: "0f740f046d74faf81d9c44cdbe4accf33888ed9f877e30efbfad4578d45ebfcd"
url: "https://pub.dev"
source: hosted
version: "0.15.0"
google_mlkit_pose_detection:
dependency: transitive
description:
name: google_mlkit_pose_detection
sha256: "5ff5fe2a325427c49c02a884a2a888d2d10cbfe414f7ebf2af9777a5155171eb"
url: "https://pub.dev"
source: hosted
version: "0.14.0"
google_mlkit_selfie_segmentation:
dependency: transitive
description:
name: google_mlkit_selfie_segmentation
sha256: e05fc255265595a0fb11cd6a6a5393f106d6ec4d3a40cbc57ff22894eef235f1
url: "https://pub.dev"
source: hosted
version: "0.10.0"
google_mlkit_smart_reply:
dependency: transitive
description:
name: google_mlkit_smart_reply
sha256: "0c3d737e46f20aa4d4953860ee5757e5250e58f90351f8e2afdeb1d609c7047e"
url: "https://pub.dev"
source: hosted
version: "0.13.0"
google_mlkit_text_recognition: google_mlkit_text_recognition:
dependency: transitive dependency: "direct main"
description: description:
name: google_mlkit_text_recognition name: google_mlkit_text_recognition
sha256: "96173ad4dd7fd06c660e22ac3f9e9f1798a517fe7e48bee68eeec83853224224" sha256: "96173ad4dd7fd06c660e22ac3f9e9f1798a517fe7e48bee68eeec83853224224"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.15.0" version: "0.15.0"
google_mlkit_translation:
dependency: transitive
description:
name: google_mlkit_translation
sha256: "7287444a0abd994087a0b354dee952fcd198e57619ded4bba65496d418c9d84b"
url: "https://pub.dev"
source: hosted
version: "0.13.0"
http: http:
dependency: "direct main" dependency: "direct main"
description: description:
@ -488,6 +432,70 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.5.4" version: "4.5.4"
image_picker:
dependency: "direct main"
description:
name: image_picker
sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a"
url: "https://pub.dev"
source: hosted
version: "1.1.2"
image_picker_android:
dependency: transitive
description:
name: image_picker_android
sha256: "317a5d961cec5b34e777b9252393f2afbd23084aa6e60fcf601dcf6341b9ebeb"
url: "https://pub.dev"
source: hosted
version: "0.8.12+23"
image_picker_for_web:
dependency: transitive
description:
name: image_picker_for_web
sha256: "717eb042ab08c40767684327be06a5d8dbb341fe791d514e4b92c7bbe1b7bb83"
url: "https://pub.dev"
source: hosted
version: "3.0.6"
image_picker_ios:
dependency: transitive
description:
name: image_picker_ios
sha256: "05da758e67bc7839e886b3959848aa6b44ff123ab4b28f67891008afe8ef9100"
url: "https://pub.dev"
source: hosted
version: "0.8.12+2"
image_picker_linux:
dependency: transitive
description:
name: image_picker_linux
sha256: "34a65f6740df08bbbeb0a1abd8e6d32107941fd4868f67a507b25601651022c9"
url: "https://pub.dev"
source: hosted
version: "0.2.1+2"
image_picker_macos:
dependency: transitive
description:
name: image_picker_macos
sha256: "1b90ebbd9dcf98fb6c1d01427e49a55bd96b5d67b8c67cf955d60a5de74207c1"
url: "https://pub.dev"
source: hosted
version: "0.2.1+2"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
sha256: "886d57f0be73c4b140004e78b9f28a8914a09e50c2d816bdd0520051a71236a0"
url: "https://pub.dev"
source: hosted
version: "2.10.1"
image_picker_windows:
dependency: transitive
description:
name: image_picker_windows
sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb"
url: "https://pub.dev"
source: hosted
version: "0.2.1+1"
intl: intl:
dependency: "direct main" dependency: "direct main"
description: description:
@ -592,6 +600,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.16.0" version: "1.16.0"
mime:
dependency: transitive
description:
name: mime
sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
nested: nested:
dependency: transitive dependency: transitive
description: description:

View File

@ -27,10 +27,11 @@ dependencies:
get_it: ^8.0.3 get_it: ^8.0.3
go_router: ^15.1.1 go_router: ^15.1.1
google_fonts: ^6.0.0 google_fonts: ^6.0.0
google_ml_kit: ^0.20.0 google_mlkit_text_recognition: ^0.15.0
http: ^1.3.0 http: ^1.3.0
http_parser: ^4.1.2 http_parser: ^4.1.2
iconsax_flutter: ^1.0.0 iconsax_flutter: ^1.0.0
image_picker: ^1.1.2
intl: ^0.20.2 intl: ^0.20.2
jwt_decoder: ^2.0.1 jwt_decoder: ^2.0.1
localstorage: ^6.0.0 localstorage: ^6.0.0

View File

@ -7,11 +7,14 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <connectivity_plus/connectivity_plus_windows_plugin.h> #include <connectivity_plus/connectivity_plus_windows_plugin.h>
#include <file_selector_windows/file_selector_windows.h>
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h> #include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
ConnectivityPlusWindowsPluginRegisterWithRegistrar( ConnectivityPlusWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
FlutterSecureStorageWindowsPluginRegisterWithRegistrar( FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
} }

View File

@ -4,6 +4,7 @@
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
connectivity_plus connectivity_plus
file_selector_windows
flutter_secure_storage_windows flutter_secure_storage_windows
) )