Compare commits
6 Commits
e4ad29f845
...
ca30dcdc13
Author | SHA1 | Date |
---|---|---|
|
ca30dcdc13 | |
|
0e5d771da7 | |
|
fa9f837930 | |
|
34c5bbc291 | |
|
5ffd3c9d7d | |
|
72f7b3f051 |
|
@ -3,6 +3,14 @@
|
||||||
// Generated file. Do not edit.
|
// Generated file. Do not edit.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// @dart = 2.13
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
|
|
||||||
void registerPlugins() {}
|
import 'package:file_picker/_internal/file_picker_web.dart';
|
||||||
|
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
|
||||||
|
|
||||||
|
void registerPlugins([final Registrar? pluginRegistrar]) {
|
||||||
|
final Registrar registrar = pluginRegistrar ?? webPluginRegistrar;
|
||||||
|
FilePickerWeb.registerWith(registrar);
|
||||||
|
registrar.registerMessageHandler();
|
||||||
|
}
|
||||||
|
|
|
@ -31,6 +31,12 @@
|
||||||
"packageUri": "lib/",
|
"packageUri": "lib/",
|
||||||
"languageVersion": "3.4"
|
"languageVersion": "3.4"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "cross_file",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/cross_file-0.3.4+2",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.3"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "cupertino_icons",
|
"name": "cupertino_icons",
|
||||||
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/cupertino_icons-1.0.8",
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/cupertino_icons-1.0.8",
|
||||||
|
@ -43,6 +49,18 @@
|
||||||
"packageUri": "lib/",
|
"packageUri": "lib/",
|
||||||
"languageVersion": "2.12"
|
"languageVersion": "2.12"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "ffi",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/ffi-2.1.3",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "file_picker",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/file_picker-8.3.1",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.4"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "flutter",
|
"name": "flutter",
|
||||||
"rootUri": "file:///C:/src/flutter/flutter/packages/flutter",
|
"rootUri": "file:///C:/src/flutter/flutter/packages/flutter",
|
||||||
|
@ -55,12 +73,24 @@
|
||||||
"packageUri": "lib/",
|
"packageUri": "lib/",
|
||||||
"languageVersion": "3.5"
|
"languageVersion": "3.5"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "flutter_plugin_android_lifecycle",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.24",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.5"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "flutter_test",
|
"name": "flutter_test",
|
||||||
"rootUri": "file:///C:/src/flutter/flutter/packages/flutter_test",
|
"rootUri": "file:///C:/src/flutter/flutter/packages/flutter_test",
|
||||||
"packageUri": "lib/",
|
"packageUri": "lib/",
|
||||||
"languageVersion": "3.3"
|
"languageVersion": "3.3"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "flutter_web_plugins",
|
||||||
|
"rootUri": "file:///C:/src/flutter/flutter/packages/flutter_web_plugins",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.2"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "get",
|
"name": "get",
|
||||||
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/get-4.6.6",
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/get-4.6.6",
|
||||||
|
@ -133,12 +163,60 @@
|
||||||
"packageUri": "lib/",
|
"packageUri": "lib/",
|
||||||
"languageVersion": "3.0"
|
"languageVersion": "3.0"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "path_provider",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider-2.1.5",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path_provider_android",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_android-2.2.15",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path_provider_foundation",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_foundation-2.4.1",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path_provider_linux",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_linux-2.2.1",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "2.19"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path_provider_platform_interface",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_platform_interface-2.1.2",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path_provider_windows",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_windows-2.3.0",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.2"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "pixel_snap",
|
"name": "pixel_snap",
|
||||||
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/pixel_snap-0.1.5",
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/pixel_snap-0.1.5",
|
||||||
"packageUri": "lib/",
|
"packageUri": "lib/",
|
||||||
"languageVersion": "3.0"
|
"languageVersion": "3.0"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "platform",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/platform-3.1.6",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "plugin_platform_interface",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/plugin_platform_interface-2.1.8",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.0"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "simple_gesture_detector",
|
"name": "simple_gesture_detector",
|
||||||
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/simple_gesture_detector-0.2.1",
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/simple_gesture_detector-0.2.1",
|
||||||
|
@ -247,6 +325,18 @@
|
||||||
"packageUri": "lib/",
|
"packageUri": "lib/",
|
||||||
"languageVersion": "3.4"
|
"languageVersion": "3.4"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "win32",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.10.1",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "xdg_directories",
|
||||||
|
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/xdg_directories-1.1.0",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.3"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "shayog",
|
"name": "shayog",
|
||||||
"rootUri": "../",
|
"rootUri": "../",
|
||||||
|
@ -254,7 +344,7 @@
|
||||||
"languageVersion": "3.6"
|
"languageVersion": "3.6"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"generated": "2025-02-05T08:21:07.654873Z",
|
"generated": "2025-02-05T20:46:55.606574Z",
|
||||||
"generator": "pub",
|
"generator": "pub",
|
||||||
"generatorVersion": "3.6.1",
|
"generatorVersion": "3.6.1",
|
||||||
"flutterRoot": "file:///C:/src/flutter/flutter",
|
"flutterRoot": "file:///C:/src/flutter/flutter",
|
||||||
|
|
|
@ -18,6 +18,10 @@ collection
|
||||||
3.4
|
3.4
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/collection-1.19.0/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/collection-1.19.0/
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/collection-1.19.0/lib/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/collection-1.19.0/lib/
|
||||||
|
cross_file
|
||||||
|
3.3
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/cross_file-0.3.4+2/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/cross_file-0.3.4+2/lib/
|
||||||
cupertino_icons
|
cupertino_icons
|
||||||
3.1
|
3.1
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/cupertino_icons-1.0.8/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/cupertino_icons-1.0.8/
|
||||||
|
@ -26,10 +30,22 @@ fake_async
|
||||||
2.12
|
2.12
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.1/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.1/
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.1/lib/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.1/lib/
|
||||||
|
ffi
|
||||||
|
3.3
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/ffi-2.1.3/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/ffi-2.1.3/lib/
|
||||||
|
file_picker
|
||||||
|
3.4
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/file_picker-8.3.1/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/file_picker-8.3.1/lib/
|
||||||
flutter_lints
|
flutter_lints
|
||||||
3.5
|
3.5
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_lints-5.0.0/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_lints-5.0.0/
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_lints-5.0.0/lib/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_lints-5.0.0/lib/
|
||||||
|
flutter_plugin_android_lifecycle
|
||||||
|
3.5
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.24/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.24/lib/
|
||||||
get
|
get
|
||||||
2.15
|
2.15
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/get-4.6.6/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/get-4.6.6/
|
||||||
|
@ -78,10 +94,42 @@ path
|
||||||
3.0
|
3.0
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path-1.9.0/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path-1.9.0/
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path-1.9.0/lib/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path-1.9.0/lib/
|
||||||
|
path_provider
|
||||||
|
3.4
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider-2.1.5/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider-2.1.5/lib/
|
||||||
|
path_provider_android
|
||||||
|
3.5
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_android-2.2.15/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_android-2.2.15/lib/
|
||||||
|
path_provider_foundation
|
||||||
|
3.3
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_foundation-2.4.1/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_foundation-2.4.1/lib/
|
||||||
|
path_provider_linux
|
||||||
|
2.19
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_linux-2.2.1/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_linux-2.2.1/lib/
|
||||||
|
path_provider_platform_interface
|
||||||
|
3.0
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_platform_interface-2.1.2/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_platform_interface-2.1.2/lib/
|
||||||
|
path_provider_windows
|
||||||
|
3.2
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_windows-2.3.0/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_windows-2.3.0/lib/
|
||||||
pixel_snap
|
pixel_snap
|
||||||
3.0
|
3.0
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/pixel_snap-0.1.5/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/pixel_snap-0.1.5/
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/pixel_snap-0.1.5/lib/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/pixel_snap-0.1.5/lib/
|
||||||
|
platform
|
||||||
|
3.2
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/platform-3.1.6/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/platform-3.1.6/lib/
|
||||||
|
plugin_platform_interface
|
||||||
|
3.0
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/plugin_platform_interface-2.1.8/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/plugin_platform_interface-2.1.8/lib/
|
||||||
simple_gesture_detector
|
simple_gesture_detector
|
||||||
2.12
|
2.12
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/simple_gesture_detector-0.2.1/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/simple_gesture_detector-0.2.1/
|
||||||
|
@ -150,6 +198,14 @@ web
|
||||||
3.4
|
3.4
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/web-1.1.0/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/web-1.1.0/
|
||||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/web-1.1.0/lib/
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/web-1.1.0/lib/
|
||||||
|
win32
|
||||||
|
3.5
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.10.1/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.10.1/lib/
|
||||||
|
xdg_directories
|
||||||
|
3.3
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/xdg_directories-1.1.0/
|
||||||
|
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/xdg_directories-1.1.0/lib/
|
||||||
shayog
|
shayog
|
||||||
3.6
|
3.6
|
||||||
file:///C:/Users/Admin/Downloads/shayog/
|
file:///C:/Users/Admin/Downloads/shayog/
|
||||||
|
@ -166,4 +222,8 @@ flutter_test
|
||||||
3.3
|
3.3
|
||||||
file:///C:/src/flutter/flutter/packages/flutter_test/
|
file:///C:/src/flutter/flutter/packages/flutter_test/
|
||||||
file:///C:/src/flutter/flutter/packages/flutter_test/lib/
|
file:///C:/src/flutter/flutter/packages/flutter_test/lib/
|
||||||
|
flutter_web_plugins
|
||||||
|
3.2
|
||||||
|
file:///C:/src/flutter/flutter/packages/flutter_web_plugins/
|
||||||
|
file:///C:/src/flutter/flutter/packages/flutter_web_plugins/lib/
|
||||||
2
|
2
|
||||||
|
|
|
@ -15,5 +15,15 @@ import io.flutter.embedding.engine.FlutterEngine;
|
||||||
public final class GeneratedPluginRegistrant {
|
public final class GeneratedPluginRegistrant {
|
||||||
private static final String TAG = "GeneratedPluginRegistrant";
|
private static final String TAG = "GeneratedPluginRegistrant";
|
||||||
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
|
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
|
||||||
|
try {
|
||||||
|
flutterEngine.getPlugins().add(new com.mr.flutter.plugin.filepicker.FilePickerPlugin());
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "Error registering plugin file_picker, com.mr.flutter.plugin.filepicker.FilePickerPlugin", e);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
flutterEngine.getPlugins().add(new io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin());
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "Error registering plugin flutter_plugin_android_lifecycle, io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 368 KiB |
|
@ -6,9 +6,16 @@
|
||||||
|
|
||||||
#import "GeneratedPluginRegistrant.h"
|
#import "GeneratedPluginRegistrant.h"
|
||||||
|
|
||||||
|
#if __has_include(<file_picker/FilePickerPlugin.h>)
|
||||||
|
#import <file_picker/FilePickerPlugin.h>
|
||||||
|
#else
|
||||||
|
@import file_picker;
|
||||||
|
#endif
|
||||||
|
|
||||||
@implementation GeneratedPluginRegistrant
|
@implementation GeneratedPluginRegistrant
|
||||||
|
|
||||||
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
|
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
|
||||||
|
[FilePickerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FilePickerPlugin"]];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -35,7 +35,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColors.black,
|
color: AppColors.black,
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/images/login_bg.png"),
|
image: AssetImage("assets/images/back_img.png"),
|
||||||
|
//image: AssetImage("assets/images/login_bg.png"),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
)),
|
)),
|
||||||
child: Center(
|
child: Center(
|
||||||
|
|
|
@ -2,6 +2,8 @@ import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../../../../../components/common/common_model.dart';
|
import '../../../../../../components/common/common_model.dart';
|
||||||
import '../../../../../../components/styles/app_strings.dart';
|
import '../../../../../../components/styles/app_strings.dart';
|
||||||
|
import '../../../../../../services/network/post_request.dart';
|
||||||
|
import '../../model/get_invoice_response.dart';
|
||||||
|
|
||||||
class InvoiceManagementController extends GetxController{
|
class InvoiceManagementController extends GetxController{
|
||||||
var selectedState = 0.obs;
|
var selectedState = 0.obs;
|
||||||
|
@ -10,36 +12,52 @@ class InvoiceManagementController extends GetxController{
|
||||||
CommonModel(title: AppStrings.viewInvoice),
|
CommonModel(title: AppStrings.viewInvoice),
|
||||||
CommonModel(title: AppStrings.cancelledInvoice),
|
CommonModel(title: AppStrings.cancelledInvoice),
|
||||||
CommonModel(title: AppStrings.ccnView),
|
CommonModel(title: AppStrings.ccnView),
|
||||||
].obs;
|
].obs;// Default value
|
||||||
var selectedInvoice = '41896424644'.obs; // Default value
|
var invoiceViewLoader = false.obs;
|
||||||
var selectedFreightNo = '9841651635426'.obs; // Default value
|
var getInvoiceData = <GetInvoiceContent>[].obs;
|
||||||
|
RxInt totalPages = 3.obs;
|
||||||
|
RxInt totalElements = 3.obs;
|
||||||
|
var pageSize = 2.obs;
|
||||||
|
var sortField = "grn_date".obs;
|
||||||
|
var sortDirection = "desc".obs;
|
||||||
void toggleContainer() {
|
void toggleContainer() {
|
||||||
isSelected.value = true;
|
isSelected.value = true;
|
||||||
print("isSelected.value..${isSelected.value}");
|
print("isSelected.value..${isSelected.value}");
|
||||||
}
|
}
|
||||||
var invoiceNoItems = ['41896424644', '41896424644',
|
getInvoiceView() async {
|
||||||
'41896424644', '41896424644','41896424644'].obs;
|
try {
|
||||||
var freightBillNoItems = ['9841651635426','9841651635426','9841651635426','9841651635426','9841651635426'];
|
invoiceViewLoader.value = true;
|
||||||
// var items = ['Admin', 'Sub Admin',
|
|
||||||
// 'Internal Audit', 'Raw material','MIS User'].obs;
|
Map<String, String> requestBody = {
|
||||||
// var status = ['STO','In-Bound'];
|
"invoice_id":"",
|
||||||
// RxList tabs = <CommonModel>[
|
"freightBillNo":"",
|
||||||
// CommonModel(
|
"invFromDate":"",
|
||||||
// title: "User\nManagement",
|
"invToDate":"",
|
||||||
// image: AppImages.userMgmt,
|
"freightFromDate":"",
|
||||||
// selectionImg: AppImages.userMgmtBlue),
|
"freightToDate":""
|
||||||
// CommonModel(
|
};
|
||||||
// title: "Configuration\nManagement",
|
|
||||||
// image: AppImages.configuration,
|
var response = await PostRequests.getInvoice(requestBody);
|
||||||
// selectionImg: AppImages.configurationBlue),
|
if (response != null) {
|
||||||
// CommonModel(
|
List<GetInvoiceContent> flattenedContent =
|
||||||
// title: "Masters",
|
response.content!.expand((list) => list).toList();
|
||||||
// image: AppImages.masters,
|
getInvoiceData.assignAll(flattenedContent);
|
||||||
// selectionImg: AppImages.mastersBlue),
|
// print("response from${getInvoiceData[0].freightbillCode.runtimeType} view freight bill ${freightBillData[0].plantCode.runtimeType} and ${freightBillData[0].materialCode.runtimeType} and}");
|
||||||
// CommonModel(
|
totalPages.value = response.totalPages ?? 0;
|
||||||
// title: "Freight Bill & \n Invoice",
|
totalElements.value = response.totalElements ?? 0;
|
||||||
// image: AppImages.bills,
|
}
|
||||||
// selectionImg: AppImages.billsBlue),
|
} finally {
|
||||||
// ].obs;
|
invoiceViewLoader.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void changeSort(String field) {
|
||||||
|
if (field == sortField.value) {
|
||||||
|
sortDirection.value = sortDirection.value == "asc" ? "desc" : "asc";
|
||||||
|
} else {
|
||||||
|
sortField.value = field;
|
||||||
|
sortDirection.value = "desc";
|
||||||
|
}
|
||||||
|
// viewFreightView(page: 0);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -17,11 +17,20 @@ import '../../view_model/transport_controller.dart';
|
||||||
import '../../widgets/common_card.dart';
|
import '../../widgets/common_card.dart';
|
||||||
import '../../widgets/freightbill_dialog.dart';
|
import '../../widgets/freightbill_dialog.dart';
|
||||||
|
|
||||||
class GenerateFrightBill extends StatelessWidget {
|
class GenerateFrightBill extends StatefulWidget {
|
||||||
GenerateFrightBill({super.key});
|
GenerateFrightBill({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<GenerateFrightBill> createState() => _GenerateFrightBillState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
||||||
final controller = Get.put(TransportController());
|
final controller = Get.put(TransportController());
|
||||||
|
|
||||||
|
final TextEditingController _dateController = TextEditingController();
|
||||||
|
DateTime? _startDate;
|
||||||
|
DateTime? _endDate;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
|
@ -158,7 +167,7 @@ class GenerateFrightBill extends StatelessWidget {
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
top: 16.0, left: 0, right: 8),
|
top: 0.0, left: 0, right: 8),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
|
@ -173,29 +182,9 @@ class GenerateFrightBill extends StatelessWidget {
|
||||||
height: 35,
|
height: 35,
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
key: controller.fromTextFieldKey,
|
key: controller.fromTextFieldKey,
|
||||||
controller: controller.fromController,
|
controller: _dateController,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final pickedDate =
|
await _showDateRangePicker(context);
|
||||||
await showWebDatePicker(
|
|
||||||
width: 20.w,
|
|
||||||
context: controller
|
|
||||||
.fromTextFieldKey
|
|
||||||
.currentContext!,
|
|
||||||
initialDate:
|
|
||||||
controller.fromSelectedDate,
|
|
||||||
firstDate: DateTime(2000),
|
|
||||||
lastDate: DateTime.now(),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (pickedDate != null) {
|
|
||||||
controller.fromSelectedDate =
|
|
||||||
pickedDate;
|
|
||||||
String formattedDate = controller
|
|
||||||
.getFormattedDate(pickedDate);
|
|
||||||
controller.fromController.text =
|
|
||||||
formattedDate;
|
|
||||||
controller.dateCheck.value = true;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: AppColors.clrD9,
|
fillColor: AppColors.clrD9,
|
||||||
|
@ -531,7 +520,7 @@ class GenerateFrightBill extends StatelessWidget {
|
||||||
index, stoppage.materialCode ?? ""),
|
index, stoppage.materialCode ?? ""),
|
||||||
editableCell(
|
editableCell(
|
||||||
index,
|
index,
|
||||||
DateFormat('yyyy-MM-dd').format(
|
DateFormat('dd/MM/yyyy').format(
|
||||||
stoppage.grnDate ??
|
stoppage.grnDate ??
|
||||||
DateTime.now())),
|
DateTime.now())),
|
||||||
editableCell(
|
editableCell(
|
||||||
|
@ -541,7 +530,7 @@ class GenerateFrightBill extends StatelessWidget {
|
||||||
editableCell(index, stoppage.lrNo ?? ""),
|
editableCell(index, stoppage.lrNo ?? ""),
|
||||||
editableCell(
|
editableCell(
|
||||||
index,
|
index,
|
||||||
DateFormat('yyyy-MM-dd').format(
|
DateFormat('dd/MM/yyyy').format(
|
||||||
stoppage.lrDate ??
|
stoppage.lrDate ??
|
||||||
DateTime.now())),
|
DateTime.now())),
|
||||||
editableCell(index,
|
editableCell(index,
|
||||||
|
@ -577,58 +566,81 @@ class GenerateFrightBill extends StatelessWidget {
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _showDateRangePicker(BuildContext context) async {
|
Future<void> _showDateRangePicker(BuildContext context) async {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return Container(
|
return SingleChildScrollView(
|
||||||
padding: EdgeInsets.all(16),
|
child: Container(
|
||||||
height: 400, // Adjust the height as needed
|
padding: EdgeInsets.all(16),
|
||||||
child: Column(
|
height: 500, // Adjust the height as needed
|
||||||
children: [
|
child: Column(
|
||||||
// Display two date pickers horizontally
|
children: [
|
||||||
Row(
|
// Display two date pickers horizontally
|
||||||
children: [
|
Row(
|
||||||
// First Date Picker
|
children: [
|
||||||
Expanded(
|
// First Date Picker
|
||||||
child: SfDateRangePicker(
|
Expanded(
|
||||||
view: DateRangePickerView.month,
|
child: SfDateRangePicker(
|
||||||
selectionMode: DateRangePickerSelectionMode.range,
|
view: DateRangePickerView.month,
|
||||||
onSelectionChanged: (args) {
|
selectionMode: DateRangePickerSelectionMode.range,
|
||||||
// Handle the date selection from the first calendar
|
onSelectionChanged: (args) {
|
||||||
print(args.value);
|
// Handle the date selection from the first calendar
|
||||||
},
|
if (args.value is PickerDateRange) {
|
||||||
|
setState(() {
|
||||||
|
_startDate = args.value.startDate;
|
||||||
|
_endDate = args.value.endDate;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
SizedBox(width: 16),
|
||||||
SizedBox(width: 16),
|
// Second Date Picker
|
||||||
// Second Date Picker
|
Expanded(
|
||||||
Expanded(
|
child: SfDateRangePicker(
|
||||||
child: SfDateRangePicker(
|
view: DateRangePickerView.month,
|
||||||
view: DateRangePickerView.month,
|
selectionMode: DateRangePickerSelectionMode.range,
|
||||||
selectionMode: DateRangePickerSelectionMode.range,
|
onSelectionChanged: (args) {
|
||||||
onSelectionChanged: (args) {
|
// Handle the date selection from the first calendar
|
||||||
// Handle the date selection from the second calendar
|
if (args.value is PickerDateRange) {
|
||||||
print(args.value);
|
setState(() {
|
||||||
},
|
_startDate = args.value.startDate;
|
||||||
|
_endDate = args.value.endDate;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
SizedBox(height: 16),
|
||||||
SizedBox(height: 16),
|
ElevatedButton(
|
||||||
ElevatedButton(
|
onPressed: () {
|
||||||
onPressed: () {
|
if (_startDate != null && _endDate != null) {
|
||||||
// You can extract the selected date range here
|
String formattedRange =
|
||||||
// Close the bottom sheet after selection
|
"${_formatDate(_startDate!)} - ${_formatDate(_endDate!)}";
|
||||||
Navigator.pop(context);
|
_dateController.text = formattedRange;
|
||||||
},
|
}
|
||||||
child: Text('Done'),
|
// You can extract the selected date range here
|
||||||
),
|
// Close the bottom sheet after selection
|
||||||
],
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Text('Done'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _formatDate(DateTime date) {
|
||||||
|
// Format the date as per your requirement
|
||||||
|
return "${date.month.toString().padLeft(2, '0')}/${date.day.toString().padLeft(2, '0')}/${date.year}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
import '../../../../../../components/common/common_btn.dart';
|
import '../../../../../../components/common/common_btn.dart';
|
||||||
|
import '../../../../../../components/common/data_cell.dart';
|
||||||
import '../../../../../../components/common/input_field.dart';
|
import '../../../../../../components/common/input_field.dart';
|
||||||
import '../../../../../../components/styles/app_colors.dart';
|
import '../../../../../../components/styles/app_colors.dart';
|
||||||
import '../../../../../../components/styles/app_images.dart';
|
import '../../../../../../components/styles/app_images.dart';
|
||||||
import '../../../../../../components/styles/app_strings.dart';
|
import '../../../../../../components/styles/app_strings.dart';
|
||||||
import '../ctrl/invoice_management_controller.dart';
|
import '../ctrl/invoice_management_controller.dart';
|
||||||
|
import 'package:file_picker/file_picker.dart';
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
|
||||||
class InvoiceManagement extends StatefulWidget {
|
class InvoiceManagement extends StatefulWidget {
|
||||||
const InvoiceManagement({super.key});
|
const InvoiceManagement({super.key});
|
||||||
|
@ -18,6 +22,8 @@ class InvoiceManagement extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _TransportViewState extends State<InvoiceManagement> {
|
class _TransportViewState extends State<InvoiceManagement> {
|
||||||
|
final ScrollController horizontalScrollController = ScrollController();
|
||||||
|
final ScrollController verticalScrollController = ScrollController();
|
||||||
final ctrl = Get.put(InvoiceManagementController());
|
final ctrl = Get.put(InvoiceManagementController());
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -50,10 +56,10 @@ class _TransportViewState extends State<InvoiceManagement> {
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(
|
bottom: BorderSide(
|
||||||
color:
|
color: ctrl.selectedState.value ==
|
||||||
ctrl.selectedState.value == index
|
index
|
||||||
? Colors.white
|
? Colors.white
|
||||||
: AppColors.primaryClr,
|
: AppColors.primaryClr,
|
||||||
width: 3))),
|
width: 3))),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -234,7 +240,7 @@ class _TransportViewState extends State<InvoiceManagement> {
|
||||||
// newValue; // Update the selected value
|
// newValue; // Update the selected value
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
// items: ctrl.freightBillNoItems
|
// items: ctrl.getInvoiceNoItems
|
||||||
// .map((String value) {
|
// .map((String value) {
|
||||||
// return DropdownMenuItem<String>(
|
// return DropdownMenuItem<String>(
|
||||||
// value: value.toString(),
|
// value: value.toString(),
|
||||||
|
@ -289,7 +295,6 @@ class _TransportViewState extends State<InvoiceManagement> {
|
||||||
SizedBox(width: 16),
|
SizedBox(width: 16),
|
||||||
CommonBtn(
|
CommonBtn(
|
||||||
text: AppStrings.submit,
|
text: AppStrings.submit,
|
||||||
|
|
||||||
clickAction: () {},
|
clickAction: () {},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -317,147 +322,204 @@ class _TransportViewState extends State<InvoiceManagement> {
|
||||||
}
|
}
|
||||||
|
|
||||||
_tableView() {
|
_tableView() {
|
||||||
return Padding(
|
return Column(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
children: [
|
||||||
child:
|
Scrollbar(
|
||||||
Table(border: TableBorder.all(color: AppColors.clrGrey), children: [
|
thumbVisibility: true,
|
||||||
TableRow(
|
controller: verticalScrollController,
|
||||||
decoration: BoxDecoration(color: AppColors.secondaryClr),
|
child: SingleChildScrollView(
|
||||||
children: [
|
controller: verticalScrollController,
|
||||||
_cellText(
|
child: Scrollbar(
|
||||||
text: "SR. No.",
|
thumbVisibility: true,
|
||||||
clr: Colors.black,
|
controller: horizontalScrollController,
|
||||||
fontWeight: FontWeight.bold),
|
child: SingleChildScrollView(
|
||||||
_cellText(
|
scrollDirection: Axis.horizontal,
|
||||||
text: "Reference No.",
|
controller: horizontalScrollController,
|
||||||
clr: Colors.black,
|
child: Container(
|
||||||
fontWeight: FontWeight.bold),
|
decoration: BoxDecoration(
|
||||||
_cellText(
|
border: Border.all(
|
||||||
text: "Freight Bill No.",
|
color: Colors.grey.shade400,
|
||||||
clr: Colors.black,
|
width: 1.0,
|
||||||
fontWeight: FontWeight.bold),
|
),
|
||||||
_cellText(
|
),
|
||||||
text: "Freight Bill Date",
|
child: DataTable(
|
||||||
clr: Colors.black,
|
dataRowHeight: 40,
|
||||||
fontWeight: FontWeight.bold),
|
headingRowHeight: 40,
|
||||||
_cellText(
|
headingRowColor: WidgetStateProperty.all(AppColors.clrF2),
|
||||||
text: "Invoice No.",
|
border: TableBorder(
|
||||||
clr: Colors.black,
|
horizontalInside: BorderSide(color: AppColors.clrGrey),
|
||||||
fontWeight: FontWeight.bold),
|
verticalInside: BorderSide(color: AppColors.clrGrey),
|
||||||
_cellText(
|
bottom: BorderSide(color: AppColors.clrGrey),
|
||||||
text: "Invoice Date",
|
left: BorderSide(color: AppColors.clrGrey),
|
||||||
clr: Colors.black,
|
right: BorderSide(color: AppColors.clrGrey),
|
||||||
fontWeight: FontWeight.bold),
|
top: BorderSide(color: AppColors.clrGrey),
|
||||||
_cellText(
|
),
|
||||||
text: "Invoice Amount",
|
columns: [
|
||||||
clr: Colors.black,
|
dataColumn("Refrence No."),
|
||||||
fontWeight: FontWeight.bold),
|
//dataColumn(AppStrings.productName, onSort: (_, __) => ctrl.changeSort(AppStrings.productName.toLowerCase())),
|
||||||
_cellText(
|
dataColumn("Freight Bill No."),
|
||||||
text: "CCN Amount",
|
//dataColumn(AppStrings.getInvoiceDate),
|
||||||
clr: Colors.black,
|
dataColumn("Freight Bill date"),
|
||||||
fontWeight: FontWeight.bold),
|
dataColumn("Invoice No."),
|
||||||
_cellText(
|
dataColumn("Invoice Date"),
|
||||||
text: "View CCN",
|
dataColumn("Invoice Amount"),
|
||||||
clr: Colors.black,
|
dataColumn("CCN Amount"),
|
||||||
fontWeight: FontWeight.bold),
|
dataColumn("View CCN"),
|
||||||
_cellText(
|
dataColumn("Product Type"),
|
||||||
text: "Product Type",
|
dataColumn("View Invoice"),
|
||||||
clr: Colors.black,
|
dataColumn("Add Signature"),
|
||||||
fontWeight: FontWeight.bold),
|
],
|
||||||
_cellText(
|
rows: List<DataRow>.generate(ctrl.getInvoiceData.length,
|
||||||
text: "View Invoice",
|
(index) {
|
||||||
clr: Colors.black,
|
final getInvoice = ctrl.getInvoiceData[index];
|
||||||
fontWeight: FontWeight.bold),
|
return DataRow(
|
||||||
// _cellText(
|
cells: [
|
||||||
// text: "Add Signature",
|
editableCell(index, "${getInvoice.invoiceId}"),
|
||||||
// clr: Colors.black,
|
editableCell(index, getInvoice.freightbillCode),
|
||||||
// fontWeight: FontWeight.bold),
|
editableCell(
|
||||||
]),
|
index,
|
||||||
TableRow(children: [
|
DateFormat("dd MMMM yyyy").format(
|
||||||
_cellText(
|
DateTime.parse('${getInvoice.createdOn}'))),
|
||||||
text: "01",
|
editableCell(
|
||||||
|
index, "${getInvoice.sapReferenceno ?? "-"}"),
|
||||||
|
editableCell(
|
||||||
|
index,
|
||||||
|
DateFormat("d MMMM yyyy").format(DateTime.parse(
|
||||||
|
'${getInvoice.shipmentCostDate}'))),
|
||||||
|
editableCell(
|
||||||
|
index, "${getInvoice.shipmentCost ?? "-"}"),
|
||||||
|
editableCell(index, "-"),
|
||||||
|
editableCell(index, "-"),
|
||||||
|
editableCell(index, "-", isLink: true),
|
||||||
|
editableCell(index, "-"),
|
||||||
|
editableCell(index, "-", isLink: true),
|
||||||
|
DataCell(
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: Colors.blue),
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () { },
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(Icons.download,
|
||||||
|
size: 16, color: Colors.blue),
|
||||||
|
SizedBox(width: 4),
|
||||||
|
Text('Download',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.blue,
|
||||||
|
fontSize: 12)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 8),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: Colors.blue),
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => handleFileUpload(index),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(Icons.upload,
|
||||||
|
size: 16, color: Colors.blue),
|
||||||
|
SizedBox(width: 4),
|
||||||
|
Text('Upload',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.blue,
|
||||||
|
fontSize: 12)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
//###################### This Function is used to close or cut uploaded File in Local #######################
|
||||||
|
// if (uploadedFiles.containsKey(index))
|
||||||
|
// IconButton(
|
||||||
|
// icon: Icon(Icons.close, size: 16, color: Colors.red),
|
||||||
|
// onPressed: () {
|
||||||
|
// setState(() {
|
||||||
|
// uploadedFiles.remove(index);
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
|
||||||
|
//###########################################################################################################
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
_cellText(text: "7894651231"),
|
),
|
||||||
_cellText(text: "9841651635426"),
|
// CustomPagination(
|
||||||
_cellText(text: "1 August 2024"),
|
// currentPage: controller.currentPage.value,
|
||||||
_cellText(text: "41918542634"),
|
// totalPages: controller.totalPages.value,
|
||||||
_cellText(text: "5 Aug 2024"),
|
// onPageChanged: (int page) {
|
||||||
_cellText(text: "XXXXXXXX"),
|
// controller.onPageChanged(page);
|
||||||
_cellText(text: "XXXXXXXX"),
|
// },
|
||||||
_cellText(text: "78646646", clr: AppColors.primaryClr),
|
// ),
|
||||||
_cellText(text: "Z-FUL"),
|
],
|
||||||
_cellText(text: "View Invoice", clr: AppColors.primaryClr),
|
|
||||||
]),
|
|
||||||
TableRow(children: [
|
|
||||||
_cellText(text: "02"),
|
|
||||||
_cellText(text: "7894651231"),
|
|
||||||
_cellText(text: "9841651635426"),
|
|
||||||
_cellText(text: "1 August 2024"),
|
|
||||||
_cellText(text: "41918542634"),
|
|
||||||
_cellText(text: "5 Aug 2024"),
|
|
||||||
_cellText(text: "XXXXXXXX"),
|
|
||||||
_cellText(text: "-"),
|
|
||||||
_cellText(text: "78646646", clr: AppColors.primaryClr),
|
|
||||||
_cellText(text: "Z-FUL"),
|
|
||||||
_cellText(text: "View Invoice", clr: AppColors.primaryClr),
|
|
||||||
]),
|
|
||||||
TableRow(children: [
|
|
||||||
_cellText(text: "03"),
|
|
||||||
_cellText(text: "7894651231"),
|
|
||||||
_cellText(text: "9841651635426"),
|
|
||||||
_cellText(text: "1 August 2024"),
|
|
||||||
_cellText(text: "41918542634"),
|
|
||||||
_cellText(text: "5 Aug 2024"),
|
|
||||||
_cellText(text: "XXXXXXXX"),
|
|
||||||
_cellText(text: "-"),
|
|
||||||
_cellText(text: "-", clr: AppColors.primaryClr),
|
|
||||||
_cellText(text: "Z-FUL"),
|
|
||||||
_cellText(text: "View Invoice", clr: AppColors.primaryClr),
|
|
||||||
]),
|
|
||||||
TableRow(children: [
|
|
||||||
_cellText(text: "04"),
|
|
||||||
_cellText(text: "7894651231"),
|
|
||||||
_cellText(text: "9841651635426"),
|
|
||||||
_cellText(text: "1 August 2024"),
|
|
||||||
_cellText(text: "41918542634"),
|
|
||||||
_cellText(text: "5 Aug 2024"),
|
|
||||||
_cellText(text: "XXXXXXXX"),
|
|
||||||
_cellText(text: "XXXXXXXX"),
|
|
||||||
_cellText(text: "78646646", clr: AppColors.primaryClr),
|
|
||||||
_cellText(text: "Z-FUL"),
|
|
||||||
_cellText(text: "View Invoice", clr: AppColors.primaryClr),
|
|
||||||
]),
|
|
||||||
TableRow(children: [
|
|
||||||
_cellText(text: "05"),
|
|
||||||
_cellText(text: "7894651231"),
|
|
||||||
_cellText(text: "9841651635426"),
|
|
||||||
_cellText(text: "1 August 2024"),
|
|
||||||
_cellText(text: "41918542634"),
|
|
||||||
_cellText(text: "5 Aug 2024"),
|
|
||||||
_cellText(text: "XXXXXXXX"),
|
|
||||||
_cellText(text: "-"),
|
|
||||||
_cellText(text: "-", clr: AppColors.primaryClr),
|
|
||||||
_cellText(text: "Z-FUL"),
|
|
||||||
_cellText(text: "View Invoice", clr: AppColors.primaryClr),
|
|
||||||
]),
|
|
||||||
]),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_cellText({String? text, Color? clr, FontWeight? fontWeight}) {
|
Future<void> handleFileUpload(int index) async {
|
||||||
return Center(
|
try {
|
||||||
child: Padding(
|
FilePickerResult? result = await FilePicker.platform.pickFiles(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 4),
|
type: FileType.custom,
|
||||||
child: Text(
|
allowedExtensions: ['pdf', 'doc', 'docx', 'xlsx', 'xls'],
|
||||||
text ?? '',
|
allowMultiple: false,
|
||||||
textAlign: TextAlign.center,
|
);
|
||||||
style: TextStyle(
|
|
||||||
color: clr ?? AppColors.darkGrey,
|
if (result != null) {
|
||||||
fontSize: 12,
|
PlatformFile file = result.files.first;
|
||||||
fontWeight: fontWeight ?? FontWeight.normal),
|
|
||||||
|
// Validate file size (optional)
|
||||||
|
if (file.size > 10 * 1024 * 1024) { // 10MB limit
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text('File size must be less than 10MB'),
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final appDir = await getApplicationDocumentsDirectory();
|
||||||
|
final String filePath = '${appDir.path}/${file.name}';
|
||||||
|
File(file.path!).copy(filePath);
|
||||||
|
setState(() {
|
||||||
|
//uploadedFiles[index] = file.name;
|
||||||
|
});
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text('File uploaded: ${file.name}'),
|
||||||
|
backgroundColor: Colors.green,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text('Error uploading file: ${e.toString()}'),
|
||||||
|
backgroundColor: Colors.red,
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_commonText(String title) {
|
_commonText(String title) {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import 'package:intl/intl.dart';
|
||||||
import 'package:shayog/components/styles/textStyles.dart';
|
import 'package:shayog/components/styles/textStyles.dart';
|
||||||
import 'package:shayog/feature/presentation/screens/transporter/view_model/transport_controller.dart';
|
import 'package:shayog/feature/presentation/screens/transporter/view_model/transport_controller.dart';
|
||||||
import 'package:sizer/sizer.dart';
|
import 'package:sizer/sizer.dart';
|
||||||
|
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
|
||||||
import 'package:vph_web_date_picker/vph_web_date_picker.dart';
|
import 'package:vph_web_date_picker/vph_web_date_picker.dart';
|
||||||
import '../../../../../../../components/common/data_cell.dart';
|
import '../../../../../../../components/common/data_cell.dart';
|
||||||
import '../../../../../../../components/styles/app_colors.dart';
|
import '../../../../../../../components/styles/app_colors.dart';
|
||||||
|
@ -15,12 +16,22 @@ import '../../../../widgets/text_view.dart';
|
||||||
import '../../widgets/common_card.dart';
|
import '../../widgets/common_card.dart';
|
||||||
import '../../widgets/freightbill_dialog.dart';
|
import '../../widgets/freightbill_dialog.dart';
|
||||||
|
|
||||||
class PendingGeneration extends StatelessWidget {
|
class PendingGeneration extends StatefulWidget {
|
||||||
PendingGeneration({super.key});
|
PendingGeneration({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<PendingGeneration> createState() => _PendingGenerationState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PendingGenerationState extends State<PendingGeneration> {
|
||||||
final ScrollController horizontalScrollController = ScrollController();
|
final ScrollController horizontalScrollController = ScrollController();
|
||||||
|
|
||||||
final ScrollController verticalScrollController = ScrollController();
|
final ScrollController verticalScrollController = ScrollController();
|
||||||
|
|
||||||
final controller = Get.put(TransportController());
|
final controller = Get.put(TransportController());
|
||||||
|
final TextEditingController _dateController = TextEditingController();
|
||||||
|
DateTime? _startDate;
|
||||||
|
DateTime? _endDate;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -47,7 +58,6 @@ class PendingGeneration extends StatelessWidget {
|
||||||
CustomDropdown(
|
CustomDropdown(
|
||||||
backClr: AppColors.clrD9,
|
backClr: AppColors.clrD9,
|
||||||
borderClr: AppColors.clrGrey,
|
borderClr: AppColors.clrGrey,
|
||||||
|
|
||||||
items: controller.plant,
|
items: controller.plant,
|
||||||
itemLabel: (item) =>
|
itemLabel: (item) =>
|
||||||
"${item.plantCode}-${item.plantDesc}",
|
"${item.plantCode}-${item.plantDesc}",
|
||||||
|
@ -63,10 +73,10 @@ class PendingGeneration extends StatelessWidget {
|
||||||
),
|
),
|
||||||
Obx(() => controller.showPlantErrorPending.value
|
Obx(() => controller.showPlantErrorPending.value
|
||||||
? Text(
|
? Text(
|
||||||
'Required',
|
'Required',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.red, fontSize: 12),
|
color: Colors.red, fontSize: 12),
|
||||||
)
|
)
|
||||||
: Text('')),
|
: Text('')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -100,14 +110,15 @@ class PendingGeneration extends StatelessWidget {
|
||||||
},
|
},
|
||||||
hintText: "Select Product Name",
|
hintText: "Select Product Name",
|
||||||
),
|
),
|
||||||
Obx(() => controller
|
Obx(() =>
|
||||||
.showProductErrorPending.value
|
controller.showProductErrorPending.value
|
||||||
? Text(
|
? Text(
|
||||||
'Required',
|
'Required',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.red, fontSize: 12),
|
color: Colors.red,
|
||||||
)
|
fontSize: 12),
|
||||||
: Text('')),
|
)
|
||||||
|
: Text('')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -135,14 +146,15 @@ class PendingGeneration extends StatelessWidget {
|
||||||
},
|
},
|
||||||
hintText: "Select Transaction Type",
|
hintText: "Select Transaction Type",
|
||||||
),
|
),
|
||||||
Obx(() => controller
|
Obx(() =>
|
||||||
.showTransactionErrorPending.value
|
controller.showTransactionErrorPending.value
|
||||||
? Text(
|
? Text(
|
||||||
'Required',
|
'Required',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.red, fontSize: 12),
|
color: Colors.red,
|
||||||
)
|
fontSize: 12),
|
||||||
: Text('')),
|
)
|
||||||
|
: Text('')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -159,45 +171,14 @@ class PendingGeneration extends StatelessWidget {
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
TextView(text: "MRN Date Range"),
|
TextView(text: "MRN Date Range"),
|
||||||
// SizedBox(height: 8),
|
|
||||||
// CustomDropdown<String>(
|
|
||||||
// borderClr: AppColors.clrGrey,
|
|
||||||
// items: controller.date,
|
|
||||||
// itemLabel: (item) => item,
|
|
||||||
// onSelected: (selected) {
|
|
||||||
// if (selected != null) {
|
|
||||||
// controller.selectPlant.value = selected;
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// hintText: "Select MRN Date Range",
|
|
||||||
// ),
|
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 8),
|
margin: EdgeInsets.only(top: 8),
|
||||||
height: 35,
|
height: 35,
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
key: controller.fromTextFieldKey,
|
key: controller.fromTextFieldKey,
|
||||||
controller: controller.fromController,
|
controller: _dateController,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final pickedDate =
|
await _showDateRangePicker(context);
|
||||||
await showWebDatePicker(
|
|
||||||
width: 20.w,
|
|
||||||
context: controller
|
|
||||||
.fromTextFieldKey.currentContext!,
|
|
||||||
initialDate:
|
|
||||||
controller.fromSelectedDate,
|
|
||||||
firstDate: DateTime(2000),
|
|
||||||
lastDate: DateTime.now(),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (pickedDate != null) {
|
|
||||||
controller.fromSelectedDate =
|
|
||||||
pickedDate;
|
|
||||||
String formattedDate = controller
|
|
||||||
.getFormattedDate(pickedDate);
|
|
||||||
controller.fromController.text =
|
|
||||||
formattedDate;
|
|
||||||
controller.dateCheck.value = true;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: AppColors.clrD9,
|
fillColor: AppColors.clrD9,
|
||||||
|
@ -296,7 +277,8 @@ class PendingGeneration extends StatelessWidget {
|
||||||
CommonBtn(
|
CommonBtn(
|
||||||
bkClr: Colors.white,
|
bkClr: Colors.white,
|
||||||
text: AppStrings.cancel,
|
text: AppStrings.cancel,
|
||||||
clickAction: () => controller.clearFiltersPendingGeneration(),
|
clickAction: () => controller
|
||||||
|
.clearFiltersPendingGeneration(),
|
||||||
),
|
),
|
||||||
SizedBox(width: 16),
|
SizedBox(width: 16),
|
||||||
CommonButton(
|
CommonButton(
|
||||||
|
@ -305,20 +287,19 @@ class PendingGeneration extends StatelessWidget {
|
||||||
width: 100,
|
width: 100,
|
||||||
text: AppStrings.submit,
|
text: AppStrings.submit,
|
||||||
clickAction: () =>
|
clickAction: () =>
|
||||||
// controller.validateFieldsPending();
|
// controller.validateFieldsPending();
|
||||||
// if (controller.showPlantErrorPending
|
// if (controller.showPlantErrorPending
|
||||||
// .value ||
|
// .value ||
|
||||||
// controller.showProductErrorPending
|
// controller.showProductErrorPending
|
||||||
// .value ||
|
// .value ||
|
||||||
// controller
|
// controller
|
||||||
// .showTransactionErrorPending
|
// .showTransactionErrorPending
|
||||||
// .value) {
|
// .value) {
|
||||||
// } else {
|
// } else {
|
||||||
// controller.postData();
|
// controller.postData();
|
||||||
// }
|
// }
|
||||||
controller
|
controller
|
||||||
.handleFilterSubmitPendingGeneration(),
|
.handleFilterSubmitPendingGeneration(),
|
||||||
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -338,7 +319,6 @@ class PendingGeneration extends StatelessWidget {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: MediaQuery.sizeOf(context).height,
|
height: MediaQuery.sizeOf(context).height,
|
||||||
width: MediaQuery.sizeOf(context).width,
|
width: MediaQuery.sizeOf(context).width,
|
||||||
|
|
||||||
child: Center(
|
child: Center(
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
color: AppColors.primaryClr,
|
color: AppColors.primaryClr,
|
||||||
|
@ -350,7 +330,6 @@ class PendingGeneration extends StatelessWidget {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: MediaQuery.sizeOf(context).height,
|
height: MediaQuery.sizeOf(context).height,
|
||||||
width: MediaQuery.sizeOf(context).width,
|
width: MediaQuery.sizeOf(context).width,
|
||||||
|
|
||||||
child: Center(child: Text(controller.errorMessage.value)));
|
child: Center(child: Text(controller.errorMessage.value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,13 +337,16 @@ class PendingGeneration extends StatelessWidget {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: MediaQuery.sizeOf(context).height,
|
height: MediaQuery.sizeOf(context).height,
|
||||||
width: MediaQuery.sizeOf(context).width,
|
width: MediaQuery.sizeOf(context).width,
|
||||||
|
child: Center(
|
||||||
child: Center(child: Text('No data available.',)));
|
child: Text(
|
||||||
|
'No data available.',
|
||||||
|
)));
|
||||||
}
|
}
|
||||||
return
|
return Column(
|
||||||
Column(
|
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 20,),
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
Scrollbar(
|
Scrollbar(
|
||||||
thumbVisibility: true,
|
thumbVisibility: true,
|
||||||
controller: controller.verticalScrollController,
|
controller: controller.verticalScrollController,
|
||||||
|
@ -415,6 +397,7 @@ class PendingGeneration extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// dataColumn(AppStrings.srNo),
|
// dataColumn(AppStrings.srNo),
|
||||||
|
dataColumn(AppStrings.viewGrnDetails),
|
||||||
dataColumn(AppStrings.plantName),
|
dataColumn(AppStrings.plantName),
|
||||||
dataColumn(AppStrings.productName),
|
dataColumn(AppStrings.productName),
|
||||||
dataColumn(AppStrings.date),
|
dataColumn(AppStrings.date),
|
||||||
|
@ -433,7 +416,8 @@ class PendingGeneration extends StatelessWidget {
|
||||||
rows: List<DataRow>.generate(
|
rows: List<DataRow>.generate(
|
||||||
controller.grnPendingData.length, (index) {
|
controller.grnPendingData.length, (index) {
|
||||||
final stoppage = controller.grnPendingData[index];
|
final stoppage = controller.grnPendingData[index];
|
||||||
|
print(
|
||||||
|
'stoppage.remark?.toString()${stoppage.remark?.toString()}');
|
||||||
return DataRow(
|
return DataRow(
|
||||||
selected: stoppage.isSelected,
|
selected: stoppage.isSelected,
|
||||||
cells: [
|
cells: [
|
||||||
|
@ -454,8 +438,10 @@ class PendingGeneration extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// editableCell(index, "0${index + 1}"),
|
// editableCell(index, "0${index + 1}"),
|
||||||
|
editableCell(index, stoppage.grnNo ?? ""),
|
||||||
editableCell(index, stoppage.plantCode ?? ""),
|
editableCell(index, stoppage.plantCode ?? ""),
|
||||||
editableCell(index, stoppage.plantCode ?? ""),
|
editableCell(
|
||||||
|
index, stoppage.materialCode ?? ""),
|
||||||
|
|
||||||
editableCell(
|
editableCell(
|
||||||
index,
|
index,
|
||||||
|
@ -482,7 +468,9 @@ class PendingGeneration extends StatelessWidget {
|
||||||
editableCell(index,
|
editableCell(index,
|
||||||
stoppage.shipmentCost?.toString() ?? ""),
|
stoppage.shipmentCost?.toString() ?? ""),
|
||||||
editableCell(
|
editableCell(
|
||||||
index, stoppage.remark?.toString() ?? ""),
|
index,
|
||||||
|
stoppage.remark?.toString() ??
|
||||||
|
"Shipment Quantity Mismatch"),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
@ -498,4 +486,79 @@ class PendingGeneration extends StatelessWidget {
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _showDateRangePicker(BuildContext context) async {
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(16),
|
||||||
|
height: 500, // Adjust the height as needed
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
// Display two date pickers horizontally
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
// First Date Picker
|
||||||
|
Expanded(
|
||||||
|
child: SfDateRangePicker(
|
||||||
|
view: DateRangePickerView.month,
|
||||||
|
selectionMode: DateRangePickerSelectionMode.range,
|
||||||
|
onSelectionChanged: (args) {
|
||||||
|
// Handle the date selection from the first calendar
|
||||||
|
if (args.value is PickerDateRange) {
|
||||||
|
setState(() {
|
||||||
|
_startDate = args.value.startDate;
|
||||||
|
_endDate = args.value.endDate;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 16),
|
||||||
|
// Second Date Picker
|
||||||
|
Expanded(
|
||||||
|
child: SfDateRangePicker(
|
||||||
|
view: DateRangePickerView.month,
|
||||||
|
selectionMode: DateRangePickerSelectionMode.range,
|
||||||
|
onSelectionChanged: (args) {
|
||||||
|
// Handle the date selection from the first calendar
|
||||||
|
if (args.value is PickerDateRange) {
|
||||||
|
setState(() {
|
||||||
|
_startDate = args.value.startDate;
|
||||||
|
_endDate = args.value.endDate;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 16),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
if (_startDate != null && _endDate != null) {
|
||||||
|
String formattedRange =
|
||||||
|
"${_formatDate(_startDate!)} - ${_formatDate(_endDate!)}";
|
||||||
|
_dateController.text = formattedRange;
|
||||||
|
}
|
||||||
|
// You can extract the selected date range here
|
||||||
|
// Close the bottom sheet after selection
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Text('Done'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String _formatDate(DateTime date) {
|
||||||
|
// Format the date as per your requirement
|
||||||
|
return "${date.month.toString().padLeft(2, '0')}/${date.day.toString().padLeft(2, '0')}/${date.year}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -29,8 +29,7 @@ class _TransportViewState extends State<TransportView> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListView(
|
return ListView(
|
||||||
shrinkWrap: true,
|
|
||||||
physics: NeverScrollableScrollPhysics(),
|
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
@ -170,6 +169,10 @@ class _TransportViewState extends State<TransportView> {
|
||||||
if(ctrl.selectedUser.value == 0){
|
if(ctrl.selectedUser.value == 0){
|
||||||
ctrl.toggleFilter();
|
ctrl.toggleFilter();
|
||||||
}
|
}
|
||||||
|
else if(ctrl.selectedUser.value == 1){
|
||||||
|
ctrl.toggleViewFreight();
|
||||||
|
}
|
||||||
|
|
||||||
else if(ctrl.selectedUser.value == 2){
|
else if(ctrl.selectedUser.value == 2){
|
||||||
ctrl.togglePending();
|
ctrl.togglePending();
|
||||||
}
|
}
|
||||||
|
@ -187,6 +190,7 @@ class _TransportViewState extends State<TransportView> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
Obx(() {
|
Obx(() {
|
||||||
switch (ctrl.selectedUser.value) {
|
switch (ctrl.selectedUser.value) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:shayog/components/styles/app_images.dart';
|
import 'package:shayog/components/styles/app_images.dart';
|
||||||
|
@ -16,18 +18,31 @@ class TransportController extends GetxController {
|
||||||
final ScrollController verticalScrollController = ScrollController();
|
final ScrollController verticalScrollController = ScrollController();
|
||||||
var selectedIndex = 0.obs;
|
var selectedIndex = 0.obs;
|
||||||
var selectedUser = 0.obs;
|
var selectedUser = 0.obs;
|
||||||
|
|
||||||
|
// for generate freight
|
||||||
RxString selectPlant = ''.obs;
|
RxString selectPlant = ''.obs;
|
||||||
var selectProduct = ''.obs;
|
var selectProduct = ''.obs;
|
||||||
var selectLocation = ''.obs;
|
var selectLocation = ''.obs;
|
||||||
var selectTransactionType = ''.obs;
|
var selectTransactionType = ''.obs;
|
||||||
|
|
||||||
|
// for generate freight bill
|
||||||
RxString selectPlantFreight = ''.obs;
|
RxString selectPlantFreight = ''.obs;
|
||||||
var selectProductFreight = ''.obs;
|
var selectProductFreight = ''.obs;
|
||||||
var selectLocationFreight = ''.obs;
|
var selectLocationFreight = ''.obs;
|
||||||
var selectTransactionTypeFreight = ''.obs;
|
var selectTransactionTypeFreight = ''.obs;
|
||||||
|
|
||||||
|
// for pending bill
|
||||||
RxString selectPlantPending = ''.obs;
|
RxString selectPlantPending = ''.obs;
|
||||||
var selectProductPending = ''.obs;
|
var selectProductPending = ''.obs;
|
||||||
var selectLocationPending = ''.obs;
|
var selectLocationPending = ''.obs;
|
||||||
var selectTransactionTypePending = ''.obs;
|
var selectTransactionTypePending = ''.obs;
|
||||||
|
|
||||||
|
// for view FreightBill
|
||||||
|
|
||||||
|
RxString selectPlantViewFreight = ''.obs;
|
||||||
|
var selectProductViewFreight = ''.obs;
|
||||||
|
var selectLocationViewFreight = ''.obs;
|
||||||
|
var selectTransactionTypeViewFreight = ''.obs;
|
||||||
var selectedItem = false.obs;
|
var selectedItem = false.obs;
|
||||||
var grnDetails = <Content>[].obs;
|
var grnDetails = <Content>[].obs;
|
||||||
var product = <Prodect>[].obs;
|
var product = <Prodect>[].obs;
|
||||||
|
@ -44,6 +59,7 @@ class TransportController extends GetxController {
|
||||||
}
|
}
|
||||||
|
|
||||||
RxBool isFilterVisibleGenerateFreight = false.obs;
|
RxBool isFilterVisibleGenerateFreight = false.obs;
|
||||||
|
RxBool isFilterVisibleViewFreight = false.obs;
|
||||||
RxBool isFilterVisiblePendingGeneration = false.obs;
|
RxBool isFilterVisiblePendingGeneration = false.obs;
|
||||||
final int initialRecordCount = 20;
|
final int initialRecordCount = 20;
|
||||||
|
|
||||||
|
@ -53,26 +69,28 @@ class TransportController extends GetxController {
|
||||||
RxBool showTransactionError = false.obs;
|
RxBool showTransactionError = false.obs;
|
||||||
|
|
||||||
void toggleFilter() {
|
void toggleFilter() {
|
||||||
// if (selectedUser.value == 0) {
|
isFilterVisibleGenerateFreight.value =
|
||||||
isFilterVisibleGenerateFreight.value =
|
!isFilterVisibleGenerateFreight.value;
|
||||||
!isFilterVisibleGenerateFreight.value;
|
if (!isFilterVisibleGenerateFreight.value) {
|
||||||
if (!isFilterVisibleGenerateFreight.value) {
|
clearFiltersGenerateFreightBill();
|
||||||
clearFiltersGenerateFreightBill();
|
}
|
||||||
}
|
|
||||||
// }
|
|
||||||
// if (selectedUser.value == 2) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void togglePending(){
|
void togglePending() {
|
||||||
isFilterVisiblePendingGeneration.value =
|
isFilterVisiblePendingGeneration.value =
|
||||||
!isFilterVisiblePendingGeneration.value;
|
!isFilterVisiblePendingGeneration.value;
|
||||||
if (!isFilterVisiblePendingGeneration.value) {
|
if (!isFilterVisiblePendingGeneration.value) {
|
||||||
clearFiltersPendingGeneration();
|
clearFiltersPendingGeneration();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void toggleViewFreight() {
|
||||||
|
isFilterVisibleViewFreight.value = !isFilterVisibleViewFreight.value;
|
||||||
|
if (!isFilterVisibleViewFreight.value) {
|
||||||
|
clearFiltersViewFreight();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void selectAll(bool value) {
|
void selectAll(bool value) {
|
||||||
for (var item in grnDetails) {
|
for (var item in grnDetails) {
|
||||||
item.isSelected = value;
|
item.isSelected = value;
|
||||||
|
@ -89,6 +107,10 @@ class TransportController extends GetxController {
|
||||||
RxBool showProductErrorPending = false.obs;
|
RxBool showProductErrorPending = false.obs;
|
||||||
RxBool showTransactionErrorPending = false.obs;
|
RxBool showTransactionErrorPending = false.obs;
|
||||||
|
|
||||||
|
RxBool showPlantErrorViewFreight = false.obs;
|
||||||
|
RxBool showProductErrorViewFreight = false.obs;
|
||||||
|
RxBool showTransactionErrorViewFreight = false.obs;
|
||||||
|
|
||||||
void validateFields() {
|
void validateFields() {
|
||||||
showPlantError.value = selectPlant.value.isEmpty;
|
showPlantError.value = selectPlant.value.isEmpty;
|
||||||
showTransactionError.value = selectTransactionType.value.isEmpty;
|
showTransactionError.value = selectTransactionType.value.isEmpty;
|
||||||
|
@ -101,6 +123,13 @@ class TransportController extends GetxController {
|
||||||
showProductErrorPending.value = selectProductPending.value.isEmpty;
|
showProductErrorPending.value = selectProductPending.value.isEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void validateFieldsViewFreightBill() {
|
||||||
|
showPlantErrorViewFreight.value = selectPlantViewFreight.value.isEmpty;
|
||||||
|
// showTransactionErrorViewFreight.value =
|
||||||
|
// selectTransactionTypeViewFreight.value.isEmpty;
|
||||||
|
showProductErrorViewFreight.value = selectProductViewFreight.value.isEmpty;
|
||||||
|
}
|
||||||
|
|
||||||
void validateFieldsGenerateFreight() {
|
void validateFieldsGenerateFreight() {
|
||||||
showPlantErrorFreight.value = selectPlantFreight.value.isEmpty;
|
showPlantErrorFreight.value = selectPlantFreight.value.isEmpty;
|
||||||
showTransactionErrorFreight.value =
|
showTransactionErrorFreight.value =
|
||||||
|
@ -118,7 +147,7 @@ class TransportController extends GetxController {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
var transactionType = ['STO', 'InBound'];
|
var transactionType = ['STO', 'INBOUND'];
|
||||||
|
|
||||||
RxList tabs = <CommonModel>[
|
RxList tabs = <CommonModel>[
|
||||||
CommonModel(
|
CommonModel(
|
||||||
|
@ -177,16 +206,14 @@ class TransportController extends GetxController {
|
||||||
Map<String, String> requestBody = {
|
Map<String, String> requestBody = {
|
||||||
"plant": selectPlantFreight.value,
|
"plant": selectPlantFreight.value,
|
||||||
"productNane": selectProductFreight.value,
|
"productNane": selectProductFreight.value,
|
||||||
"transactionType": selectTransactionTypeFreight.value,
|
"transactionType": selectTransactionTypeFreight.value.toUpperCase(),
|
||||||
"fromLocation": selectLocation.value,
|
"fromLocation": selectLocation.value,
|
||||||
"grnFromDate": "",
|
"grnFromDate": "",
|
||||||
"grnToDate": ""
|
"grnToDate": ""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var response = await PostRequests.addFreightBill(requestBody);
|
var response = await PostRequests.addFreightBill(requestBody);
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
|
|
||||||
List<Content> flattenedContent =
|
List<Content> flattenedContent =
|
||||||
response.content!.expand((list) => list).toList();
|
response.content!.expand((list) => list).toList();
|
||||||
print("Flattened content size: ${flattenedContent.length}");
|
print("Flattened content size: ${flattenedContent.length}");
|
||||||
|
@ -199,7 +226,8 @@ class TransportController extends GetxController {
|
||||||
(selectProductFreight.value.isEmpty ||
|
(selectProductFreight.value.isEmpty ||
|
||||||
item.materialCode == selectProductFreight.value) &&
|
item.materialCode == selectProductFreight.value) &&
|
||||||
(selectTransactionTypeFreight.value.isEmpty ||
|
(selectTransactionTypeFreight.value.isEmpty ||
|
||||||
item.codeValue == selectTransactionTypeFreight.value);
|
item.codeValue ==
|
||||||
|
selectTransactionTypeFreight.value.toUpperCase());
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
print("Filtered Data: ${filteredData.length}");
|
print("Filtered Data: ${filteredData.length}");
|
||||||
|
@ -216,7 +244,6 @@ class TransportController extends GetxController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// void handleFilterSubmit() {
|
// void handleFilterSubmit() {
|
||||||
// validateFieldsGenerateFreight();
|
// validateFieldsGenerateFreight();
|
||||||
//
|
//
|
||||||
|
@ -234,10 +261,8 @@ class TransportController extends GetxController {
|
||||||
selectProductFreight.value.isEmpty ||
|
selectProductFreight.value.isEmpty ||
|
||||||
selectTransactionTypeFreight.value.isEmpty) {
|
selectTransactionTypeFreight.value.isEmpty) {
|
||||||
print('please fill data ');
|
print('please fill data ');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
displayFilteredData();
|
displayFilteredData();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,12 +271,26 @@ class TransportController extends GetxController {
|
||||||
if (selectPlantPending.value.isEmpty ||
|
if (selectPlantPending.value.isEmpty ||
|
||||||
selectProductPending.value.isEmpty ||
|
selectProductPending.value.isEmpty ||
|
||||||
selectTransactionTypePending.value.isEmpty) {
|
selectTransactionTypePending.value.isEmpty) {
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
displayFilteredDataFromPending();
|
displayFilteredDataFromPending();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handleFilterSubmitViewFreightBill() {
|
||||||
|
print('submit call');
|
||||||
|
validateFieldsViewFreightBill();
|
||||||
|
if (selectPlantViewFreight.value.isEmpty ||
|
||||||
|
selectProductViewFreight.value.isEmpty
|
||||||
|
// ||
|
||||||
|
// selectTransactionTypeViewFreight.value.isEmpty
|
||||||
|
) {
|
||||||
|
print('submit call 22');
|
||||||
|
} else {
|
||||||
|
print('submit call 1');
|
||||||
|
displayFilteredDataFromViewFreight();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void clearFiltersGenerateFreightBill() {
|
void clearFiltersGenerateFreightBill() {
|
||||||
selectPlantFreight.value = '';
|
selectPlantFreight.value = '';
|
||||||
selectProductFreight.value = '';
|
selectProductFreight.value = '';
|
||||||
|
@ -273,6 +312,18 @@ class TransportController extends GetxController {
|
||||||
showTransactionErrorPending.value = false;
|
showTransactionErrorPending.value = false;
|
||||||
postData();
|
postData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clearFiltersViewFreight() {
|
||||||
|
selectPlantViewFreight.value = '';
|
||||||
|
selectProductViewFreight.value = '';
|
||||||
|
// selectTransactionTypeViewFreight.value = '';
|
||||||
|
fromController.clear();
|
||||||
|
showPlantErrorViewFreight.value = false;
|
||||||
|
showProductErrorViewFreight.value = false;
|
||||||
|
showTransactionErrorViewFreight.value = false;
|
||||||
|
postData();
|
||||||
|
}
|
||||||
|
|
||||||
getFreightBills() async {
|
getFreightBills() async {
|
||||||
try {
|
try {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
|
@ -376,10 +427,6 @@ class TransportController extends GetxController {
|
||||||
try {
|
try {
|
||||||
freightViewLoader.value = true;
|
freightViewLoader.value = true;
|
||||||
|
|
||||||
// currentPage.value = page ?? currentPage.value;
|
|
||||||
// if (sort != null) sortField.value = sort;
|
|
||||||
// if (direction != null) sortDirection.value = direction;
|
|
||||||
|
|
||||||
Map<String, String> requestBody = {
|
Map<String, String> requestBody = {
|
||||||
"plant": "",
|
"plant": "",
|
||||||
"productNane": "",
|
"productNane": "",
|
||||||
|
@ -388,18 +435,14 @@ class TransportController extends GetxController {
|
||||||
"fromLocation": "",
|
"fromLocation": "",
|
||||||
"grnFromDate": "",
|
"grnFromDate": "",
|
||||||
"grnToDate": "",
|
"grnToDate": "",
|
||||||
"page": currentPage.toString(),
|
|
||||||
"size": pageSize.toString(),
|
|
||||||
"sort": "${sortField.value},${sortDirection.value}"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var response = await PostRequests.viewFreightBill(requestBody,
|
var response = await PostRequests.viewFreightBill(requestBody);
|
||||||
currentPage.value, pageSize.value, '$sortField', '$sortDirection');
|
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
List<FreightBill> flattenedContent =
|
List<FreightBill> flattenedContent =
|
||||||
response.content!.expand((list) => list).toList();
|
response.content!.expand((list) => list).toList();
|
||||||
freightBillData.assignAll(flattenedContent);
|
freightBillData.assignAll(flattenedContent);
|
||||||
|
print("response from${freightBillData[0].freightbillCode.runtimeType} view freight bill ${freightBillData[0].plantCode.runtimeType} and ${freightBillData[0].materialCode.runtimeType} and}");
|
||||||
totalPages.value = response.totalPages ?? 0;
|
totalPages.value = response.totalPages ?? 0;
|
||||||
totalElements.value = response.totalElements ?? 0;
|
totalElements.value = response.totalElements ?? 0;
|
||||||
}
|
}
|
||||||
|
@ -460,46 +503,237 @@ class TransportController extends GetxController {
|
||||||
List<GrnPending> flattenedContent =
|
List<GrnPending> flattenedContent =
|
||||||
response.content!.expand((list) => list).toList();
|
response.content!.expand((list) => list).toList();
|
||||||
grnPendingData.assignAll(flattenedContent);
|
grnPendingData.assignAll(flattenedContent);
|
||||||
print('response from pending tab${response.first.toString()} and ${flattenedContent.length} and ${grnPendingData.value[0].codeValue} and ${grnPendingData.value[0].plantCode} and ${grnPendingData.value[0].materialCode}');
|
print(
|
||||||
|
'response from pending tab${response.first.toString()} and ${flattenedContent.length} and ${grnPendingData.value[0].codeValue} and ${grnPendingData.value[0].plantCode} and ${grnPendingData.value[0].materialCode}');
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
grnPendingLoader.value = false;
|
grnPendingLoader.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// void displayFilteredDataFromViewFreight() async {
|
||||||
|
// try {
|
||||||
|
// isLoading.value = true;
|
||||||
|
// Map<String, String> requestBody = {
|
||||||
|
// "plant": selectPlantViewFreight.value,
|
||||||
|
// "productNane": selectProductViewFreight.value,
|
||||||
|
// "freightBillNo": "",
|
||||||
|
// "transactionType": "",
|
||||||
|
// "fromLocation": "",
|
||||||
|
// "grnFromDate": "",
|
||||||
|
// "grnToDate": "",
|
||||||
|
// };
|
||||||
|
// print('submit call 444');
|
||||||
|
// print('Request Body: ${jsonEncode(requestBody)}');
|
||||||
|
//
|
||||||
|
// print(
|
||||||
|
// "pending Data 122 ${selectPlantViewFreight.value} and ${selectProductViewFreight.value}freightBillData: }");
|
||||||
|
//
|
||||||
|
// var response = await PostRequests.viewFreightBill(requestBody);
|
||||||
|
//
|
||||||
|
// if (response != null) {
|
||||||
|
// List<FreightBill> flattenedContent =
|
||||||
|
// response.content!.expand((list) => list).toList();
|
||||||
|
// print(
|
||||||
|
// "pending Data 1 ${selectPlantViewFreight.value} and ${selectProductViewFreight.value}freightBillData: and ${flattenedContent.length}");
|
||||||
|
//
|
||||||
|
// List<FreightBill> filteredData = flattenedContent.where((item) {
|
||||||
|
// return (selectPlantViewFreight.value.isEmpty ||
|
||||||
|
// item.plantCode == selectPlantViewFreight.value) &&
|
||||||
|
// (selectProductViewFreight.value.isEmpty ||
|
||||||
|
// item.materialCode == selectProductViewFreight.value
|
||||||
|
// // &&
|
||||||
|
// // (selectTransactionTypeViewFreight.value.isEmpty ||
|
||||||
|
// // item.codeValue ==
|
||||||
|
// // selectTransactionTypeViewFreight.value.toUpperCase()
|
||||||
|
// );
|
||||||
|
// }).toList();
|
||||||
|
//
|
||||||
|
// print(
|
||||||
|
// "pending Data ${selectPlantViewFreight.value} and ${selectProductViewFreight.value}freightBillData: ${filteredData.length} and ${flattenedContent.length}");
|
||||||
|
//
|
||||||
|
// freightBillData.assignAll(filteredData);
|
||||||
|
//
|
||||||
|
// print(
|
||||||
|
// "✅ pending Data:freightBillData ${filteredData.length} items displayed pending.");
|
||||||
|
// } else {
|
||||||
|
// print("❌ No response from API.");
|
||||||
|
// }
|
||||||
|
// } finally {
|
||||||
|
// isLoading.value = false;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// void displayFilteredDataFromViewFreight() async {
|
||||||
|
// try {
|
||||||
|
// isLoading.value = true;
|
||||||
|
// Map<String, String> requestBody = {
|
||||||
|
//
|
||||||
|
// "plant":selectPlantViewFreight.value.toString(),
|
||||||
|
// "productNane": selectProductViewFreight.value.toString(),
|
||||||
|
// "freightBillNo": "",
|
||||||
|
// "transactionType": "",
|
||||||
|
// "fromLocation": "",
|
||||||
|
// "grnFromDate": "",
|
||||||
|
// "grnToDate": ""
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// print('Request Body: ${jsonEncode(requestBody)}');
|
||||||
|
//
|
||||||
|
// var response = await PostRequests.viewFreightBill(requestBody);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// List<FreightBill> flattenedContent = response!.content!.expand((list) => list).toList();
|
||||||
|
// print("Flattened content length: ${flattenedContent.length}");
|
||||||
|
//
|
||||||
|
// if (flattenedContent.isEmpty) {
|
||||||
|
// print("No matching records found");
|
||||||
|
//
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // List<FreightBill> filteredData = flattenedContent.where((item) {
|
||||||
|
// // bool plantMatch = selectPlantViewFreight.value.isEmpty ||
|
||||||
|
// // item.plantCode?.trim() == selectPlantViewFreight.value.trim();
|
||||||
|
// // bool productMatch = selectProductViewFreight.value.isEmpty ||
|
||||||
|
// // item.materialCode?.trim() == selectProductViewFreight.value.trim();
|
||||||
|
// //
|
||||||
|
// // return plantMatch && productMatch;
|
||||||
|
// // }).toList();
|
||||||
|
// List<FreightBill> filteredData = flattenedContent.where((item) {
|
||||||
|
// // Print raw item data first
|
||||||
|
// print("Checking item: ${jsonEncode(item.toJson())}");
|
||||||
|
//
|
||||||
|
// // Print values being compared
|
||||||
|
// print("Comparing: Plant '${item.plantCode}' with '${selectPlantViewFreight.value}'");
|
||||||
|
// print("Comparing: Product '${item.materialCode}' with '${selectProductViewFreight.value}'");
|
||||||
|
//
|
||||||
|
// bool plantMatch = selectPlantViewFreight.value.isEmpty ||
|
||||||
|
// item.plantCode?.trim() == selectPlantViewFreight.value.trim();
|
||||||
|
// print("Plant match result: $plantMatch");
|
||||||
|
//
|
||||||
|
// bool productMatch = selectProductViewFreight.value.isEmpty ||
|
||||||
|
// item.materialCode?.trim() == selectProductViewFreight.value.trim();
|
||||||
|
// print("Product match result: $productMatch");
|
||||||
|
//
|
||||||
|
// final result = plantMatch && productMatch;
|
||||||
|
// print("Final match result: $result");
|
||||||
|
// print("------------------------");
|
||||||
|
//
|
||||||
|
// return result;
|
||||||
|
// }).toList();
|
||||||
|
//
|
||||||
|
// // Print final results
|
||||||
|
// print("Total items after filtering: ${filteredData.length}");
|
||||||
|
// if (filteredData.isNotEmpty) {
|
||||||
|
// print("First matched item: ${jsonEncode(filteredData.first.toJson())}");
|
||||||
|
// }
|
||||||
|
// freightBillData.assignAll(filteredData);
|
||||||
|
// print("Filtered Data: ${filteredData.length} items");
|
||||||
|
//
|
||||||
|
// } catch (e) {
|
||||||
|
// print("Error in displayFilteredDataFromViewFreight: $e");
|
||||||
|
//
|
||||||
|
// } finally {
|
||||||
|
// isLoading.value = false;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
void displayFilteredDataFromViewFreight() async {
|
||||||
|
try {
|
||||||
|
freightViewLoader.value = true;
|
||||||
|
Map<String, String> requestBody = {
|
||||||
|
"plant": selectPlantViewFreight.value,
|
||||||
|
"productNane": selectProductViewFreight.value,
|
||||||
|
"freightBillNo": "",
|
||||||
|
"transactionType": "",
|
||||||
|
"fromLocation": "",
|
||||||
|
"grnFromDate": "",
|
||||||
|
"grnToDate": "",
|
||||||
|
};
|
||||||
|
|
||||||
|
// Debug log for request
|
||||||
|
print("Filter request with Plant: ${selectPlantViewFreight.value}, Product: ${selectProductViewFreight.value}");
|
||||||
|
|
||||||
|
var response = await PostRequests.viewFreightBill(requestBody);
|
||||||
|
if (response != null) {
|
||||||
|
List<FreightBill> flattenedContent =
|
||||||
|
response.content!.expand((list) => list).toList();
|
||||||
|
|
||||||
|
print("Total records before filtering: ${flattenedContent.length}");
|
||||||
|
|
||||||
|
// If first item exists, log its types for debugging
|
||||||
|
if (flattenedContent.isNotEmpty) {
|
||||||
|
print("Sample data types - Plant: ${flattenedContent[0].plantCode.runtimeType}, "
|
||||||
|
"Material: ${flattenedContent[0].materialCode.runtimeType}");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<FreightBill> filteredData = flattenedContent.where((item) {
|
||||||
|
bool plantMatch = selectPlantViewFreight.value.isEmpty ||
|
||||||
|
item.plantCode == selectPlantViewFreight.value;
|
||||||
|
bool productMatch = selectProductViewFreight.value.isEmpty ||
|
||||||
|
item.materialCode == selectProductViewFreight.value;
|
||||||
|
|
||||||
|
// Debug log for matching
|
||||||
|
print("Checking - Plant: ${item.plantCode} matches: $plantMatch, "
|
||||||
|
"Product: ${item.materialCode} matches: $productMatch");
|
||||||
|
|
||||||
|
return plantMatch && productMatch;
|
||||||
|
}).toList();
|
||||||
|
|
||||||
|
print("Filtered records count: ${filteredData.length}");
|
||||||
|
|
||||||
|
freightBillData.assignAll(filteredData);
|
||||||
|
|
||||||
|
// Update pagination if available
|
||||||
|
totalPages.value = response.totalPages ?? 0;
|
||||||
|
totalElements.value = response.totalElements ?? 0;
|
||||||
|
|
||||||
|
print("✅ Freight bill data filtered: ${filteredData.length} items displayed");
|
||||||
|
} else {
|
||||||
|
print("❌ No response from API.");
|
||||||
|
freightBillData.clear();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
print("❌ Error in displayFilteredDataFromViewFreight: $e");
|
||||||
|
freightBillData.clear();
|
||||||
|
} finally {
|
||||||
|
freightViewLoader.value = false;
|
||||||
|
print('data');
|
||||||
|
}
|
||||||
|
}
|
||||||
void displayFilteredDataFromPending() async {
|
void displayFilteredDataFromPending() async {
|
||||||
try {
|
try {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
Map<String, String> requestBody = {
|
Map<String, String> requestBody = {
|
||||||
"plant": selectPlantPending.value,
|
"plant": selectPlantPending.value,
|
||||||
"productNane": selectProductPending.value,
|
"productNane": selectProductPending.value,
|
||||||
"transactionType": selectTransactionTypePending.value,
|
"transactionType": selectTransactionTypePending.value.toUpperCase(),
|
||||||
"fromLocation": selectLocation.value,
|
"fromLocation": selectLocation.value,
|
||||||
"grnFromDate": "",
|
"grnFromDate": "",
|
||||||
"grnToDate": ""
|
"grnToDate": ""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var response = await PostRequests.grnPending(requestBody);
|
var response = await PostRequests.grnPending(requestBody);
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
|
|
||||||
List<GrnPending> flattenedContent =
|
List<GrnPending> flattenedContent =
|
||||||
response.content!.expand((list) => list).toList();
|
response.content!.expand((list) => list).toList();
|
||||||
|
|
||||||
List<GrnPending> filteredData = flattenedContent.where((item) {
|
List<GrnPending> filteredData = flattenedContent.where((item) {
|
||||||
return (selectPlantFreight.value.isEmpty ||
|
return (selectPlantFreight.value.isEmpty ||
|
||||||
item.plantCode == selectPlantFreight.value) &&
|
item.plantCode == selectPlantFreight.value) &&
|
||||||
(selectProductFreight.value.isEmpty ||
|
(selectProductFreight.value.isEmpty ||
|
||||||
item.materialCode == selectProductFreight.value) &&
|
item.materialCode == selectProductFreight.value) &&
|
||||||
(selectTransactionTypeFreight.value.isEmpty ||
|
(selectTransactionTypeFreight.value.isEmpty ||
|
||||||
item.codeValue == selectTransactionTypeFreight.value);
|
item.codeValue ==
|
||||||
|
selectTransactionTypeFreight.value.toUpperCase());
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
print("pending Data: ${filteredData.length}");
|
print("pending Data grnPendingData: ${filteredData.length}");
|
||||||
|
|
||||||
grnPendingData.assignAll(filteredData);
|
grnPendingData.assignAll(filteredData);
|
||||||
|
|
||||||
print("✅ pending Data: ${filteredData.length} items displayed pending.");
|
print(
|
||||||
|
"✅ pending Data: ${filteredData.length} items displayed pending.");
|
||||||
} else {
|
} else {
|
||||||
print("❌ No response from API.");
|
print("❌ No response from API.");
|
||||||
}
|
}
|
||||||
|
@ -507,5 +741,4 @@ class TransportController extends GetxController {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ class ApiUrls {
|
||||||
static const getAllUser =
|
static const getAllUser =
|
||||||
'http://46.28.44.130:9093/api/users/userdetails?page=';
|
'http://46.28.44.130:9093/api/users/userdetails?page=';
|
||||||
static const viewFreightBill =
|
static const viewFreightBill =
|
||||||
'http://localhost:9092/bill/freightbill?page';
|
'http://46.28.44.130:9092/bill/freightbill?page=0&size=15&sort=last_updated_on,desc';
|
||||||
static const addUserType =
|
static const addUserType =
|
||||||
'http://46.28.44.130:9093/api/user-types/createUserType';
|
'http://46.28.44.130:9093/api/user-types/createUserType';
|
||||||
static const dropDownList =
|
static const dropDownList =
|
||||||
|
@ -34,6 +34,7 @@ class ApiUrls {
|
||||||
"http://46.28.44.130:9093/api/user-types/usertypedetails?page=0&size=15&sort=last_updated_on,desc";
|
"http://46.28.44.130:9093/api/user-types/usertypedetails?page=0&size=15&sort=last_updated_on,desc";
|
||||||
static const grnPendingDetails =
|
static const grnPendingDetails =
|
||||||
"http://46.28.44.130:9092/bill/grndetailsPanding?page=0&size=20&sort=grn_date,desc";
|
"http://46.28.44.130:9092/bill/grndetailsPanding?page=0&size=20&sort=grn_date,desc";
|
||||||
|
static const getInvoiceDetails = "http://46.28.44.130:9092/invoice/getInvoice";
|
||||||
}
|
}
|
||||||
// class ApiUrls {
|
// class ApiUrls {
|
||||||
// ApiUrls._();
|
// ApiUrls._();
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import 'package:shayog/feature/presentation/screens/admin/user_management/model/check_status_res_model.dart';
|
import 'package:shayog/feature/presentation/screens/admin/user_management/model/check_status_res_model.dart';
|
||||||
import 'package:shayog/feature/presentation/screens/admin/user_management/model/create_user_model.dart';
|
import 'package:shayog/feature/presentation/screens/admin/user_management/model/create_user_model.dart';
|
||||||
import 'package:shayog/feature/presentation/screens/admin/user_management/model/plant_mapping_res_model.dart';
|
import 'package:shayog/feature/presentation/screens/admin/user_management/model/plant_mapping_res_model.dart';
|
||||||
|
import 'package:shayog/feature/presentation/screens/transporter/model/get_invoice_response.dart';
|
||||||
import 'package:shayog/services/network/remote_services.dart';
|
import 'package:shayog/services/network/remote_services.dart';
|
||||||
import '../../feature/presentation/screens/admin/user_management/model/assign_plants_res_model.dart';
|
import '../../feature/presentation/screens/admin/user_management/model/assign_plants_res_model.dart';
|
||||||
import '../../feature/presentation/screens/admin/user_management/model/edit_user_res_model.dart';
|
import '../../feature/presentation/screens/admin/user_management/model/edit_user_res_model.dart';
|
||||||
|
@ -104,12 +105,9 @@ class PostRequests {
|
||||||
|
|
||||||
static Future<ViewFreightBillResModel?> viewFreightBill(
|
static Future<ViewFreightBillResModel?> viewFreightBill(
|
||||||
Map<String, String> requestBody,
|
Map<String, String> requestBody,
|
||||||
int page,
|
) async {
|
||||||
int size,
|
|
||||||
String sort,
|
|
||||||
String dir) async {
|
|
||||||
var apiResponse = await RemoteService.postUser(requestBody,
|
var apiResponse = await RemoteService.postUser(requestBody,
|
||||||
'${ApiUrls.viewFreightBill}=$page&size=$size&sort=$sort,$dir');
|
'${ApiUrls.viewFreightBill}');
|
||||||
|
|
||||||
if (apiResponse != null) {
|
if (apiResponse != null) {
|
||||||
return viewFreightBillResModelFromJson(apiResponse.response!);
|
return viewFreightBillResModelFromJson(apiResponse.response!);
|
||||||
|
@ -218,4 +216,14 @@ class PostRequests {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
static Future<GetInvoiceResponse?> getInvoice(
|
||||||
|
Map<String, String> requestBody) async {
|
||||||
|
var apiResponse =
|
||||||
|
await RemoteService.postUser(requestBody, ApiUrls.getInvoiceDetails);
|
||||||
|
if (apiResponse != null) {
|
||||||
|
return getInvoiceResponseFromJson(apiResponse.response!);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
class Helpers {
|
class Helpers {
|
||||||
Helpers._();
|
Helpers._();
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
import FlutterMacOS
|
import FlutterMacOS
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
import file_picker
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
|
FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
|
||||||
}
|
}
|
||||||
|
|
119
pubspec.lock
119
pubspec.lock
|
@ -41,6 +41,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.19.0"
|
version: "1.19.0"
|
||||||
|
cross_file:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: cross_file
|
||||||
|
sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.3.4+2"
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -57,6 +65,22 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.1"
|
version: "1.3.1"
|
||||||
|
ffi:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: ffi
|
||||||
|
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.3"
|
||||||
|
file_picker:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: file_picker
|
||||||
|
sha256: c9943dd7d702ab4199d199bc151a2d79c86db031a02ad84566dab58c494d2adc
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "8.3.1"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -70,11 +94,24 @@ 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: "615a505aef59b151b46bbeef55b36ce2b6ed299d160c51d84281946f0aa0ce0e"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.24"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_web_plugins:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
get:
|
get:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -171,6 +208,54 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.0"
|
version: "1.9.0"
|
||||||
|
path_provider:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: path_provider
|
||||||
|
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.5"
|
||||||
|
path_provider_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_android
|
||||||
|
sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.15"
|
||||||
|
path_provider_foundation:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_foundation
|
||||||
|
sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.1"
|
||||||
|
path_provider_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_linux
|
||||||
|
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.1"
|
||||||
|
path_provider_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_platform_interface
|
||||||
|
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.2"
|
||||||
|
path_provider_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_windows
|
||||||
|
sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.0"
|
||||||
pixel_snap:
|
pixel_snap:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -179,6 +264,22 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.5"
|
version: "0.1.5"
|
||||||
|
platform:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: platform
|
||||||
|
sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.6"
|
||||||
|
plugin_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: plugin_platform_interface
|
||||||
|
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.8"
|
||||||
simple_gesture_detector:
|
simple_gesture_detector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -320,6 +421,22 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.0"
|
||||||
|
win32:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: win32
|
||||||
|
sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.10.1"
|
||||||
|
xdg_directories:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: xdg_directories
|
||||||
|
sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.6.0 <4.0.0"
|
dart: ">=3.6.0 <4.0.0"
|
||||||
flutter: ">=3.18.0-18.0.pre.54"
|
flutter: ">=3.24.0"
|
||||||
|
|
|
@ -41,6 +41,8 @@ dependencies:
|
||||||
vph_web_date_picker: ^0.0.6
|
vph_web_date_picker: ^0.0.6
|
||||||
table_calendar: ^3.2.0
|
table_calendar: ^3.2.0
|
||||||
syncfusion_flutter_datepicker: ^28.2.4
|
syncfusion_flutter_datepicker: ^28.2.4
|
||||||
|
file_picker: ^8.3.1
|
||||||
|
path_provider: ^2.1.5
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue