mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-10 19:08:56 +03:30
3.2.2
This commit is contained in:
Vendored
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"editor.inlineSuggest.showToolbar": "onHover"
|
"editor.inlineSuggest.showToolbar": "onHover",
|
||||||
|
"dart.flutterSdkPath": "C:\\src\\flutter"
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.example.cssd">
|
package="com.example.cssd">
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
|
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||||
In most cases you can leave this as-is, but you if you want to provide
|
In most cases you can leave this as-is, but you if you want to provide
|
||||||
@@ -23,6 +26,38 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<provider
|
||||||
|
android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
|
||||||
|
android:authorities="${applicationId}.flutter_downloader.provider"
|
||||||
|
android:exported="false"
|
||||||
|
android:grantUriPermissions="true">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
|
android:resource="@xml/provider_paths"/>
|
||||||
|
</provider>
|
||||||
|
<!-- Begin FlutterDownloader customization -->
|
||||||
|
<!-- disable default Initializer -->
|
||||||
|
<provider
|
||||||
|
android:name="androidx.startup.InitializationProvider"
|
||||||
|
android:authorities="${applicationId}.androidx-startup"
|
||||||
|
android:exported="false"
|
||||||
|
tools:node="merge">
|
||||||
|
<meta-data
|
||||||
|
android:name="androidx.work.WorkManagerInitializer"
|
||||||
|
android:value="androidx.startup"
|
||||||
|
tools:node="remove" />
|
||||||
|
</provider>
|
||||||
|
<!-- declare customized Initializer -->
|
||||||
|
<provider
|
||||||
|
android:name="vn.hunghd.flutterdownloader.FlutterDownloaderInitializer"
|
||||||
|
android:authorities="${applicationId}.flutter-downloader-init"
|
||||||
|
android:exported="false">
|
||||||
|
<!-- changes this number to configure the maximum number of concurrent tasks -->
|
||||||
|
<meta-data
|
||||||
|
android:name="vn.hunghd.flutterdownloader.MAX_CONCURRENT_TASKS"
|
||||||
|
android:value="5" />
|
||||||
|
</provider>
|
||||||
|
<!-- End FlutterDownloader customization -->
|
||||||
<!-- Don't delete the meta-data below.
|
<!-- Don't delete the meta-data below.
|
||||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
<meta-data
|
<meta-data
|
||||||
|
|||||||
+5
-20
@@ -25,7 +25,7 @@ class Url {
|
|||||||
|
|
||||||
static const String sendResetPass = '$baseUrl/password/reset';
|
static const String sendResetPass = '$baseUrl/password/reset';
|
||||||
|
|
||||||
static const String addImage = '$baseUrl/UploadFile';
|
static const String addImage = '$baseUrl/store_media';
|
||||||
|
|
||||||
static const String exportItems = '$baseUrl/export/items';
|
static const String exportItems = '$baseUrl/export/items';
|
||||||
|
|
||||||
@@ -86,31 +86,16 @@ class Url {
|
|||||||
static const String createItemResult = '$baseUrl/Items';
|
static const String createItemResult = '$baseUrl/Items';
|
||||||
|
|
||||||
static String getMyItems(int id) {
|
static String getMyItems(int id) {
|
||||||
return '$baseUrl/transfer-my-items?page=$id';
|
return '$baseUrl/MyItems?page=$id';
|
||||||
}
|
|
||||||
|
|
||||||
static String getHospitalItems(int id) {
|
|
||||||
return '$baseUrl/transfer-items?page=$id';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static String getMyPackages(int id) {
|
static String getMyPackages(int id) {
|
||||||
return '$baseUrl/transfer-my-packages?page=$id';
|
return '$baseUrl/MyPackages?page=$id';
|
||||||
}
|
}
|
||||||
|
|
||||||
static String getHospitalPackages(int id) {
|
static String getMyItemRequests = '$baseUrl/suspended-transfer-items';
|
||||||
return '$baseUrl/transfer-packages?page=$id';
|
|
||||||
}
|
|
||||||
|
|
||||||
static String getMyItemRequests = '$baseUrl/my-suspended-transfer-items';
|
static String getMyPackageRequests = '$baseUrl/suspended-transfer-packages';
|
||||||
|
|
||||||
static const String getHospitalItemRequests =
|
|
||||||
'$baseUrl/suspended-transfer-items';
|
|
||||||
|
|
||||||
static String getMyPackageRequests =
|
|
||||||
'$baseUrl/my-suspended-transfer-packages';
|
|
||||||
|
|
||||||
static const String getHospitalPackageRequests =
|
|
||||||
'$baseUrl/suspended-transfer-packages';
|
|
||||||
|
|
||||||
static String transferItems(String id) {
|
static String transferItems(String id) {
|
||||||
return '$baseUrl/transfer-items/$id';
|
return '$baseUrl/transfer-items/$id';
|
||||||
|
|||||||
+14
-9
@@ -1,11 +1,11 @@
|
|||||||
import 'package:cssd/pages/CyclePages/cycle_update_screen.dart';
|
// import 'package:cssd/pages/CyclePages/cycle_update_screen.dart';
|
||||||
import 'package:cssd/pages/ItemPages/item_add_screen.dart';
|
import 'package:cssd/pages/ItemPages/item_add_screen.dart';
|
||||||
import 'package:cssd/pages/ItemPages/item_detail_screen.dart';
|
import 'package:cssd/pages/ItemPages/item_detail_screen.dart';
|
||||||
import 'package:cssd/pages/ItemPages/item_filter_screen.dart';
|
import 'package:cssd/pages/ItemPages/item_filter_screen.dart';
|
||||||
import 'package:cssd/pages/ItemPages/item_result_screen.dart';
|
import 'package:cssd/pages/ItemPages/item_result_screen.dart';
|
||||||
import 'package:cssd/pages/ItemPages/item_scan_screen.dart';
|
import 'package:cssd/pages/ItemPages/item_scan_screen.dart';
|
||||||
import 'package:cssd/pages/ItemPages/item_update_screen.dart';
|
// import 'package:cssd/pages/ItemPages/item_update_screen.dart';
|
||||||
import 'package:cssd/pages/LabelPages/label_update_screen.dart';
|
// import 'package:cssd/pages/LabelPages/label_update_screen.dart';
|
||||||
import 'package:cssd/pages/MyItemsPages/Result/my_items_result_screen.dart';
|
import 'package:cssd/pages/MyItemsPages/Result/my_items_result_screen.dart';
|
||||||
import 'package:cssd/pages/MyItemsPages/my_items_detail_screen.dart';
|
import 'package:cssd/pages/MyItemsPages/my_items_detail_screen.dart';
|
||||||
import 'package:cssd/pages/MyItemsPages/my_items_filter_screen.dart';
|
import 'package:cssd/pages/MyItemsPages/my_items_filter_screen.dart';
|
||||||
@@ -23,7 +23,7 @@ import 'package:cssd/pages/PackagePages/package_detail_screen.dart';
|
|||||||
import 'package:cssd/pages/PackagePages/package_filter_screen.dart';
|
import 'package:cssd/pages/PackagePages/package_filter_screen.dart';
|
||||||
import 'package:cssd/pages/PackagePages/package_result_screen.dart';
|
import 'package:cssd/pages/PackagePages/package_result_screen.dart';
|
||||||
import 'package:cssd/pages/PackagePages/package_scan_screen.dart';
|
import 'package:cssd/pages/PackagePages/package_scan_screen.dart';
|
||||||
import 'package:cssd/pages/PackagePages/package_update_screen.dart';
|
// import 'package:cssd/pages/PackagePages/package_update_screen.dart';
|
||||||
import 'package:cssd/pages/TestPages/test_form_page.dart';
|
import 'package:cssd/pages/TestPages/test_form_page.dart';
|
||||||
import 'package:cssd/providers/items.dart';
|
import 'package:cssd/providers/items.dart';
|
||||||
import 'package:cssd/providers/my_items.dart';
|
import 'package:cssd/providers/my_items.dart';
|
||||||
@@ -32,6 +32,7 @@ import 'package:cssd/providers/packages.dart';
|
|||||||
import 'package:cssd/providers/users.dart';
|
import 'package:cssd/providers/users.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_downloader/flutter_downloader.dart';
|
||||||
import 'package:flutter_phoenix/flutter_phoenix.dart';
|
import 'package:flutter_phoenix/flutter_phoenix.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
@@ -67,12 +68,16 @@ import 'providers/my_info.dart';
|
|||||||
import 'providers/test_results.dart';
|
import 'providers/test_results.dart';
|
||||||
import 'widgets/Global/splash_screen.dart';
|
import 'widgets/Global/splash_screen.dart';
|
||||||
|
|
||||||
void main() {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
SystemChrome.setPreferredOrientations([
|
SystemChrome.setPreferredOrientations([
|
||||||
DeviceOrientation.portraitUp,
|
DeviceOrientation.portraitUp,
|
||||||
DeviceOrientation.portraitDown,
|
DeviceOrientation.portraitDown,
|
||||||
]);
|
]);
|
||||||
|
await FlutterDownloader.initialize(
|
||||||
|
debug: true,
|
||||||
|
ignoreSsl: true,
|
||||||
|
);
|
||||||
runApp(Phoenix(child: MyApp()));
|
runApp(Phoenix(child: MyApp()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +160,7 @@ class MyApp extends StatelessWidget {
|
|||||||
Routes.cycleFilterScreen: (ctx) => CycleFilterScreen(),
|
Routes.cycleFilterScreen: (ctx) => CycleFilterScreen(),
|
||||||
Routes.cycleScanScreen: (ctx) => CycleScanScreen(),
|
Routes.cycleScanScreen: (ctx) => CycleScanScreen(),
|
||||||
Routes.labelScanScreen: (ctx) => LabelScanScreen(),
|
Routes.labelScanScreen: (ctx) => LabelScanScreen(),
|
||||||
Routes.labelUpdateScreen: (ctx) => LabelUpdateScreen(),
|
// Routes.labelUpdateScreen: (ctx) => LabelUpdateScreen(),
|
||||||
Routes.cycleAddScreen: (ctx) => CycleAddScreen(),
|
Routes.cycleAddScreen: (ctx) => CycleAddScreen(),
|
||||||
Routes.labelAddScreen: (ctx) => LabelAddScreen(),
|
Routes.labelAddScreen: (ctx) => LabelAddScreen(),
|
||||||
Routes.labelResultScreen: (ctx) => LabelResultScreen(),
|
Routes.labelResultScreen: (ctx) => LabelResultScreen(),
|
||||||
@@ -174,9 +179,9 @@ class MyApp extends StatelessWidget {
|
|||||||
Routes.itemFilterScreen: (ctx) => ItemFilterScreen(),
|
Routes.itemFilterScreen: (ctx) => ItemFilterScreen(),
|
||||||
Routes.itemDetailScreen: (ctx) => ItemDetailScreen(),
|
Routes.itemDetailScreen: (ctx) => ItemDetailScreen(),
|
||||||
Routes.formTestResultScreen: (ctx) => FormPage(),
|
Routes.formTestResultScreen: (ctx) => FormPage(),
|
||||||
Routes.cycleUpdateScreen: (ctx) => CycleUpdateScreen(),
|
// Routes.cycleUpdateScreen: (ctx) => CycleUpdateScreen(),
|
||||||
Routes.packageUpdateScreen: (ctx) => PackageUpdateScreen(),
|
// Routes.packageUpdateScreen: (ctx) => PackageUpdateScreen(),
|
||||||
Routes.itemUpdateScreen: (ctx) => ItemUpdateScreen(),
|
// Routes.itemUpdateScreen: (ctx) => ItemUpdateScreen(),
|
||||||
Routes.itemScanScreen: (ctx) => ItemScanScreen(),
|
Routes.itemScanScreen: (ctx) => ItemScanScreen(),
|
||||||
Routes.packageScanScreen: (ctx) => PackageScanScreen(),
|
Routes.packageScanScreen: (ctx) => PackageScanScreen(),
|
||||||
Routes.myItemsResultScreen: (ctx) => MyItemsResultScreen(),
|
Routes.myItemsResultScreen: (ctx) => MyItemsResultScreen(),
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class ItemResultObject extends Equatable {
|
|||||||
final String? batchId;
|
final String? batchId;
|
||||||
final String? udi;
|
final String? udi;
|
||||||
final String? udi_name;
|
final String? udi_name;
|
||||||
|
final String? packageId;
|
||||||
|
|
||||||
ItemResultObject({
|
ItemResultObject({
|
||||||
required this.id,
|
required this.id,
|
||||||
@@ -20,6 +21,7 @@ class ItemResultObject extends Equatable {
|
|||||||
this.batchId,
|
this.batchId,
|
||||||
this.udi,
|
this.udi,
|
||||||
this.udi_name,
|
this.udi_name,
|
||||||
|
this.packageId,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -32,6 +34,7 @@ class ItemResultObject extends Equatable {
|
|||||||
batchId!,
|
batchId!,
|
||||||
udi!,
|
udi!,
|
||||||
udi_name!,
|
udi_name!,
|
||||||
|
packageId!,
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -42,6 +45,7 @@ class ItemDetailObject extends Equatable {
|
|||||||
final String id;
|
final String id;
|
||||||
final String name;
|
final String name;
|
||||||
final String userName;
|
final String userName;
|
||||||
|
final String userCreator;
|
||||||
final String size;
|
final String size;
|
||||||
final String specific;
|
final String specific;
|
||||||
final String hospital;
|
final String hospital;
|
||||||
@@ -50,6 +54,7 @@ class ItemDetailObject extends Equatable {
|
|||||||
final String udi;
|
final String udi;
|
||||||
final int status;
|
final int status;
|
||||||
final List<String>? filePath;
|
final List<String>? filePath;
|
||||||
|
final String? packageId;
|
||||||
|
|
||||||
ItemDetailObject({
|
ItemDetailObject({
|
||||||
required this.id,
|
required this.id,
|
||||||
@@ -63,6 +68,8 @@ class ItemDetailObject extends Equatable {
|
|||||||
required this.udi,
|
required this.udi,
|
||||||
required this.status,
|
required this.status,
|
||||||
this.filePath,
|
this.filePath,
|
||||||
|
required this.packageId,
|
||||||
|
required this.userCreator,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -71,6 +78,7 @@ class ItemDetailObject extends Equatable {
|
|||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
userName,
|
userName,
|
||||||
|
userCreator,
|
||||||
size,
|
size,
|
||||||
specific,
|
specific,
|
||||||
hospital,
|
hospital,
|
||||||
@@ -79,6 +87,7 @@ class ItemDetailObject extends Equatable {
|
|||||||
udi,
|
udi,
|
||||||
status,
|
status,
|
||||||
filePath!,
|
filePath!,
|
||||||
|
packageId!,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ class PackageDetailObject extends Equatable {
|
|||||||
final String hospitalName;
|
final String hospitalName;
|
||||||
// final String udi;
|
// final String udi;
|
||||||
final List<String> items;
|
final List<String> items;
|
||||||
|
final String userName;
|
||||||
|
final String userCreator;
|
||||||
|
|
||||||
PackageDetailObject({
|
PackageDetailObject({
|
||||||
required this.id,
|
required this.id,
|
||||||
@@ -40,6 +42,8 @@ class PackageDetailObject extends Equatable {
|
|||||||
required this.hospitalName,
|
required this.hospitalName,
|
||||||
// required this.udi,
|
// required this.udi,
|
||||||
required this.items,
|
required this.items,
|
||||||
|
required this.userName,
|
||||||
|
required this.userCreator,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -52,6 +56,8 @@ class PackageDetailObject extends Equatable {
|
|||||||
hospitalName,
|
hospitalName,
|
||||||
// udi,
|
// udi,
|
||||||
items,
|
items,
|
||||||
|
userName,
|
||||||
|
userCreator,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,282 +1,282 @@
|
|||||||
import 'package:cssd/models/cycles_models.dart';
|
// import 'package:cssd/models/cycles_models.dart';
|
||||||
import 'package:cssd/providers/cycles.dart';
|
// import 'package:cssd/providers/cycles.dart';
|
||||||
import 'package:cssd/widgets/CycleScreens/Add/cycle_update_button.dart';
|
// import 'package:cssd/widgets/CycleScreens/Add/cycle_update_button.dart';
|
||||||
import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
// import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:intl/intl.dart' as DateEditor;
|
// import 'package:intl/intl.dart' as DateEditor;
|
||||||
import 'package:provider/provider.dart';
|
// import 'package:provider/provider.dart';
|
||||||
import '../../config/routes.dart';
|
// import '../../config/routes.dart';
|
||||||
import '../../providers/connectivity.dart';
|
// import '../../providers/connectivity.dart';
|
||||||
import '../../widgets/Global/internet_error.dart';
|
// import '../../widgets/Global/internet_error.dart';
|
||||||
import '../../widgets/LabelScreens/Add/date_picker.dart';
|
// import '../../widgets/LabelScreens/Add/date_picker.dart';
|
||||||
|
|
||||||
class CycleUpdateScreen extends StatefulWidget {
|
// class CycleUpdateScreen extends StatefulWidget {
|
||||||
@override
|
// @override
|
||||||
_CycleUpdateScreenState createState() => _CycleUpdateScreenState();
|
// _CycleUpdateScreenState createState() => _CycleUpdateScreenState();
|
||||||
}
|
// }
|
||||||
|
|
||||||
class _CycleUpdateScreenState extends State<CycleUpdateScreen> {
|
// class _CycleUpdateScreenState extends State<CycleUpdateScreen> {
|
||||||
final _cycleNumberFocusNode = FocusNode();
|
// final _cycleNumberFocusNode = FocusNode();
|
||||||
final _descriptionFocusNode = FocusNode();
|
// final _descriptionFocusNode = FocusNode();
|
||||||
TextEditingController cycleNumberCTRL = new TextEditingController();
|
// TextEditingController cycleNumberCTRL = new TextEditingController();
|
||||||
TextEditingController sterilizerIdCTRL = new TextEditingController();
|
// TextEditingController sterilizerIdCTRL = new TextEditingController();
|
||||||
TextEditingController descriptionCTRL = new TextEditingController();
|
// TextEditingController descriptionCTRL = new TextEditingController();
|
||||||
TextEditingController dateCTRL = new TextEditingController();
|
// TextEditingController dateCTRL = new TextEditingController();
|
||||||
TextEditingController labelCTRL = new TextEditingController();
|
// TextEditingController labelCTRL = new TextEditingController();
|
||||||
|
|
||||||
final _form = GlobalKey<FormState>();
|
// final _form = GlobalKey<FormState>();
|
||||||
|
|
||||||
// List<Map<String, String>> labelVals = [];
|
// // List<Map<String, String>> labelVals = [];
|
||||||
// List<String> labelValue = [];
|
// // List<String> labelValue = [];
|
||||||
bool isEmpty = false;
|
// bool isEmpty = false;
|
||||||
bool isInit = true;
|
// bool isInit = true;
|
||||||
CycleDetailObject? datas;
|
// CycleDetailObject? datas;
|
||||||
@override
|
// @override
|
||||||
void initState() {
|
// void initState() {
|
||||||
dateCTRL.text = DateEditor.DateFormat('y-M-d').format(DateTime.now());
|
// dateCTRL.text = DateEditor.DateFormat('y-M-d').format(DateTime.now());
|
||||||
super.initState();
|
// super.initState();
|
||||||
}
|
// }
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
void didChangeDependencies() async {
|
// void didChangeDependencies() async {
|
||||||
if (isInit) {
|
// if (isInit) {
|
||||||
var _id = ModalRoute.of(context)!.settings.arguments;
|
// var _id = ModalRoute.of(context)!.settings.arguments;
|
||||||
await Provider.of<CyclesProvider>(context, listen: false)
|
// await Provider.of<CyclesProvider>(context, listen: false)
|
||||||
.showCycleResult(_id.toString())
|
// .showCycleResult(_id.toString())
|
||||||
.then(
|
// .then(
|
||||||
(result) {
|
// (result) {
|
||||||
setState(
|
// setState(
|
||||||
() {
|
// () {
|
||||||
datas = result;
|
// datas = result;
|
||||||
cycleNumberCTRL.text = datas!.cycleNumber;
|
// cycleNumberCTRL.text = datas!.cycleNumber;
|
||||||
sterilizerIdCTRL.text = datas!.sterileId;
|
// sterilizerIdCTRL.text = datas!.sterileId;
|
||||||
descriptionCTRL.text = datas!.description;
|
// descriptionCTRL.text = datas!.description;
|
||||||
dateCTRL.text = datas!.date;
|
// dateCTRL.text = datas!.date;
|
||||||
// for (var label in datas!.labels) {
|
// // for (var label in datas!.labels) {
|
||||||
// labelCTRL.text = label;
|
// // labelCTRL.text = label;
|
||||||
// }
|
// // }
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
await Provider.of<CyclesProvider>(context, listen: false)
|
// await Provider.of<CyclesProvider>(context, listen: false)
|
||||||
.getLabelFilters()
|
// .getLabelFilters()
|
||||||
.then(
|
// .then(
|
||||||
(result) {
|
// (result) {
|
||||||
setState(
|
// setState(
|
||||||
() {
|
// () {
|
||||||
// labelVals = result;
|
// // labelVals = result;
|
||||||
isInit = false;
|
// isInit = false;
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
super.didChangeDependencies();
|
// super.didChangeDependencies();
|
||||||
}
|
// }
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
final _media = MediaQuery.of(context);
|
// final _media = MediaQuery.of(context);
|
||||||
final double _devicewidth = _media.size.width;
|
// final double _devicewidth = _media.size.width;
|
||||||
final double _deviceBlockSize = _devicewidth / 100;
|
// final double _deviceBlockSize = _devicewidth / 100;
|
||||||
return WillPopScope(
|
// return WillPopScope(
|
||||||
onWillPop: () async {
|
// onWillPop: () async {
|
||||||
Navigator.pushReplacementNamed(
|
// Navigator.pushReplacementNamed(
|
||||||
context,
|
// context,
|
||||||
Routes.cycleResultScreen,
|
// Routes.cycleResultScreen,
|
||||||
);
|
// );
|
||||||
return true;
|
// return true;
|
||||||
},
|
// },
|
||||||
child: SafeArea(
|
// child: SafeArea(
|
||||||
child: Scaffold(
|
// child: Scaffold(
|
||||||
appBar: AppBar(
|
// appBar: AppBar(
|
||||||
titleSpacing: -10,
|
// titleSpacing: -10,
|
||||||
backgroundColor: Colors.black,
|
// backgroundColor: Colors.black,
|
||||||
title: Text('Cycles', style: TextStyle(color: Colors.white,),),
|
// title: Text('Cycles', style: TextStyle(color: Colors.white,),),
|
||||||
leading: IconButton(
|
// leading: IconButton(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
Icons.keyboard_arrow_left,
|
// Icons.keyboard_arrow_left,
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
size: 35,
|
// size: 35,
|
||||||
),
|
// ),
|
||||||
onPressed: () => Navigator.of(context)
|
// onPressed: () => Navigator.of(context)
|
||||||
.pushReplacementNamed(Routes.cycleResultScreen),
|
// .pushReplacementNamed(Routes.cycleResultScreen),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
body: Consumer<ConnectivityProvider>(
|
// body: Consumer<ConnectivityProvider>(
|
||||||
builder: (ct, connection, _) {
|
// builder: (ct, connection, _) {
|
||||||
return connection.conStatus != 'offline'
|
// return connection.conStatus != 'offline'
|
||||||
? isInit
|
// ? isInit
|
||||||
? Center(
|
// ? Center(
|
||||||
child: CircularProgressIndicator(color: Colors.black),
|
// child: CircularProgressIndicator(color: Colors.black),
|
||||||
)
|
// )
|
||||||
: Form(
|
// : Form(
|
||||||
key: _form,
|
// key: _form,
|
||||||
child: Padding(
|
// child: Padding(
|
||||||
padding: EdgeInsets.all(20),
|
// padding: EdgeInsets.all(20),
|
||||||
child: ListView(
|
// child: ListView(
|
||||||
children: <Widget>[
|
// children: <Widget>[
|
||||||
Text(
|
// Text(
|
||||||
'Update a Cycle',
|
// 'Update a Cycle',
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 6 * _deviceBlockSize,
|
// fontSize: 6 * _deviceBlockSize,
|
||||||
letterSpacing: 3,
|
// letterSpacing: 3,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
TextFormField(
|
// TextFormField(
|
||||||
validator: (val) {
|
// validator: (val) {
|
||||||
if (val!.isEmpty) {
|
// if (val!.isEmpty) {
|
||||||
return 'Strilizer ID required!';
|
// return 'Strilizer ID required!';
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
controller: sterilizerIdCTRL,
|
// controller: sterilizerIdCTRL,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
icon: Icon(FontAwesomeIcons.sortNumericDown,
|
// icon: Icon(FontAwesomeIcons.sortNumericDown,
|
||||||
size: 7 * _deviceBlockSize),
|
// size: 7 * _deviceBlockSize),
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
labelText: 'Strilizer ID',
|
// labelText: 'Strilizer ID',
|
||||||
contentPadding: EdgeInsets.symmetric(
|
// contentPadding: EdgeInsets.symmetric(
|
||||||
vertical: 2, horizontal: 3),
|
// vertical: 2, horizontal: 3),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w100,
|
// fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
// fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
// fontSize: 5 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
keyboardType: TextInputType.visiblePassword,
|
// keyboardType: TextInputType.visiblePassword,
|
||||||
textInputAction: TextInputAction.next,
|
// textInputAction: TextInputAction.next,
|
||||||
onFieldSubmitted: (_) {
|
// onFieldSubmitted: (_) {
|
||||||
FocusScope.of(context)
|
// FocusScope.of(context)
|
||||||
.requestFocus(_cycleNumberFocusNode);
|
// .requestFocus(_cycleNumberFocusNode);
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
TextFormField(
|
// TextFormField(
|
||||||
validator: (val) {
|
// validator: (val) {
|
||||||
if (val!.isEmpty) {
|
// if (val!.isEmpty) {
|
||||||
return 'Cycle number required!';
|
// return 'Cycle number required!';
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
controller: cycleNumberCTRL,
|
// controller: cycleNumberCTRL,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
FontAwesomeIcons.sortNumericDown,
|
// FontAwesomeIcons.sortNumericDown,
|
||||||
size: 7 * _deviceBlockSize,
|
// size: 7 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w100,
|
// fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
// fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
labelText: 'Cycle Number',
|
// labelText: 'Cycle Number',
|
||||||
contentPadding: EdgeInsets.symmetric(
|
// contentPadding: EdgeInsets.symmetric(
|
||||||
vertical: 2, horizontal: 3),
|
// vertical: 2, horizontal: 3),
|
||||||
),
|
// ),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
// fontSize: 5 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
focusNode: _cycleNumberFocusNode,
|
// focusNode: _cycleNumberFocusNode,
|
||||||
keyboardType: TextInputType.number,
|
// keyboardType: TextInputType.number,
|
||||||
textInputAction: TextInputAction.done,
|
// textInputAction: TextInputAction.done,
|
||||||
onFieldSubmitted: (_) {
|
// onFieldSubmitted: (_) {
|
||||||
FocusScope.of(context)
|
// FocusScope.of(context)
|
||||||
.requestFocus(_descriptionFocusNode);
|
// .requestFocus(_descriptionFocusNode);
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
LabelAddDatePicker(
|
// LabelAddDatePicker(
|
||||||
dateCTRL: dateCTRL,
|
// dateCTRL: dateCTRL,
|
||||||
deviceBlockSize: _deviceBlockSize,
|
// deviceBlockSize: _deviceBlockSize,
|
||||||
label: 'Date',
|
// label: 'Date',
|
||||||
),
|
// ),
|
||||||
// SizedBox(
|
// // SizedBox(
|
||||||
// height: 20.0,
|
// // height: 20.0,
|
||||||
// ),
|
// // ),
|
||||||
// Consumer<CyclesProvider>(
|
// // Consumer<CyclesProvider>(
|
||||||
// builder: (ctx, cycleProvider, _) =>
|
// // builder: (ctx, cycleProvider, _) =>
|
||||||
// ListView.builder(
|
// // ListView.builder(
|
||||||
// physics: NeverScrollableScrollPhysics(),
|
// // physics: NeverScrollableScrollPhysics(),
|
||||||
// shrinkWrap: true,
|
// // shrinkWrap: true,
|
||||||
// itemBuilder: (ctx, index) => AddLabelBox(
|
// // itemBuilder: (ctx, index) => AddLabelBox(
|
||||||
// text: 'Select Labels included',
|
// // text: 'Select Labels included',
|
||||||
// iconColor: kPinkSub,
|
// // iconColor: kPinkSub,
|
||||||
// deviceBlockSize: _deviceBlockSize,
|
// // deviceBlockSize: _deviceBlockSize,
|
||||||
// values: cycleProvider.labelValues[index],
|
// // values: cycleProvider.labelValues[index],
|
||||||
// vals: cycleProvider.labelVals,
|
// // vals: cycleProvider.labelVals,
|
||||||
// initialLabelValue: labelCTRL.text,
|
// // initialLabelValue: labelCTRL.text,
|
||||||
// index: index,
|
// // index: index,
|
||||||
// ),
|
// // ),
|
||||||
// itemCount: cycleProvider.labelValues.length,
|
// // itemCount: cycleProvider.labelValues.length,
|
||||||
// ),
|
// // ),
|
||||||
// ),
|
// // ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
TextFormField(
|
// TextFormField(
|
||||||
controller: descriptionCTRL,
|
// controller: descriptionCTRL,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
FontAwesomeIcons.alignLeft,
|
// FontAwesomeIcons.alignLeft,
|
||||||
size: 7 * _deviceBlockSize,
|
// size: 7 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w100,
|
// fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
// fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
labelText: 'Description',
|
// labelText: 'Description',
|
||||||
contentPadding: EdgeInsets.symmetric(
|
// contentPadding: EdgeInsets.symmetric(
|
||||||
vertical: 2, horizontal: 3),
|
// vertical: 2, horizontal: 3),
|
||||||
),
|
// ),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
// fontSize: 5 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
keyboardType: TextInputType.multiline,
|
// keyboardType: TextInputType.multiline,
|
||||||
focusNode: _descriptionFocusNode,
|
// focusNode: _descriptionFocusNode,
|
||||||
minLines: 1,
|
// minLines: 1,
|
||||||
maxLines: 5,
|
// maxLines: 5,
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 70,
|
// height: 70,
|
||||||
),
|
// ),
|
||||||
CycleUpdateButton(
|
// CycleUpdateButton(
|
||||||
form: _form,
|
// form: _form,
|
||||||
id: datas!.id,
|
// id: datas!.id,
|
||||||
cycleNumberCTRL: cycleNumberCTRL,
|
// cycleNumberCTRL: cycleNumberCTRL,
|
||||||
dateCTRL: dateCTRL,
|
// dateCTRL: dateCTRL,
|
||||||
// labelValue: labelCTRL,
|
// // labelValue: labelCTRL,
|
||||||
striizerIdCTRL: sterilizerIdCTRL,
|
// striizerIdCTRL: sterilizerIdCTRL,
|
||||||
deviceBlockSize: _deviceBlockSize,
|
// deviceBlockSize: _deviceBlockSize,
|
||||||
descriptionCTRL: descriptionCTRL,
|
// descriptionCTRL: descriptionCTRL,
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 100,
|
// height: 100,
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
)
|
// )
|
||||||
: ConnectionErrorBox();
|
// : ConnectionErrorBox();
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
|
// ignore_for_file: unused_local_variable
|
||||||
|
|
||||||
|
import 'dart:isolate';
|
||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:cssd/config/colors.dart';
|
import 'package:cssd/config/colors.dart';
|
||||||
import 'package:cssd/providers/items.dart';
|
import 'package:cssd/providers/items.dart';
|
||||||
import 'package:cssd/widgets/ItemScreens/Filter/item_filter_object.dart';
|
import 'package:cssd/widgets/ItemScreens/Filter/item_filter_object.dart';
|
||||||
import 'package:cssd/widgets/ItemScreens/Result/item_data_box.dart';
|
import 'package:cssd/widgets/ItemScreens/Result/item_data_box.dart';
|
||||||
|
import 'package:flutter_downloader/flutter_downloader.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
|
||||||
import '../../config/routes.dart';
|
import '../../config/routes.dart';
|
||||||
import '../../providers/connectivity.dart';
|
import '../../providers/connectivity.dart';
|
||||||
@@ -25,11 +32,30 @@ class _ItemResultScreenState extends State<ItemResultScreen> {
|
|||||||
bool _isInit = true;
|
bool _isInit = true;
|
||||||
ScrollController? sc;
|
ScrollController? sc;
|
||||||
TextEditingController searchCTRL = new TextEditingController();
|
TextEditingController searchCTRL = new TextEditingController();
|
||||||
|
ReceivePort _port = ReceivePort();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
sc = new ScrollController();
|
sc = new ScrollController();
|
||||||
super.initState();
|
super.initState();
|
||||||
|
IsolateNameServer.registerPortWithName(_port.sendPort, 'downloader_send_port');
|
||||||
|
_port.listen((dynamic data) {
|
||||||
|
String id = data[0];
|
||||||
|
DownloadTaskStatus status = data[1];
|
||||||
|
int progress = data[2];
|
||||||
|
if (status == DownloadTaskStatus.complete) {
|
||||||
|
print('Downloaded');
|
||||||
|
}
|
||||||
|
setState((){ });
|
||||||
|
});
|
||||||
|
|
||||||
|
FlutterDownloader.registerCallback(downloadCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
@pragma('vm:entry-point')
|
||||||
|
static void downloadCallback(String id, int status, int progress) {
|
||||||
|
final SendPort? send = IsolateNameServer.lookupPortByName('downloader_send_port');
|
||||||
|
send!.send([id, status, progress]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -58,6 +84,12 @@ class _ItemResultScreenState extends State<ItemResultScreen> {
|
|||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
IsolateNameServer.removePortNameMapping('downloader_send_port');
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final _media = MediaQuery.of(context);
|
final _media = MediaQuery.of(context);
|
||||||
@@ -252,27 +284,30 @@ class ItemResultFloatingButton extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
// InkWell(
|
InkWell(
|
||||||
// customBorder: CircleBorder(),
|
customBorder: CircleBorder(),
|
||||||
// onTap: () {
|
onTap: () async {
|
||||||
// Provider.of<ItemProvider>(context, listen: false).exportItems();
|
var status = await Permission.storage.request();
|
||||||
// },
|
if (status.isGranted) {
|
||||||
// child: Container(
|
Provider.of<ItemProvider>(context, listen: false).exportItems();
|
||||||
// padding: EdgeInsets.all(_deviceBlockSize),
|
}
|
||||||
// decoration: BoxDecoration(
|
},
|
||||||
// shape: BoxShape.circle,
|
child: Container(
|
||||||
// color: Colors.black,
|
padding: EdgeInsets.all(_deviceBlockSize),
|
||||||
// ),
|
decoration: BoxDecoration(
|
||||||
// child: Icon(
|
shape: BoxShape.circle,
|
||||||
// Icons.import_export,
|
color: Colors.black,
|
||||||
// size: 10 * _deviceBlockSize,
|
),
|
||||||
// color: Colors.white,
|
child: Icon(
|
||||||
// ),
|
Icons.import_export,
|
||||||
// ),
|
size: 10 * _deviceBlockSize,
|
||||||
// ),
|
color: Colors.white,
|
||||||
// SizedBox(
|
),
|
||||||
// width: 2 * _deviceBlockSize,
|
),
|
||||||
// ),
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 2 * _deviceBlockSize,
|
||||||
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
customBorder: CircleBorder(),
|
customBorder: CircleBorder(),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|||||||
@@ -1,317 +1,317 @@
|
|||||||
import 'package:cssd/models/item_model.dart';
|
// import 'package:cssd/models/item_model.dart';
|
||||||
import 'package:cssd/providers/items.dart';
|
// import 'package:cssd/providers/items.dart';
|
||||||
import 'package:cssd/widgets/ItemScreens/Add/item_update_button.dart';
|
// import 'package:cssd/widgets/ItemScreens/Add/item_update_button.dart';
|
||||||
import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
// import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:provider/provider.dart';
|
// import 'package:provider/provider.dart';
|
||||||
import '../../config/routes.dart';
|
// import '../../config/routes.dart';
|
||||||
import '../../providers/connectivity.dart';
|
// import '../../providers/connectivity.dart';
|
||||||
import '../../widgets/Global/internet_error.dart';
|
// import '../../widgets/Global/internet_error.dart';
|
||||||
|
|
||||||
class ItemUpdateScreen extends StatefulWidget {
|
// class ItemUpdateScreen extends StatefulWidget {
|
||||||
@override
|
// @override
|
||||||
_ItemUpdateScreenState createState() => _ItemUpdateScreenState();
|
// _ItemUpdateScreenState createState() => _ItemUpdateScreenState();
|
||||||
}
|
// }
|
||||||
|
|
||||||
class _ItemUpdateScreenState extends State<ItemUpdateScreen> {
|
// class _ItemUpdateScreenState extends State<ItemUpdateScreen> {
|
||||||
final _itemSizeFocusNode = FocusNode();
|
// final _itemSizeFocusNode = FocusNode();
|
||||||
final _itemSpecificFocusNode = FocusNode();
|
// final _itemSpecificFocusNode = FocusNode();
|
||||||
final _itemUdiFocusNode = FocusNode();
|
// final _itemUdiFocusNode = FocusNode();
|
||||||
final _descriptionFocusNode = FocusNode();
|
// final _descriptionFocusNode = FocusNode();
|
||||||
TextEditingController descriptionCTRL = new TextEditingController();
|
// TextEditingController descriptionCTRL = new TextEditingController();
|
||||||
TextEditingController udiCTRL = new TextEditingController();
|
// TextEditingController udiCTRL = new TextEditingController();
|
||||||
TextEditingController nameCTRL = new TextEditingController();
|
// TextEditingController nameCTRL = new TextEditingController();
|
||||||
TextEditingController specificCTRL = new TextEditingController();
|
// TextEditingController specificCTRL = new TextEditingController();
|
||||||
TextEditingController sizeCTRL = new TextEditingController();
|
// TextEditingController sizeCTRL = new TextEditingController();
|
||||||
TextEditingController dateCTRL = new TextEditingController();
|
// TextEditingController dateCTRL = new TextEditingController();
|
||||||
|
|
||||||
final _form = GlobalKey<FormState>();
|
// final _form = GlobalKey<FormState>();
|
||||||
|
|
||||||
bool isEmpty = false;
|
// bool isEmpty = false;
|
||||||
bool isInit = true;
|
// bool isInit = true;
|
||||||
ItemDetailObject? datas;
|
// ItemDetailObject? datas;
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
void didChangeDependencies() async {
|
// void didChangeDependencies() async {
|
||||||
if (isInit) {
|
// if (isInit) {
|
||||||
var _id = ModalRoute.of(context)!.settings.arguments;
|
// var _id = ModalRoute.of(context)!.settings.arguments;
|
||||||
await Provider.of<ItemProvider>(context, listen: false)
|
// await Provider.of<ItemProvider>(context, listen: false)
|
||||||
.showItemResult(_id.toString())
|
// .showItemResult(_id.toString())
|
||||||
.then(
|
// .then(
|
||||||
(result) {
|
// (result) {
|
||||||
setState(
|
// setState(
|
||||||
() {
|
// () {
|
||||||
datas = result;
|
// datas = result;
|
||||||
nameCTRL.text = datas!.name;
|
// nameCTRL.text = datas!.name;
|
||||||
udiCTRL.text = datas!.udi;
|
// udiCTRL.text = datas!.udi;
|
||||||
descriptionCTRL.text = datas!.description;
|
// descriptionCTRL.text = datas!.description;
|
||||||
sizeCTRL.text = datas!.size;
|
// sizeCTRL.text = datas!.size;
|
||||||
specificCTRL.text = datas!.specific;
|
// specificCTRL.text = datas!.specific;
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
await Provider.of<ItemProvider>(context, listen: false)
|
// await Provider.of<ItemProvider>(context, listen: false)
|
||||||
.getItemResults()
|
// .getItemResults()
|
||||||
.then(
|
// .then(
|
||||||
(result) {
|
// (result) {
|
||||||
setState(
|
// setState(
|
||||||
() {
|
// () {
|
||||||
isInit = false;
|
// isInit = false;
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
super.didChangeDependencies();
|
// super.didChangeDependencies();
|
||||||
}
|
// }
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
final _media = MediaQuery.of(context);
|
// final _media = MediaQuery.of(context);
|
||||||
final double _devicewidth = _media.size.width;
|
// final double _devicewidth = _media.size.width;
|
||||||
final double _deviceBlockSize = _devicewidth / 100;
|
// final double _deviceBlockSize = _devicewidth / 100;
|
||||||
return WillPopScope(
|
// return WillPopScope(
|
||||||
onWillPop: () async {
|
// onWillPop: () async {
|
||||||
Navigator.pushReplacementNamed(
|
// Navigator.pushReplacementNamed(
|
||||||
context,
|
// context,
|
||||||
Routes.itemResultScreen,
|
// Routes.itemResultScreen,
|
||||||
);
|
// );
|
||||||
return true;
|
// return true;
|
||||||
},
|
// },
|
||||||
child: SafeArea(
|
// child: SafeArea(
|
||||||
child: Scaffold(
|
// child: Scaffold(
|
||||||
appBar: AppBar(
|
// appBar: AppBar(
|
||||||
titleSpacing: -10,
|
// titleSpacing: -10,
|
||||||
backgroundColor: Colors.black,
|
// backgroundColor: Colors.black,
|
||||||
title: Text('Items', style: TextStyle(color: Colors.white,),),
|
// title: Text('Items', style: TextStyle(color: Colors.white,),),
|
||||||
leading: IconButton(
|
// leading: IconButton(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
Icons.keyboard_arrow_left,
|
// Icons.keyboard_arrow_left,
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
size: 35,
|
// size: 35,
|
||||||
),
|
// ),
|
||||||
onPressed: () => Navigator.of(context)
|
// onPressed: () => Navigator.of(context)
|
||||||
.pushReplacementNamed(Routes.itemResultScreen),
|
// .pushReplacementNamed(Routes.itemResultScreen),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
body: Consumer<ConnectivityProvider>(
|
// body: Consumer<ConnectivityProvider>(
|
||||||
builder: (ct, connection, _) {
|
// builder: (ct, connection, _) {
|
||||||
return connection.conStatus != 'offline'
|
// return connection.conStatus != 'offline'
|
||||||
? isInit
|
// ? isInit
|
||||||
? Center(
|
// ? Center(
|
||||||
child: CircularProgressIndicator(color: Colors.black),
|
// child: CircularProgressIndicator(color: Colors.black),
|
||||||
)
|
// )
|
||||||
: Form(
|
// : Form(
|
||||||
key: _form,
|
// key: _form,
|
||||||
child: Padding(
|
// child: Padding(
|
||||||
padding: EdgeInsets.all(20),
|
// padding: EdgeInsets.all(20),
|
||||||
child: ListView(
|
// child: ListView(
|
||||||
children: <Widget>[
|
// children: <Widget>[
|
||||||
Text(
|
// Text(
|
||||||
'Update a Item',
|
// 'Update a Item',
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 6 * _deviceBlockSize,
|
// fontSize: 6 * _deviceBlockSize,
|
||||||
letterSpacing: 3,
|
// letterSpacing: 3,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
TextFormField(
|
// TextFormField(
|
||||||
validator: (val) {
|
// validator: (val) {
|
||||||
if (val!.isEmpty) {
|
// if (val!.isEmpty) {
|
||||||
return 'Name required!';
|
// return 'Name required!';
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
controller: nameCTRL,
|
// controller: nameCTRL,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
icon: Icon(FontAwesomeIcons.alignLeft,
|
// icon: Icon(FontAwesomeIcons.alignLeft,
|
||||||
size: 7 * _deviceBlockSize),
|
// size: 7 * _deviceBlockSize),
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
labelText: 'Item Name',
|
// labelText: 'Item Name',
|
||||||
contentPadding: EdgeInsets.symmetric(
|
// contentPadding: EdgeInsets.symmetric(
|
||||||
vertical: 2, horizontal: 3),
|
// vertical: 2, horizontal: 3),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w100,
|
// fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
// fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
// fontSize: 5 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
keyboardType: TextInputType.text,
|
// keyboardType: TextInputType.text,
|
||||||
textInputAction: TextInputAction.next,
|
// textInputAction: TextInputAction.next,
|
||||||
onFieldSubmitted: (_) {
|
// onFieldSubmitted: (_) {
|
||||||
FocusScope.of(context)
|
// FocusScope.of(context)
|
||||||
.requestFocus(_itemSizeFocusNode);
|
// .requestFocus(_itemSizeFocusNode);
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
TextFormField(
|
// TextFormField(
|
||||||
validator: (val) {
|
// validator: (val) {
|
||||||
if (val!.isEmpty) {
|
// if (val!.isEmpty) {
|
||||||
return 'Size required!';
|
// return 'Size required!';
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
controller: sizeCTRL,
|
// controller: sizeCTRL,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
FontAwesomeIcons.sortNumericDown,
|
// FontAwesomeIcons.sortNumericDown,
|
||||||
size: 7 * _deviceBlockSize,
|
// size: 7 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w100,
|
// fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
// fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
labelText: 'Size',
|
// labelText: 'Size',
|
||||||
contentPadding: EdgeInsets.symmetric(
|
// contentPadding: EdgeInsets.symmetric(
|
||||||
vertical: 2, horizontal: 3),
|
// vertical: 2, horizontal: 3),
|
||||||
),
|
// ),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
// fontSize: 5 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
focusNode: _itemSizeFocusNode,
|
// focusNode: _itemSizeFocusNode,
|
||||||
keyboardType: TextInputType.number,
|
// keyboardType: TextInputType.number,
|
||||||
textInputAction: TextInputAction.done,
|
// textInputAction: TextInputAction.done,
|
||||||
onFieldSubmitted: (_) {
|
// onFieldSubmitted: (_) {
|
||||||
FocusScope.of(context)
|
// FocusScope.of(context)
|
||||||
.requestFocus(_itemSpecificFocusNode);
|
// .requestFocus(_itemSpecificFocusNode);
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
TextFormField(
|
// TextFormField(
|
||||||
controller: specificCTRL,
|
// controller: specificCTRL,
|
||||||
validator: (val) {
|
// validator: (val) {
|
||||||
if (val!.isEmpty) {
|
// if (val!.isEmpty) {
|
||||||
return 'Specific required!';
|
// return 'Specific required!';
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
FontAwesomeIcons.alignLeft,
|
// FontAwesomeIcons.alignLeft,
|
||||||
size: 7 * _deviceBlockSize,
|
// size: 7 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w100,
|
// fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
// fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
labelText: 'Specific',
|
// labelText: 'Specific',
|
||||||
contentPadding: EdgeInsets.symmetric(
|
// contentPadding: EdgeInsets.symmetric(
|
||||||
vertical: 2, horizontal: 3),
|
// vertical: 2, horizontal: 3),
|
||||||
),
|
// ),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
// fontSize: 5 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
keyboardType: TextInputType.visiblePassword,
|
// keyboardType: TextInputType.visiblePassword,
|
||||||
focusNode: _itemSpecificFocusNode,
|
// focusNode: _itemSpecificFocusNode,
|
||||||
onFieldSubmitted: (_) {
|
// onFieldSubmitted: (_) {
|
||||||
FocusScope.of(context)
|
// FocusScope.of(context)
|
||||||
.requestFocus(_itemUdiFocusNode);
|
// .requestFocus(_itemUdiFocusNode);
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
TextFormField(
|
// TextFormField(
|
||||||
controller: udiCTRL,
|
// controller: udiCTRL,
|
||||||
validator: (val) {
|
// validator: (val) {
|
||||||
if (val!.isEmpty) {
|
// if (val!.isEmpty) {
|
||||||
return 'UDI required!';
|
// return 'UDI required!';
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
FontAwesomeIcons.alignLeft,
|
// FontAwesomeIcons.alignLeft,
|
||||||
size: 7 * _deviceBlockSize,
|
// size: 7 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w100,
|
// fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
// fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
labelText: 'UDI',
|
// labelText: 'UDI',
|
||||||
contentPadding: EdgeInsets.symmetric(
|
// contentPadding: EdgeInsets.symmetric(
|
||||||
vertical: 2, horizontal: 3),
|
// vertical: 2, horizontal: 3),
|
||||||
),
|
// ),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
// fontSize: 5 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
keyboardType: TextInputType.visiblePassword,
|
// keyboardType: TextInputType.visiblePassword,
|
||||||
focusNode: _itemUdiFocusNode,
|
// focusNode: _itemUdiFocusNode,
|
||||||
onFieldSubmitted: (_) {
|
// onFieldSubmitted: (_) {
|
||||||
FocusScope.of(context)
|
// FocusScope.of(context)
|
||||||
.requestFocus(_descriptionFocusNode);
|
// .requestFocus(_descriptionFocusNode);
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
TextFormField(
|
// TextFormField(
|
||||||
controller: descriptionCTRL,
|
// controller: descriptionCTRL,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
FontAwesomeIcons.alignLeft,
|
// FontAwesomeIcons.alignLeft,
|
||||||
size: 7 * _deviceBlockSize,
|
// size: 7 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w100,
|
// fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
// fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
labelText: 'Description',
|
// labelText: 'Description',
|
||||||
contentPadding: EdgeInsets.symmetric(
|
// contentPadding: EdgeInsets.symmetric(
|
||||||
vertical: 2, horizontal: 3),
|
// vertical: 2, horizontal: 3),
|
||||||
),
|
// ),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
// fontSize: 5 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
keyboardType: TextInputType.multiline,
|
// keyboardType: TextInputType.multiline,
|
||||||
focusNode: _descriptionFocusNode,
|
// focusNode: _descriptionFocusNode,
|
||||||
minLines: 1,
|
// minLines: 1,
|
||||||
maxLines: 5,
|
// maxLines: 5,
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 70,
|
// height: 70,
|
||||||
),
|
// ),
|
||||||
ItemUpdateButton(
|
// ItemUpdateButton(
|
||||||
form: _form,
|
// form: _form,
|
||||||
id: datas!.id,
|
// id: datas!.id,
|
||||||
nameCTRL: nameCTRL,
|
// nameCTRL: nameCTRL,
|
||||||
udiCTRL: udiCTRL,
|
// udiCTRL: udiCTRL,
|
||||||
sizeCTRL: sizeCTRL,
|
// sizeCTRL: sizeCTRL,
|
||||||
specificCTRL: specificCTRL,
|
// specificCTRL: specificCTRL,
|
||||||
deviceBlockSize: _deviceBlockSize,
|
// deviceBlockSize: _deviceBlockSize,
|
||||||
descriptionCTRL: descriptionCTRL,
|
// descriptionCTRL: descriptionCTRL,
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 100,
|
// height: 100,
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
)
|
// )
|
||||||
: ConnectionErrorBox();
|
// : ConnectionErrorBox();
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -1,309 +1,309 @@
|
|||||||
import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
// import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:intl/intl.dart' as DateEditor;
|
// import 'package:intl/intl.dart' as DateEditor;
|
||||||
import 'package:provider/provider.dart';
|
// import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../../config/routes.dart';
|
// import '../../config/routes.dart';
|
||||||
import '../../models/label_models.dart';
|
// import '../../models/label_models.dart';
|
||||||
import '../../providers/connectivity.dart';
|
// import '../../providers/connectivity.dart';
|
||||||
import '../../providers/labels.dart';
|
// import '../../providers/labels.dart';
|
||||||
import '../../widgets/Global/internet_error.dart';
|
// import '../../widgets/Global/internet_error.dart';
|
||||||
import '../../widgets/LabelScreens/Add/date_picker.dart';
|
// import '../../widgets/LabelScreens/Add/date_picker.dart';
|
||||||
import '../../widgets/LabelScreens/Add/update_button.dart';
|
// import '../../widgets/LabelScreens/Add/update_button.dart';
|
||||||
|
|
||||||
class LabelUpdateScreen extends StatefulWidget {
|
// class LabelUpdateScreen extends StatefulWidget {
|
||||||
// static const route = '/LabelUpdateScreen';
|
// // static const route = '/LabelUpdateScreen';
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
_LabelUpdateScreenState createState() => _LabelUpdateScreenState();
|
// _LabelUpdateScreenState createState() => _LabelUpdateScreenState();
|
||||||
}
|
// }
|
||||||
|
|
||||||
class _LabelUpdateScreenState extends State<LabelUpdateScreen> {
|
// class _LabelUpdateScreenState extends State<LabelUpdateScreen> {
|
||||||
final _cycleNumberFocusNode = FocusNode();
|
// final _cycleNumberFocusNode = FocusNode();
|
||||||
final _lotNumberFocusNode = FocusNode();
|
// final _lotNumberFocusNode = FocusNode();
|
||||||
TextEditingController lotNumberCTRL = new TextEditingController();
|
// TextEditingController lotNumberCTRL = new TextEditingController();
|
||||||
TextEditingController cycleNumberCTRL = new TextEditingController();
|
// TextEditingController cycleNumberCTRL = new TextEditingController();
|
||||||
TextEditingController striizerIdCTRL = new TextEditingController();
|
// TextEditingController striizerIdCTRL = new TextEditingController();
|
||||||
TextEditingController sDateCTRL = new TextEditingController();
|
// TextEditingController sDateCTRL = new TextEditingController();
|
||||||
TextEditingController eDateCTRL = new TextEditingController();
|
// TextEditingController eDateCTRL = new TextEditingController();
|
||||||
// TextEditingController packageCTRL = new TextEditingController();
|
// // TextEditingController packageCTRL = new TextEditingController();
|
||||||
|
|
||||||
DateTime? dateTimeS;
|
// DateTime? dateTimeS;
|
||||||
// String sDateValue;
|
// // String sDateValue;
|
||||||
// String eDateValue;
|
// // String eDateValue;
|
||||||
|
|
||||||
final _form = GlobalKey<FormState>();
|
// final _form = GlobalKey<FormState>();
|
||||||
|
|
||||||
// List<Map<String, String>> packageVals = [];
|
// // List<Map<String, String>> packageVals = [];
|
||||||
// List<String> packageValue = [];
|
// // List<String> packageValue = [];
|
||||||
bool isEmpty = false;
|
// bool isEmpty = false;
|
||||||
bool isInit = true;
|
// bool isInit = true;
|
||||||
LabelDetailsObject? datas;
|
// LabelDetailsObject? datas;
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
void initState() {
|
// void initState() {
|
||||||
sDateCTRL.text = DateEditor.DateFormat('y-M-d').format(DateTime.now());
|
// sDateCTRL.text = DateEditor.DateFormat('y-M-d').format(DateTime.now());
|
||||||
eDateCTRL.text = DateEditor.DateFormat('y-M-d').format(DateTime.now());
|
// eDateCTRL.text = DateEditor.DateFormat('y-M-d').format(DateTime.now());
|
||||||
super.initState();
|
// super.initState();
|
||||||
}
|
// }
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
void didChangeDependencies() async {
|
// void didChangeDependencies() async {
|
||||||
if (isInit) {
|
// if (isInit) {
|
||||||
var _id = ModalRoute.of(context)!.settings.arguments;
|
// var _id = ModalRoute.of(context)!.settings.arguments;
|
||||||
await Provider.of<LabelsProvider>(context, listen: false)
|
// await Provider.of<LabelsProvider>(context, listen: false)
|
||||||
.showLabelResult(_id.toString())
|
// .showLabelResult(_id.toString())
|
||||||
.then(
|
// .then(
|
||||||
(result) {
|
// (result) {
|
||||||
setState(
|
// setState(
|
||||||
() {
|
// () {
|
||||||
// if (result.id == 'null') {
|
// // if (result.id == 'null') {
|
||||||
// isEmpty = true;
|
// // isEmpty = true;
|
||||||
// }
|
// // }
|
||||||
datas = result;
|
// datas = result;
|
||||||
lotNumberCTRL.text = datas!.lotNumber;
|
// lotNumberCTRL.text = datas!.lotNumber;
|
||||||
cycleNumberCTRL.text = datas!.cycleNumber;
|
// cycleNumberCTRL.text = datas!.cycleNumber;
|
||||||
striizerIdCTRL.text = datas!.sterileId;
|
// striizerIdCTRL.text = datas!.sterileId;
|
||||||
sDateCTRL.text = datas!.sterileDate;
|
// sDateCTRL.text = datas!.sterileDate;
|
||||||
eDateCTRL.text = datas!.expireDate;
|
// eDateCTRL.text = datas!.expireDate;
|
||||||
// packageValue.add(datas!.packageId);
|
// // packageValue.add(datas!.packageId);
|
||||||
// packageValue.add(datas!.package);
|
// // packageValue.add(datas!.package);
|
||||||
// packageCTRL.text = datas!.package;
|
// // packageCTRL.text = datas!.package;
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
await Provider.of<LabelsProvider>(context, listen: false)
|
// await Provider.of<LabelsProvider>(context, listen: false)
|
||||||
.getPackageFilters()
|
// .getPackageFilters()
|
||||||
.then(
|
// .then(
|
||||||
(result) {
|
// (result) {
|
||||||
setState(
|
// setState(
|
||||||
() {
|
// () {
|
||||||
// packageVals = result.map((value) => {"name": value}).toList();
|
// // packageVals = result.map((value) => {"name": value}).toList();
|
||||||
isInit = false;
|
// isInit = false;
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
super.didChangeDependencies();
|
// super.didChangeDependencies();
|
||||||
}
|
// }
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
final _media = MediaQuery.of(context);
|
// final _media = MediaQuery.of(context);
|
||||||
final double _devicewidth = _media.size.width;
|
// final double _devicewidth = _media.size.width;
|
||||||
final double _deviceBlockSize = _devicewidth / 100;
|
// final double _deviceBlockSize = _devicewidth / 100;
|
||||||
return WillPopScope(
|
// return WillPopScope(
|
||||||
onWillPop: () async {
|
// onWillPop: () async {
|
||||||
Navigator.pushReplacementNamed(
|
// Navigator.pushReplacementNamed(
|
||||||
context,
|
// context,
|
||||||
Routes.labelResultScreen,
|
// Routes.labelResultScreen,
|
||||||
);
|
// );
|
||||||
return true;
|
// return true;
|
||||||
},
|
// },
|
||||||
child: SafeArea(
|
// child: SafeArea(
|
||||||
child: Scaffold(
|
// child: Scaffold(
|
||||||
appBar: AppBar(
|
// appBar: AppBar(
|
||||||
titleSpacing: -10,
|
// titleSpacing: -10,
|
||||||
backgroundColor: Colors.black,
|
// backgroundColor: Colors.black,
|
||||||
title: Text('Labels', style: TextStyle(color: Colors.white,),),
|
// title: Text('Labels', style: TextStyle(color: Colors.white,),),
|
||||||
leading: IconButton(
|
// leading: IconButton(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
Icons.keyboard_arrow_left,
|
// Icons.keyboard_arrow_left,
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
size: 35,
|
// size: 35,
|
||||||
),
|
// ),
|
||||||
onPressed: () => Navigator.of(context)
|
// onPressed: () => Navigator.of(context)
|
||||||
.pushReplacementNamed(Routes.labelResultScreen),
|
// .pushReplacementNamed(Routes.labelResultScreen),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
body: Consumer<ConnectivityProvider>(
|
// body: Consumer<ConnectivityProvider>(
|
||||||
builder: (ct, connection, _) {
|
// builder: (ct, connection, _) {
|
||||||
return connection.conStatus != 'offline'
|
// return connection.conStatus != 'offline'
|
||||||
? isInit
|
// ? isInit
|
||||||
? Center(
|
// ? Center(
|
||||||
child: CircularProgressIndicator(color: Colors.black),
|
// child: CircularProgressIndicator(color: Colors.black),
|
||||||
)
|
// )
|
||||||
: Form(
|
// : Form(
|
||||||
key: _form,
|
// key: _form,
|
||||||
child: Padding(
|
// child: Padding(
|
||||||
padding: EdgeInsets.all(20),
|
// padding: EdgeInsets.all(20),
|
||||||
child: ListView(
|
// child: ListView(
|
||||||
children: <Widget>[
|
// children: <Widget>[
|
||||||
Text(
|
// Text(
|
||||||
'Update a Label',
|
// 'Update a Label',
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 6 * _deviceBlockSize,
|
// fontSize: 6 * _deviceBlockSize,
|
||||||
letterSpacing: 3,
|
// letterSpacing: 3,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
TextFormField(
|
// TextFormField(
|
||||||
onChanged: (val) {
|
// onChanged: (val) {
|
||||||
setState(() {
|
// setState(() {
|
||||||
lotNumberCTRL.text =
|
// lotNumberCTRL.text =
|
||||||
val + ' - ' + cycleNumberCTRL.text;
|
// val + ' - ' + cycleNumberCTRL.text;
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
validator: (val) {
|
// validator: (val) {
|
||||||
if (val!.isEmpty) {
|
// if (val!.isEmpty) {
|
||||||
return 'Strilizer ID required!';
|
// return 'Strilizer ID required!';
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
controller: striizerIdCTRL,
|
// controller: striizerIdCTRL,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
icon: Icon(FontAwesomeIcons.sortNumericDown,
|
// icon: Icon(FontAwesomeIcons.sortNumericDown,
|
||||||
size: 7 * _deviceBlockSize),
|
// size: 7 * _deviceBlockSize),
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
labelText: 'Strilizer ID',
|
// labelText: 'Strilizer ID',
|
||||||
contentPadding: EdgeInsets.symmetric(
|
// contentPadding: EdgeInsets.symmetric(
|
||||||
vertical: 2, horizontal: 3),
|
// vertical: 2, horizontal: 3),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w100,
|
// fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
// fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
// fontSize: 5 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
keyboardType: TextInputType.visiblePassword,
|
// keyboardType: TextInputType.visiblePassword,
|
||||||
textInputAction: TextInputAction.next,
|
// textInputAction: TextInputAction.next,
|
||||||
onFieldSubmitted: (_) {
|
// onFieldSubmitted: (_) {
|
||||||
FocusScope.of(context)
|
// FocusScope.of(context)
|
||||||
.requestFocus(_cycleNumberFocusNode);
|
// .requestFocus(_cycleNumberFocusNode);
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
TextFormField(
|
// TextFormField(
|
||||||
onChanged: (val) {
|
// onChanged: (val) {
|
||||||
setState(
|
// setState(
|
||||||
() {
|
// () {
|
||||||
lotNumberCTRL.text =
|
// lotNumberCTRL.text =
|
||||||
striizerIdCTRL.text + ' - ' + val;
|
// striizerIdCTRL.text + ' - ' + val;
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
validator: (val) {
|
// validator: (val) {
|
||||||
if (val!.isEmpty) {
|
// if (val!.isEmpty) {
|
||||||
return 'Cycle number required!';
|
// return 'Cycle number required!';
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
controller: cycleNumberCTRL,
|
// controller: cycleNumberCTRL,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
FontAwesomeIcons.sortNumericDown,
|
// FontAwesomeIcons.sortNumericDown,
|
||||||
size: 7 * _deviceBlockSize,
|
// size: 7 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w100,
|
// fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
// fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
labelText: 'Cycle Number',
|
// labelText: 'Cycle Number',
|
||||||
contentPadding: EdgeInsets.symmetric(
|
// contentPadding: EdgeInsets.symmetric(
|
||||||
vertical: 2, horizontal: 3),
|
// vertical: 2, horizontal: 3),
|
||||||
),
|
// ),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
// fontSize: 5 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
focusNode: _cycleNumberFocusNode,
|
// focusNode: _cycleNumberFocusNode,
|
||||||
keyboardType: TextInputType.number,
|
// keyboardType: TextInputType.number,
|
||||||
textInputAction: TextInputAction.done,
|
// textInputAction: TextInputAction.done,
|
||||||
onFieldSubmitted: (_) {
|
// onFieldSubmitted: (_) {
|
||||||
FocusScope.of(context)
|
// FocusScope.of(context)
|
||||||
.requestFocus(_lotNumberFocusNode);
|
// .requestFocus(_lotNumberFocusNode);
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
TextFormField(
|
// TextFormField(
|
||||||
readOnly: true,
|
// readOnly: true,
|
||||||
controller: lotNumberCTRL,
|
// controller: lotNumberCTRL,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
FontAwesomeIcons.sortNumericDown,
|
// FontAwesomeIcons.sortNumericDown,
|
||||||
size: 7 * _deviceBlockSize,
|
// size: 7 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w100,
|
// fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
// fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
labelText: 'Lot Number',
|
// labelText: 'Lot Number',
|
||||||
contentPadding: EdgeInsets.symmetric(
|
// contentPadding: EdgeInsets.symmetric(
|
||||||
vertical: 2,
|
// vertical: 2,
|
||||||
horizontal: 3,
|
// horizontal: 3,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
// fontSize: 5 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
keyboardType: TextInputType.visiblePassword,
|
// keyboardType: TextInputType.visiblePassword,
|
||||||
focusNode: _lotNumberFocusNode,
|
// focusNode: _lotNumberFocusNode,
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
// LabelAddSelectorBox(
|
// // LabelAddSelectorBox(
|
||||||
// deviceBlockSize: _deviceBlockSize,
|
// // deviceBlockSize: _deviceBlockSize,
|
||||||
// packageCTRL: packageCTRL,
|
// // packageCTRL: packageCTRL,
|
||||||
// packageVals: packageVals,
|
// // packageVals: packageVals,
|
||||||
// packageValue: packageValue,
|
// // packageValue: packageValue,
|
||||||
// ),
|
// // ),
|
||||||
// SizedBox(
|
// // SizedBox(
|
||||||
// height: 20,
|
// // height: 20,
|
||||||
// ),
|
// // ),
|
||||||
LabelAddDatePicker(
|
// LabelAddDatePicker(
|
||||||
dateCTRL: sDateCTRL,
|
// dateCTRL: sDateCTRL,
|
||||||
deviceBlockSize: _deviceBlockSize,
|
// deviceBlockSize: _deviceBlockSize,
|
||||||
label: 'Sterile Date',
|
// label: 'Sterile Date',
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
LabelAddDatePicker(
|
// LabelAddDatePicker(
|
||||||
dateCTRL: eDateCTRL,
|
// dateCTRL: eDateCTRL,
|
||||||
deviceBlockSize: _deviceBlockSize,
|
// deviceBlockSize: _deviceBlockSize,
|
||||||
label: 'Expire Date',
|
// label: 'Expire Date',
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 70,
|
// height: 70,
|
||||||
),
|
// ),
|
||||||
LabelUpdateButton(
|
// LabelUpdateButton(
|
||||||
form: _form,
|
// form: _form,
|
||||||
id: datas!.id,
|
// id: datas!.id,
|
||||||
lotNumberCTRL: lotNumberCTRL,
|
// lotNumberCTRL: lotNumberCTRL,
|
||||||
cycleNumberCTRL: cycleNumberCTRL,
|
// cycleNumberCTRL: cycleNumberCTRL,
|
||||||
sDateCTRL: sDateCTRL,
|
// sDateCTRL: sDateCTRL,
|
||||||
// packageValue: packageValue,
|
// // packageValue: packageValue,
|
||||||
eDateCTRL: eDateCTRL,
|
// eDateCTRL: eDateCTRL,
|
||||||
striizerIdCTRL: striizerIdCTRL,
|
// striizerIdCTRL: striizerIdCTRL,
|
||||||
deviceBlockSize: _deviceBlockSize,
|
// deviceBlockSize: _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 100,
|
// height: 100,
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
)
|
// )
|
||||||
: ConnectionErrorBox();
|
// : ConnectionErrorBox();
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -37,10 +37,8 @@ class _MyItemsMineScreenState extends State<MyItemsMineScreen> {
|
|||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
if (_isInit) {
|
if (_isInit) {
|
||||||
var myItemResults = Provider.of<MyItemProvider>(context);
|
var myItemResults = Provider.of<MyItemProvider>(context);
|
||||||
final userData = Provider.of<Auth>(context, listen: false).user;
|
|
||||||
myItemResults.setLoading();
|
myItemResults.setLoading();
|
||||||
myItemResults.resetPageNumber();
|
myItemResults.resetPageNumber();
|
||||||
if (userData['roles']?.contains('User')) {
|
|
||||||
myItemResults.getMyItems().then(
|
myItemResults.getMyItems().then(
|
||||||
(_) {
|
(_) {
|
||||||
myItemResults.resetLoading();
|
myItemResults.resetLoading();
|
||||||
@@ -58,23 +56,6 @@ class _MyItemsMineScreenState extends State<MyItemsMineScreen> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
myItemResults.getHospitalItems().then((_) {
|
|
||||||
myItemResults.resetLoading();
|
|
||||||
sc!.addListener(
|
|
||||||
() {
|
|
||||||
if (sc!.position.pixels == sc!.position.maxScrollExtent &&
|
|
||||||
searchCTRL.text == '') {
|
|
||||||
var myItemResults = Provider.of<MyItemProvider>(
|
|
||||||
context,
|
|
||||||
listen: false,
|
|
||||||
);
|
|
||||||
myItemResults.getHospitalItems();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_isInit = false;
|
_isInit = false;
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
@@ -177,13 +158,8 @@ class _MyItemsMineScreenState extends State<MyItemsMineScreen> {
|
|||||||
textInputType: TextInputType.visiblePassword,
|
textInputType: TextInputType.visiblePassword,
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
if (userData['roles']?.contains('User')) {
|
Provider.of<MyItemProvider>(context, listen: false)
|
||||||
Provider.of<MyItemProvider>(context, listen: false)
|
.searchMyItems(value);
|
||||||
.searchMyItems(value);
|
|
||||||
} else {
|
|
||||||
Provider.of<MyItemProvider>(context, listen: false)
|
|
||||||
.searchHospitalItems(value);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -201,11 +177,13 @@ class _MyItemsMineScreenState extends State<MyItemsMineScreen> {
|
|||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
if (userData['roles']?.contains('User')) {
|
|
||||||
return MyItemsItemDataBox(
|
return MyItemsItemDataBox(
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
isAdmin: false,
|
isAdmin:
|
||||||
items: itemResults.myItems?[index],
|
userData['roles']?.contains('User')
|
||||||
|
? false
|
||||||
|
: true,
|
||||||
|
items: itemResults.myItems?[index],
|
||||||
push: () {
|
push: () {
|
||||||
Navigator.pushNamed(context,
|
Navigator.pushNamed(context,
|
||||||
Routes.myItemsHistoryScreen,
|
Routes.myItemsHistoryScreen,
|
||||||
@@ -213,26 +191,8 @@ class _MyItemsMineScreenState extends State<MyItemsMineScreen> {
|
|||||||
itemResults.myItems?[index]);
|
itemResults.myItems?[index]);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
return MyItemsItemDataBox(
|
|
||||||
deviceBlockSize: _deviceBlockSize,
|
|
||||||
isAdmin: true,
|
|
||||||
items:
|
|
||||||
itemResults.hospitalItems?[index],
|
|
||||||
push: () {
|
|
||||||
Navigator.pushNamed(
|
|
||||||
context,
|
|
||||||
Routes.myItemsHistoryScreen,
|
|
||||||
arguments: itemResults
|
|
||||||
.hospitalItems?[index],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
itemCount: userData['roles']?.contains('User')
|
itemCount: itemResults.myItems?.length,
|
||||||
? itemResults.myItems?.length
|
|
||||||
: itemResults.hospitalItems?.length,
|
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,44 +33,24 @@ class _MyItemsRequestsScreenState extends State<MyItemsRequestsScreen> {
|
|||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
if (_isInit) {
|
if (_isInit) {
|
||||||
var itemResults = Provider.of<MyItemProvider>(context);
|
var itemResults = Provider.of<MyItemProvider>(context);
|
||||||
final userData = Provider.of<Auth>(context, listen: false).user;
|
|
||||||
itemResults.setLoading();
|
itemResults.setLoading();
|
||||||
itemResults.resetPageNumber();
|
itemResults.resetPageNumber();
|
||||||
if (userData['roles']?.contains('User')) {
|
itemResults.getMyItemRequests().then(
|
||||||
itemResults.getMyItemRequests().then(
|
(_) {
|
||||||
(_) {
|
itemResults.resetLoading();
|
||||||
itemResults.resetLoading();
|
sc?.addListener(
|
||||||
sc?.addListener(
|
() {
|
||||||
() {
|
if (sc!.position.pixels == sc!.position.maxScrollExtent) {
|
||||||
if (sc!.position.pixels == sc!.position.maxScrollExtent) {
|
var itemResults = Provider.of<MyItemProvider>(
|
||||||
var itemResults = Provider.of<MyItemProvider>(
|
context,
|
||||||
context,
|
listen: false,
|
||||||
listen: false,
|
);
|
||||||
);
|
itemResults.getMyItemRequests();
|
||||||
itemResults.getMyItemRequests();
|
}
|
||||||
}
|
},
|
||||||
},
|
);
|
||||||
);
|
},
|
||||||
},
|
);
|
||||||
);
|
|
||||||
} else {
|
|
||||||
itemResults.getHospitalItemRequests().then(
|
|
||||||
(_) {
|
|
||||||
itemResults.resetLoading();
|
|
||||||
sc?.addListener(
|
|
||||||
() {
|
|
||||||
if (sc!.position.pixels == sc!.position.maxScrollExtent) {
|
|
||||||
var itemResults = Provider.of<MyItemProvider>(
|
|
||||||
context,
|
|
||||||
listen: false,
|
|
||||||
);
|
|
||||||
itemResults.getHospitalItemRequests();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_isInit = false;
|
_isInit = false;
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
@@ -116,29 +96,18 @@ class _MyItemsRequestsScreenState extends State<MyItemsRequestsScreen> {
|
|||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
if (userData['roles']?.contains('User')) {
|
return RequestsDataBox(
|
||||||
return RequestsDataBox(
|
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
isAdmin: false,
|
isAdmin:
|
||||||
|
userData['roles']?.contains('User')
|
||||||
|
? false
|
||||||
|
: true,
|
||||||
item: itemResults
|
item: itemResults
|
||||||
.originalMyItemsRequests?[index],
|
.originalMyItemsRequests?[index],
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
return RequestsDataBox(
|
|
||||||
deviceBlockSize: _deviceBlockSize,
|
|
||||||
isAdmin: true,
|
|
||||||
item: itemResults
|
|
||||||
.originalHospitalItemsRequests?[
|
|
||||||
index],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
itemCount: userData['roles']?.contains('User')
|
itemCount: itemResults
|
||||||
? itemResults
|
.originalMyItemsRequests?.length,
|
||||||
.originalMyItemsRequests?.length
|
|
||||||
: itemResults
|
|
||||||
.originalHospitalItemsRequests
|
|
||||||
?.length,
|
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
// ignore_for_file: public_member_api_docs, sort_constructors_first
|
// ignore_for_file: public_member_api_docs, sort_constructors_first
|
||||||
import 'package:cssd/config/routes.dart';
|
import 'package:cssd/config/routes.dart';
|
||||||
import 'package:cssd/providers/auth.dart';
|
import 'package:cssd/providers/auth.dart';
|
||||||
@@ -37,10 +38,8 @@ class _MyPackagesMineScreenState extends State<MyPackagesMineScreen> {
|
|||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
if (_isInit) {
|
if (_isInit) {
|
||||||
var myPackageResults = Provider.of<MyPackageProvider>(context);
|
var myPackageResults = Provider.of<MyPackageProvider>(context);
|
||||||
final userData = Provider.of<Auth>(context, listen: false).user;
|
|
||||||
myPackageResults.setLoading();
|
myPackageResults.setLoading();
|
||||||
myPackageResults.resetPageNumber();
|
myPackageResults.resetPageNumber();
|
||||||
if (userData['roles']?.contains('User')) {
|
|
||||||
myPackageResults.getMyPackages().then(
|
myPackageResults.getMyPackages().then(
|
||||||
(_) {
|
(_) {
|
||||||
myPackageResults.resetLoading();
|
myPackageResults.resetLoading();
|
||||||
@@ -58,23 +57,6 @@ class _MyPackagesMineScreenState extends State<MyPackagesMineScreen> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
myPackageResults.getHospitalPackages().then((_) {
|
|
||||||
myPackageResults.resetLoading();
|
|
||||||
sc!.addListener(
|
|
||||||
() {
|
|
||||||
if (sc!.position.pixels == sc!.position.maxScrollExtent &&
|
|
||||||
searchCTRL.text == '') {
|
|
||||||
var myPackageResults = Provider.of<MyPackageProvider>(
|
|
||||||
context,
|
|
||||||
listen: false,
|
|
||||||
);
|
|
||||||
myPackageResults.getHospitalPackages();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_isInit = false;
|
_isInit = false;
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
@@ -149,13 +131,8 @@ class _MyPackagesMineScreenState extends State<MyPackagesMineScreen> {
|
|||||||
text: 'package',
|
text: 'package',
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
if (userData['roles']?.contains('User')) {
|
Provider.of<MyPackageProvider>(context, listen: false)
|
||||||
Provider.of<MyPackageProvider>(context, listen: false)
|
.searchMyPackages(value);
|
||||||
.searchMyPackages(value);
|
|
||||||
} else {
|
|
||||||
Provider.of<MyPackageProvider>(context, listen: false)
|
|
||||||
.searchHospitalPackages(value);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -173,37 +150,23 @@ class _MyPackagesMineScreenState extends State<MyPackagesMineScreen> {
|
|||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
if (userData['roles']?.contains('User')) {
|
return MyPackagesItemDataBox(
|
||||||
return MyPackagesItemDataBox(
|
deviceBlockSize: _deviceBlockSize,
|
||||||
deviceBlockSize: _deviceBlockSize,
|
isAdmin:
|
||||||
isAdmin: false,
|
userData['roles']?.contains('User')
|
||||||
packages:
|
? false
|
||||||
packageResults.myPackages?[index],
|
: true,
|
||||||
push: () {
|
packages:
|
||||||
Navigator.pushNamed(context,
|
packageResults.myPackages?[index],
|
||||||
Routes.myPackagesHistoryScreen,
|
push: () {
|
||||||
arguments: packageResults
|
Navigator.pushNamed(context,
|
||||||
.myPackages?[index]);
|
Routes.myPackagesHistoryScreen,
|
||||||
},
|
arguments: packageResults
|
||||||
);
|
.myPackages?[index]);
|
||||||
} else {
|
},
|
||||||
return MyPackagesItemDataBox(
|
);
|
||||||
deviceBlockSize: _deviceBlockSize,
|
|
||||||
isAdmin: true,
|
|
||||||
packages: packageResults
|
|
||||||
.hospitalPackages?[index],
|
|
||||||
push: () {
|
|
||||||
Navigator.pushNamed(context,
|
|
||||||
Routes.myPackagesHistoryScreen,
|
|
||||||
arguments: packageResults
|
|
||||||
.hospitalPackages?[index]);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
itemCount: userData['roles']?.contains('User')
|
itemCount: packageResults.myPackages?.length,
|
||||||
? packageResults.myPackages?.length
|
|
||||||
: packageResults.hospitalPackages?.length,
|
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -34,10 +34,8 @@ class _MyPackagesRequestsScreenState extends State<MyPackagesRequestsScreen> {
|
|||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
if (_isInit) {
|
if (_isInit) {
|
||||||
var packageResults = Provider.of<MyPackageProvider>(context);
|
var packageResults = Provider.of<MyPackageProvider>(context);
|
||||||
final userData = Provider.of<Auth>(context, listen: false).user;
|
|
||||||
packageResults.setLoading();
|
packageResults.setLoading();
|
||||||
packageResults.resetPageNumber();
|
packageResults.resetPageNumber();
|
||||||
if (userData['roles']?.contains('User')) {
|
|
||||||
packageResults.getMyPackageRequests().then(
|
packageResults.getMyPackageRequests().then(
|
||||||
(_) {
|
(_) {
|
||||||
packageResults.resetLoading();
|
packageResults.resetLoading();
|
||||||
@@ -54,24 +52,6 @@ class _MyPackagesRequestsScreenState extends State<MyPackagesRequestsScreen> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
packageResults.getHospitalPackageRequests().then(
|
|
||||||
(_) {
|
|
||||||
packageResults.resetLoading();
|
|
||||||
sc?.addListener(
|
|
||||||
() {
|
|
||||||
if (sc!.position.pixels == sc!.position.maxScrollExtent) {
|
|
||||||
var packageResults = Provider.of<MyPackageProvider>(
|
|
||||||
context,
|
|
||||||
listen: false,
|
|
||||||
);
|
|
||||||
packageResults.getHospitalPackageRequests();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_isInit = false;
|
_isInit = false;
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
@@ -117,29 +97,18 @@ class _MyPackagesRequestsScreenState extends State<MyPackagesRequestsScreen> {
|
|||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
if (userData['roles']?.contains('User')) {
|
return PackageRequestsDataBox(
|
||||||
return PackageRequestsDataBox(
|
deviceBlockSize: _deviceBlockSize,
|
||||||
deviceBlockSize: _deviceBlockSize,
|
isAdmin:
|
||||||
isAdmin: false,
|
userData['roles']?.contains('User')
|
||||||
package: packageResults
|
? false
|
||||||
.originalMyPackagesRequests?[index],
|
: true,
|
||||||
);
|
package: packageResults
|
||||||
} else {
|
.originalMyPackagesRequests?[index],
|
||||||
return PackageRequestsDataBox(
|
);
|
||||||
deviceBlockSize: _deviceBlockSize,
|
|
||||||
isAdmin: true,
|
|
||||||
package: packageResults
|
|
||||||
.originalHospitalPackagesRequests?[
|
|
||||||
index],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
itemCount: userData['roles']?.contains('User')
|
itemCount: packageResults
|
||||||
? packageResults
|
.originalMyPackagesRequests?.length,
|
||||||
.originalMyPackagesRequests?.length
|
|
||||||
: packageResults
|
|
||||||
.originalHospitalPackagesRequests
|
|
||||||
?.length,
|
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
|
// ignore_for_file: unused_local_variable
|
||||||
|
|
||||||
|
import 'dart:isolate';
|
||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:cssd/config/colors.dart';
|
import 'package:cssd/config/colors.dart';
|
||||||
import 'package:cssd/providers/packages.dart';
|
import 'package:cssd/providers/packages.dart';
|
||||||
import 'package:cssd/widgets/PackageScreens/Filter/package_filter_object.dart';
|
import 'package:cssd/widgets/PackageScreens/Filter/package_filter_object.dart';
|
||||||
import 'package:cssd/widgets/PackageScreens/Result/package_data_box.dart';
|
import 'package:cssd/widgets/PackageScreens/Result/package_data_box.dart';
|
||||||
|
import 'package:flutter_downloader/flutter_downloader.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
|
||||||
import '../../config/routes.dart';
|
import '../../config/routes.dart';
|
||||||
import '../../providers/connectivity.dart';
|
import '../../providers/connectivity.dart';
|
||||||
@@ -25,11 +32,30 @@ class _PackageResultScreenState extends State<PackageResultScreen> {
|
|||||||
bool _isInit = true;
|
bool _isInit = true;
|
||||||
ScrollController? sc;
|
ScrollController? sc;
|
||||||
TextEditingController searchCTRL = new TextEditingController();
|
TextEditingController searchCTRL = new TextEditingController();
|
||||||
|
ReceivePort _port = ReceivePort();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
sc = new ScrollController();
|
sc = new ScrollController();
|
||||||
super.initState();
|
super.initState();
|
||||||
|
IsolateNameServer.registerPortWithName(_port.sendPort, 'downloader_send_port');
|
||||||
|
_port.listen((dynamic data) {
|
||||||
|
String id = data[0];
|
||||||
|
DownloadTaskStatus status = data[1];
|
||||||
|
int progress = data[2];
|
||||||
|
if (status == DownloadTaskStatus.complete) {
|
||||||
|
print('Downloaded');
|
||||||
|
}
|
||||||
|
setState((){ });
|
||||||
|
});
|
||||||
|
|
||||||
|
FlutterDownloader.registerCallback(downloadCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
@pragma('vm:entry-point')
|
||||||
|
static void downloadCallback(String id, int status, int progress) {
|
||||||
|
final SendPort? send = IsolateNameServer.lookupPortByName('downloader_send_port');
|
||||||
|
send!.send([id, status, progress]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -58,6 +84,12 @@ class _PackageResultScreenState extends State<PackageResultScreen> {
|
|||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
IsolateNameServer.removePortNameMapping('downloader_send_port');
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final _media = MediaQuery.of(context);
|
final _media = MediaQuery.of(context);
|
||||||
@@ -225,6 +257,30 @@ class PackageResultFloatingButton extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
|
InkWell(
|
||||||
|
customBorder: CircleBorder(),
|
||||||
|
onTap: () async {
|
||||||
|
var status = await Permission.storage.request();
|
||||||
|
if (status.isGranted) {
|
||||||
|
Provider.of<PackageProvider>(context, listen: false).exportPackages();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(_deviceBlockSize),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
Icons.import_export,
|
||||||
|
size: 10 * _deviceBlockSize,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 2 * _deviceBlockSize,
|
||||||
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
customBorder: CircleBorder(),
|
customBorder: CircleBorder(),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|||||||
@@ -1,241 +1,241 @@
|
|||||||
import 'package:cssd/models/package_model.dart';
|
// import 'package:cssd/models/package_model.dart';
|
||||||
import 'package:cssd/providers/packages.dart';
|
// import 'package:cssd/providers/packages.dart';
|
||||||
import 'package:cssd/widgets/PackageScreens/Add/package_update_button.dart';
|
// import 'package:cssd/widgets/PackageScreens/Add/package_update_button.dart';
|
||||||
import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
// import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:provider/provider.dart';
|
// import 'package:provider/provider.dart';
|
||||||
import '../../config/routes.dart';
|
// import '../../config/routes.dart';
|
||||||
import '../../providers/connectivity.dart';
|
// import '../../providers/connectivity.dart';
|
||||||
import '../../widgets/Global/internet_error.dart';
|
// import '../../widgets/Global/internet_error.dart';
|
||||||
|
|
||||||
class PackageUpdateScreen extends StatefulWidget {
|
// class PackageUpdateScreen extends StatefulWidget {
|
||||||
@override
|
// @override
|
||||||
_PackageUpdateScreenState createState() => _PackageUpdateScreenState();
|
// _PackageUpdateScreenState createState() => _PackageUpdateScreenState();
|
||||||
}
|
// }
|
||||||
|
|
||||||
class _PackageUpdateScreenState extends State<PackageUpdateScreen> {
|
// class _PackageUpdateScreenState extends State<PackageUpdateScreen> {
|
||||||
final _udiFocusNode = FocusNode();
|
// final _udiFocusNode = FocusNode();
|
||||||
final _descriptionFocusNode = FocusNode();
|
// final _descriptionFocusNode = FocusNode();
|
||||||
TextEditingController nameCTRL = new TextEditingController();
|
// TextEditingController nameCTRL = new TextEditingController();
|
||||||
// TextEditingController udiCTRL = new TextEditingController();
|
// // TextEditingController udiCTRL = new TextEditingController();
|
||||||
TextEditingController descriptionCTRL = new TextEditingController();
|
// TextEditingController descriptionCTRL = new TextEditingController();
|
||||||
TextEditingController itemCTRL = new TextEditingController();
|
// TextEditingController itemCTRL = new TextEditingController();
|
||||||
|
|
||||||
final _form = GlobalKey<FormState>();
|
// final _form = GlobalKey<FormState>();
|
||||||
|
|
||||||
bool isEmpty = false;
|
// bool isEmpty = false;
|
||||||
bool isInit = true;
|
// bool isInit = true;
|
||||||
PackageDetailObject? datas;
|
// PackageDetailObject? datas;
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
void didChangeDependencies() async {
|
// void didChangeDependencies() async {
|
||||||
if (isInit) {
|
// if (isInit) {
|
||||||
var _id = ModalRoute.of(context)!.settings.arguments;
|
// var _id = ModalRoute.of(context)!.settings.arguments;
|
||||||
await Provider.of<PackageProvider>(context, listen: false)
|
// await Provider.of<PackageProvider>(context, listen: false)
|
||||||
.showPackageResult(_id.toString())
|
// .showPackageResult(_id.toString())
|
||||||
.then(
|
// .then(
|
||||||
(result) {
|
// (result) {
|
||||||
setState(
|
// setState(
|
||||||
() {
|
// () {
|
||||||
datas = result;
|
// datas = result;
|
||||||
nameCTRL.text = datas!.name;
|
// nameCTRL.text = datas!.name;
|
||||||
// udiCTRL.text = datas!.udi;
|
// // udiCTRL.text = datas!.udi;
|
||||||
descriptionCTRL.text = datas!.description;
|
// descriptionCTRL.text = datas!.description;
|
||||||
for (String item in datas!.items) {
|
// for (String item in datas!.items) {
|
||||||
itemCTRL.text = item;
|
// itemCTRL.text = item;
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
await Provider.of<PackageProvider>(context, listen: false)
|
// await Provider.of<PackageProvider>(context, listen: false)
|
||||||
.getItemFilters()
|
// .getItemFilters()
|
||||||
.then(
|
// .then(
|
||||||
(result) {
|
// (result) {
|
||||||
setState(
|
// setState(
|
||||||
() {
|
// () {
|
||||||
isInit = false;
|
// isInit = false;
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
super.didChangeDependencies();
|
// super.didChangeDependencies();
|
||||||
}
|
// }
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
final _media = MediaQuery.of(context);
|
// final _media = MediaQuery.of(context);
|
||||||
final double _devicewidth = _media.size.width;
|
// final double _devicewidth = _media.size.width;
|
||||||
final double _deviceBlockSize = _devicewidth / 100;
|
// final double _deviceBlockSize = _devicewidth / 100;
|
||||||
return WillPopScope(
|
// return WillPopScope(
|
||||||
onWillPop: () async {
|
// onWillPop: () async {
|
||||||
Navigator.pushReplacementNamed(
|
// Navigator.pushReplacementNamed(
|
||||||
context,
|
// context,
|
||||||
Routes.packageResultScreen,
|
// Routes.packageResultScreen,
|
||||||
);
|
// );
|
||||||
return true;
|
// return true;
|
||||||
},
|
// },
|
||||||
child: SafeArea(
|
// child: SafeArea(
|
||||||
child: Scaffold(
|
// child: Scaffold(
|
||||||
appBar: AppBar(
|
// appBar: AppBar(
|
||||||
titleSpacing: -10,
|
// titleSpacing: -10,
|
||||||
backgroundColor: Colors.black,
|
// backgroundColor: Colors.black,
|
||||||
title: Text('Packages', style: TextStyle(color: Colors.white,),),
|
// title: Text('Packages', style: TextStyle(color: Colors.white,),),
|
||||||
leading: IconButton(
|
// leading: IconButton(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
Icons.keyboard_arrow_left,
|
// Icons.keyboard_arrow_left,
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
size: 35,
|
// size: 35,
|
||||||
),
|
// ),
|
||||||
onPressed: () => Navigator.of(context)
|
// onPressed: () => Navigator.of(context)
|
||||||
.pushReplacementNamed(Routes.packageResultScreen),
|
// .pushReplacementNamed(Routes.packageResultScreen),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
body: Consumer<ConnectivityProvider>(
|
// body: Consumer<ConnectivityProvider>(
|
||||||
builder: (ct, connection, _) {
|
// builder: (ct, connection, _) {
|
||||||
return connection.conStatus != 'offline'
|
// return connection.conStatus != 'offline'
|
||||||
? isInit
|
// ? isInit
|
||||||
? Center(
|
// ? Center(
|
||||||
child: CircularProgressIndicator(color: Colors.black),
|
// child: CircularProgressIndicator(color: Colors.black),
|
||||||
)
|
// )
|
||||||
: Form(
|
// : Form(
|
||||||
key: _form,
|
// key: _form,
|
||||||
child: Padding(
|
// child: Padding(
|
||||||
padding: EdgeInsets.all(20),
|
// padding: EdgeInsets.all(20),
|
||||||
child: ListView(
|
// child: ListView(
|
||||||
children: <Widget>[
|
// children: <Widget>[
|
||||||
Text(
|
// Text(
|
||||||
'Update a Package',
|
// 'Update a Package',
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 6 * _deviceBlockSize,
|
// fontSize: 6 * _deviceBlockSize,
|
||||||
letterSpacing: 3,
|
// letterSpacing: 3,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
TextFormField(
|
// TextFormField(
|
||||||
validator: (val) {
|
// validator: (val) {
|
||||||
if (val!.isEmpty) {
|
// if (val!.isEmpty) {
|
||||||
return 'Name required!';
|
// return 'Name required!';
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
controller: nameCTRL,
|
// controller: nameCTRL,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
icon: Icon(FontAwesomeIcons.alignLeft,
|
// icon: Icon(FontAwesomeIcons.alignLeft,
|
||||||
size: 7 * _deviceBlockSize),
|
// size: 7 * _deviceBlockSize),
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
labelText: 'Package Name',
|
// labelText: 'Package Name',
|
||||||
contentPadding: EdgeInsets.symmetric(
|
// contentPadding: EdgeInsets.symmetric(
|
||||||
vertical: 2, horizontal: 3),
|
// vertical: 2, horizontal: 3),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w100,
|
// fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
// fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
// fontSize: 5 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
keyboardType: TextInputType.text,
|
// keyboardType: TextInputType.text,
|
||||||
textInputAction: TextInputAction.next,
|
// textInputAction: TextInputAction.next,
|
||||||
onFieldSubmitted: (_) {
|
// onFieldSubmitted: (_) {
|
||||||
FocusScope.of(context)
|
// FocusScope.of(context)
|
||||||
.requestFocus(_udiFocusNode);
|
// .requestFocus(_udiFocusNode);
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
// TextFormField(
|
// // TextFormField(
|
||||||
// validator: (val) {
|
// // validator: (val) {
|
||||||
// if (val!.isEmpty) {
|
// // if (val!.isEmpty) {
|
||||||
// return 'UDI required!';
|
// // return 'UDI required!';
|
||||||
// }
|
// // }
|
||||||
// return null;
|
// // return null;
|
||||||
// },
|
// // },
|
||||||
// controller: udiCTRL,
|
// // controller: udiCTRL,
|
||||||
// decoration: InputDecoration(
|
// // decoration: InputDecoration(
|
||||||
// icon: Icon(
|
// // icon: Icon(
|
||||||
// FontAwesomeIcons.alignLeft,
|
// // FontAwesomeIcons.alignLeft,
|
||||||
// size: 7 * _deviceBlockSize,
|
// // size: 7 * _deviceBlockSize,
|
||||||
// ),
|
// // ),
|
||||||
// labelStyle: TextStyle(
|
// // labelStyle: TextStyle(
|
||||||
// fontWeight: FontWeight.w100,
|
// // fontWeight: FontWeight.w100,
|
||||||
// fontSize: 4 * _deviceBlockSize,
|
// // fontSize: 4 * _deviceBlockSize,
|
||||||
// ),
|
// // ),
|
||||||
// isDense: true,
|
// // isDense: true,
|
||||||
// labelText: 'UDI',
|
// // labelText: 'UDI',
|
||||||
// contentPadding: EdgeInsets.symmetric(
|
// // contentPadding: EdgeInsets.symmetric(
|
||||||
// vertical: 2, horizontal: 3),
|
// // vertical: 2, horizontal: 3),
|
||||||
// ),
|
// // ),
|
||||||
// style: TextStyle(
|
// // style: TextStyle(
|
||||||
// fontWeight: FontWeight.w700,
|
// // fontWeight: FontWeight.w700,
|
||||||
// fontSize: 5 * _deviceBlockSize,
|
// // fontSize: 5 * _deviceBlockSize,
|
||||||
// ),
|
// // ),
|
||||||
// focusNode: _udiFocusNode,
|
// // focusNode: _udiFocusNode,
|
||||||
// keyboardType: TextInputType.text,
|
// // keyboardType: TextInputType.text,
|
||||||
// textInputAction: TextInputAction.done,
|
// // textInputAction: TextInputAction.done,
|
||||||
// onFieldSubmitted: (_) {
|
// // onFieldSubmitted: (_) {
|
||||||
// FocusScope.of(context)
|
// // FocusScope.of(context)
|
||||||
// .requestFocus(_descriptionFocusNode);
|
// // .requestFocus(_descriptionFocusNode);
|
||||||
// },
|
// // },
|
||||||
// ),
|
// // ),
|
||||||
// SizedBox(
|
// // SizedBox(
|
||||||
// height: 20,
|
// // height: 20,
|
||||||
// ),
|
// // ),
|
||||||
TextFormField(
|
// TextFormField(
|
||||||
controller: descriptionCTRL,
|
// controller: descriptionCTRL,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
FontAwesomeIcons.alignLeft,
|
// FontAwesomeIcons.alignLeft,
|
||||||
size: 7 * _deviceBlockSize,
|
// size: 7 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
labelStyle: TextStyle(
|
// labelStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w100,
|
// fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
// fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
isDense: true,
|
// isDense: true,
|
||||||
labelText: 'Description',
|
// labelText: 'Description',
|
||||||
contentPadding: EdgeInsets.symmetric(
|
// contentPadding: EdgeInsets.symmetric(
|
||||||
vertical: 2, horizontal: 3),
|
// vertical: 2, horizontal: 3),
|
||||||
),
|
// ),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
// fontWeight: FontWeight.w700,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
// fontSize: 5 * _deviceBlockSize,
|
||||||
),
|
// ),
|
||||||
keyboardType: TextInputType.multiline,
|
// keyboardType: TextInputType.multiline,
|
||||||
focusNode: _descriptionFocusNode,
|
// focusNode: _descriptionFocusNode,
|
||||||
minLines: 1,
|
// minLines: 1,
|
||||||
maxLines: 5,
|
// maxLines: 5,
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 70,
|
// height: 70,
|
||||||
),
|
// ),
|
||||||
PackageUpdateButton(
|
// PackageUpdateButton(
|
||||||
form: _form,
|
// form: _form,
|
||||||
id: datas!.id,
|
// id: datas!.id,
|
||||||
nameCTRL: nameCTRL,
|
// nameCTRL: nameCTRL,
|
||||||
// udiCTRL: udiCTRL,
|
// // udiCTRL: udiCTRL,
|
||||||
itemCTRL: itemCTRL,
|
// itemCTRL: itemCTRL,
|
||||||
deviceBlockSize: _deviceBlockSize,
|
// deviceBlockSize: _deviceBlockSize,
|
||||||
descriptionCTRL: descriptionCTRL,
|
// descriptionCTRL: descriptionCTRL,
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 100,
|
// height: 100,
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
)
|
// )
|
||||||
: ConnectionErrorBox();
|
// : ConnectionErrorBox();
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import 'package:cssd/models/my_item_model.dart';
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter_downloader/flutter_downloader.dart';
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:random_string/random_string.dart';
|
import 'package:random_string/random_string.dart';
|
||||||
|
|
||||||
import '../config/urls.dart';
|
import '../config/urls.dart';
|
||||||
@@ -102,7 +104,6 @@ class ItemProvider extends ChangeNotifier {
|
|||||||
FormData formData = new FormData.fromMap(
|
FormData formData = new FormData.fromMap(
|
||||||
{
|
{
|
||||||
"batch_id": batchId,
|
"batch_id": batchId,
|
||||||
'model_type': 'Item',
|
|
||||||
"file": MultipartFile.fromBytes(imageListInt, filename: fileName)
|
"file": MultipartFile.fromBytes(imageListInt, filename: fileName)
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -139,7 +140,7 @@ class ItemProvider extends ChangeNotifier {
|
|||||||
'specific': specific,
|
'specific': specific,
|
||||||
'name': name,
|
'name': name,
|
||||||
'udi': udi,
|
'udi': udi,
|
||||||
'file_batch_id': batchId,
|
'batch_id': batchId,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
headers: {
|
headers: {
|
||||||
@@ -288,6 +289,7 @@ class ItemProvider extends ChangeNotifier {
|
|||||||
userName: item['user'] != null ? item['user']['name'] : '',
|
userName: item['user'] != null ? item['user']['name'] : '',
|
||||||
status: item['status'],
|
status: item['status'],
|
||||||
udi: item['udi'],
|
udi: item['udi'],
|
||||||
|
packageId: item['package_id'],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -306,6 +308,7 @@ class ItemProvider extends ChangeNotifier {
|
|||||||
description: 'null',
|
description: 'null',
|
||||||
name: 'null',
|
name: 'null',
|
||||||
userName: 'null',
|
userName: 'null',
|
||||||
|
userCreator: 'null',
|
||||||
specific: 'null',
|
specific: 'null',
|
||||||
hospital: 'null',
|
hospital: 'null',
|
||||||
size: 'null',
|
size: 'null',
|
||||||
@@ -313,6 +316,7 @@ class ItemProvider extends ChangeNotifier {
|
|||||||
udi: 'null',
|
udi: 'null',
|
||||||
status: 0,
|
status: 0,
|
||||||
filePath: [],
|
filePath: [],
|
||||||
|
packageId: 'null',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
var data = json.decode(response.body)['data'];
|
var data = json.decode(response.body)['data'];
|
||||||
@@ -333,11 +337,13 @@ class ItemProvider extends ChangeNotifier {
|
|||||||
hospital:
|
hospital:
|
||||||
data['user'] != null ? data['user']['medical_center']['name'] : '',
|
data['user'] != null ? data['user']['medical_center']['name'] : '',
|
||||||
userName: data['user'] != null ? data['user']['name'] : '',
|
userName: data['user'] != null ? data['user']['name'] : '',
|
||||||
|
userCreator: data['creator'] != null ? data['creator']['name'] : '',
|
||||||
size: data['size'] != null ? data['size'] : '',
|
size: data['size'] != null ? data['size'] : '',
|
||||||
specific: data['specific'] != null ? data['specific'] : '',
|
specific: data['specific'] != null ? data['specific'] : '',
|
||||||
createdAt: data['created_at'] != null ? data['created_at'] : '',
|
createdAt: data['created_at'] != null ? data['created_at'] : '',
|
||||||
udi: data['udi'] != null ? data['udi'] : '',
|
udi: data['udi'] != null ? data['udi'] : '',
|
||||||
status: data['status'],
|
status: data['status'],
|
||||||
|
packageId: data['package_id'],
|
||||||
filePath: mediaList,
|
filePath: mediaList,
|
||||||
);
|
);
|
||||||
return result!;
|
return result!;
|
||||||
@@ -369,13 +375,14 @@ class ItemProvider extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> exportItems() async {
|
Future<bool> exportItems() async {
|
||||||
var response = await http.get(
|
final baseStorage = await getExternalStorageDirectory();
|
||||||
Uri.parse(
|
final taskId = await FlutterDownloader.enqueue(
|
||||||
Url.exportItems,
|
url: Url.exportItems,
|
||||||
),
|
savedDir: baseStorage!.path,
|
||||||
headers: {'Authorization': User.token},
|
showNotification: true,
|
||||||
|
openFileFromNotification: true,
|
||||||
);
|
);
|
||||||
print(response.body);
|
print(taskId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+76
-75
@@ -11,13 +11,13 @@ class MyItemProvider extends ChangeNotifier {
|
|||||||
String searchBoxValue = '';
|
String searchBoxValue = '';
|
||||||
bool filterOn = false;
|
bool filterOn = false;
|
||||||
List<MyItemResultObject>? myItems;
|
List<MyItemResultObject>? myItems;
|
||||||
List<MyItemResultObject>? hospitalItems;
|
// List<MyItemResultObject>? hospitalItems;
|
||||||
|
|
||||||
List<MyItemResultObject>? originalMyItems;
|
List<MyItemResultObject>? originalMyItems;
|
||||||
List<MyItemResultObject>? originalHospitalItems;
|
// List<MyItemResultObject>? originalHospitalItems;
|
||||||
|
|
||||||
List<MyItemResultObject>? originalMyItemsRequests;
|
List<MyItemResultObject>? originalMyItemsRequests;
|
||||||
List<MyItemResultObject>? originalHospitalItemsRequests;
|
// List<MyItemResultObject>? originalHospitalItemsRequests;
|
||||||
|
|
||||||
List<ItemHistoryObject>? itemHistory;
|
List<ItemHistoryObject>? itemHistory;
|
||||||
|
|
||||||
@@ -52,16 +52,16 @@ class MyItemProvider extends ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
void searchHospitalItems(String value) {
|
// void searchHospitalItems(String value) {
|
||||||
hospitalItems = [];
|
// hospitalItems = [];
|
||||||
searchBoxValue = value;
|
// searchBoxValue = value;
|
||||||
originalHospitalItems!.forEach((result) {
|
// originalHospitalItems!.forEach((result) {
|
||||||
if (result.udi.toString().contains(searchBoxValue)) {
|
// if (result.udi.toString().contains(searchBoxValue)) {
|
||||||
hospitalItems!.add(result);
|
// hospitalItems!.add(result);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
notifyListeners();
|
// notifyListeners();
|
||||||
}
|
// }
|
||||||
|
|
||||||
void setFilters(
|
void setFilters(
|
||||||
id,
|
id,
|
||||||
@@ -127,6 +127,7 @@ class MyItemProvider extends ChangeNotifier {
|
|||||||
id: item['id'].toString(),
|
id: item['id'].toString(),
|
||||||
size: item['size'].toString(),
|
size: item['size'].toString(),
|
||||||
udi: item['udi'],
|
udi: item['udi'],
|
||||||
|
userName: item['user'] != null ? item['user']['name'] : '',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -134,50 +135,50 @@ class MyItemProvider extends ChangeNotifier {
|
|||||||
searchMyItems('');
|
searchMyItems('');
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getHospitalItems() async {
|
// Future<void> getHospitalItems() async {
|
||||||
String url = Url.getHospitalItems(pageNumber);
|
// String url = Url.getHospitalItems(pageNumber);
|
||||||
if (filterOn) {
|
// if (filterOn) {
|
||||||
if (filters!.id != '') {
|
// if (filters!.id != '') {
|
||||||
url += '&item_id=${filters!.id}';
|
// url += '&item_id=${filters!.id}';
|
||||||
}
|
// }
|
||||||
if (filters!.name != '') {
|
// if (filters!.name != '') {
|
||||||
url += '&name=${filters!.name}';
|
// url += '&name=${filters!.name}';
|
||||||
}
|
// }
|
||||||
if (filters!.size != '') {
|
// if (filters!.size != '') {
|
||||||
url += '&size=${filters!.size}';
|
// url += '&size=${filters!.size}';
|
||||||
}
|
// }
|
||||||
if (filters!.specific != '') {
|
// if (filters!.specific != '') {
|
||||||
url += '&specific=${filters!.specific}';
|
// url += '&specific=${filters!.specific}';
|
||||||
}
|
// }
|
||||||
if (filters!.udi != '') {
|
// if (filters!.udi != '') {
|
||||||
url += '&udi=${filters!.udi}';
|
// url += '&udi=${filters!.udi}';
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
var response = await http.get(
|
// var response = await http.get(
|
||||||
Uri.parse(url),
|
// Uri.parse(url),
|
||||||
headers: {'Authorization': User.token, "Accept": "application/json"},
|
// headers: {'Authorization': User.token, "Accept": "application/json"},
|
||||||
);
|
// );
|
||||||
|
|
||||||
var itemsData = json.decode(response.body);
|
// var itemsData = json.decode(response.body);
|
||||||
|
|
||||||
if (pageNumber == 1) {
|
// if (pageNumber == 1) {
|
||||||
originalHospitalItems = [];
|
// originalHospitalItems = [];
|
||||||
}
|
// }
|
||||||
|
|
||||||
for (var item in itemsData['data']['data']) {
|
// for (var item in itemsData['data']['data']) {
|
||||||
originalHospitalItems!.add(
|
// originalHospitalItems!.add(
|
||||||
MyItemResultObject(
|
// MyItemResultObject(
|
||||||
name: item['name'],
|
// name: item['name'],
|
||||||
id: item['id'].toString(),
|
// id: item['id'].toString(),
|
||||||
size: item['size'].toString(),
|
// size: item['size'].toString(),
|
||||||
userName: item['user'] != null ? item['user']['name'] : '',
|
// userName: item['user'] != null ? item['user']['name'] : '',
|
||||||
udi: item['udi'],
|
// udi: item['udi'],
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
pageNumber += 1;
|
// pageNumber += 1;
|
||||||
searchHospitalItems('');
|
// searchHospitalItems('');
|
||||||
}
|
// }
|
||||||
|
|
||||||
Future<void> getItemsHistory(String id) async {
|
Future<void> getItemsHistory(String id) async {
|
||||||
String url = Url.getItemResult(id);
|
String url = Url.getItemResult(id);
|
||||||
@@ -230,30 +231,30 @@ class MyItemProvider extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getHospitalItemRequests() async {
|
// Future<void> getHospitalItemRequests() async {
|
||||||
String url = Url.getHospitalItemRequests;
|
// String url = Url.getHospitalItemRequests;
|
||||||
var response = await http.get(
|
// var response = await http.get(
|
||||||
Uri.parse(url),
|
// Uri.parse(url),
|
||||||
headers: {'Authorization': User.token, "Accept": "application/json"},
|
// headers: {'Authorization': User.token, "Accept": "application/json"},
|
||||||
);
|
// );
|
||||||
|
|
||||||
var itemsData = json.decode(response.body);
|
// var itemsData = json.decode(response.body);
|
||||||
print(itemsData);
|
// print(itemsData);
|
||||||
|
|
||||||
originalHospitalItemsRequests = [];
|
// originalHospitalItemsRequests = [];
|
||||||
|
|
||||||
for (var item in itemsData['data']) {
|
// for (var item in itemsData['data']) {
|
||||||
originalHospitalItemsRequests!.add(
|
// originalHospitalItemsRequests!.add(
|
||||||
MyItemResultObject(
|
// MyItemResultObject(
|
||||||
name: item['transferable']['name'].toString(),
|
// name: item['transferable']['name'].toString(),
|
||||||
id: item['transferable']['id'].toString(),
|
// id: item['transferable']['id'].toString(),
|
||||||
size: item['transferable']['size'].toString(),
|
// size: item['transferable']['size'].toString(),
|
||||||
userName: item['user'] != null ? item['user']['name'] : '',
|
// userName: item['user'] != null ? item['user']['name'] : '',
|
||||||
requestId: item['id'].toString(),
|
// requestId: item['id'].toString(),
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
Future<void> transferItems(String itemId, String userId) async {
|
Future<void> transferItems(String itemId, String userId) async {
|
||||||
var response = await http.post(
|
var response = await http.post(
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ class MyPackageProvider extends ChangeNotifier {
|
|||||||
String searchBoxValue = '';
|
String searchBoxValue = '';
|
||||||
bool filterOn = false;
|
bool filterOn = false;
|
||||||
List<MyPackageResultObject>? myPackages;
|
List<MyPackageResultObject>? myPackages;
|
||||||
List<MyPackageResultObject>? hospitalPackages;
|
// List<MyPackageResultObject>? hospitalPackages;
|
||||||
|
|
||||||
List<MyPackageResultObject>? originalMyPackages;
|
List<MyPackageResultObject>? originalMyPackages;
|
||||||
List<MyPackageResultObject>? originalHospitalPackages;
|
// List<MyPackageResultObject>? originalHospitalPackages;
|
||||||
|
|
||||||
List<MyPackageResultObject>? originalMyPackagesRequests;
|
List<MyPackageResultObject>? originalMyPackagesRequests;
|
||||||
List<MyPackageResultObject>? originalHospitalPackagesRequests;
|
// List<MyPackageResultObject>? originalHospitalPackagesRequests;
|
||||||
|
|
||||||
List<PackageHistoryObject>? packageHistory;
|
List<PackageHistoryObject>? packageHistory;
|
||||||
|
|
||||||
@@ -50,16 +50,16 @@ class MyPackageProvider extends ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
void searchHospitalPackages(String value) {
|
// void searchHospitalPackages(String value) {
|
||||||
hospitalPackages = [];
|
// hospitalPackages = [];
|
||||||
searchBoxValue = value;
|
// searchBoxValue = value;
|
||||||
originalHospitalPackages!.forEach((result) {
|
// originalHospitalPackages!.forEach((result) {
|
||||||
if (result.id.toString().contains(searchBoxValue)) {
|
// if (result.id.toString().contains(searchBoxValue)) {
|
||||||
hospitalPackages!.add(result);
|
// hospitalPackages!.add(result);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
notifyListeners();
|
// notifyListeners();
|
||||||
}
|
// }
|
||||||
|
|
||||||
void setFilters(
|
void setFilters(
|
||||||
id,
|
id,
|
||||||
@@ -110,6 +110,7 @@ class MyPackageProvider extends ChangeNotifier {
|
|||||||
name: package['name'],
|
name: package['name'],
|
||||||
id: package['id'].toString(),
|
id: package['id'].toString(),
|
||||||
createdAt: package['created_at'].toString(),
|
createdAt: package['created_at'].toString(),
|
||||||
|
userName: package['user'] != null ? package['user']['name'] : '',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -117,43 +118,43 @@ class MyPackageProvider extends ChangeNotifier {
|
|||||||
searchMyPackages('');
|
searchMyPackages('');
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getHospitalPackages() async {
|
// Future<void> getHospitalPackages() async {
|
||||||
String url = Url.getHospitalPackages(pageNumber);
|
// String url = Url.getHospitalPackages(pageNumber);
|
||||||
if (filterOn) {
|
// if (filterOn) {
|
||||||
if (filters!.id != '') {
|
// if (filters!.id != '') {
|
||||||
url += '&package_id=${filters!.id}';
|
// url += '&package_id=${filters!.id}';
|
||||||
}
|
// }
|
||||||
if (filters!.name != '') {
|
// if (filters!.name != '') {
|
||||||
url += '&name=${filters!.name}';
|
// url += '&name=${filters!.name}';
|
||||||
}
|
// }
|
||||||
// if (filters!.udi != '') {
|
// // if (filters!.udi != '') {
|
||||||
// url += '&package_id=${filters!.udi}';
|
// // url += '&package_id=${filters!.udi}';
|
||||||
// }
|
// // }
|
||||||
}
|
// }
|
||||||
var response = await http.get(
|
// var response = await http.get(
|
||||||
Uri.parse(url),
|
// Uri.parse(url),
|
||||||
headers: {'Authorization': User.token, "Accept": "application/json"},
|
// headers: {'Authorization': User.token, "Accept": "application/json"},
|
||||||
);
|
// );
|
||||||
|
|
||||||
var packagesData = json.decode(response.body);
|
// var packagesData = json.decode(response.body);
|
||||||
|
|
||||||
if (pageNumber == 1) {
|
// if (pageNumber == 1) {
|
||||||
originalHospitalPackages = [];
|
// originalHospitalPackages = [];
|
||||||
}
|
// }
|
||||||
|
|
||||||
for (var package in packagesData['data']) {
|
// for (var package in packagesData['data']) {
|
||||||
originalHospitalPackages!.add(
|
// originalHospitalPackages!.add(
|
||||||
MyPackageResultObject(
|
// MyPackageResultObject(
|
||||||
name: package['name'],
|
// name: package['name'],
|
||||||
id: package['id'].toString(),
|
// id: package['id'].toString(),
|
||||||
createdAt: package['created_at'].toString(),
|
// createdAt: package['created_at'].toString(),
|
||||||
userName: package['user'] != null ? package['user']['name'] : '',
|
// userName: package['user'] != null ? package['user']['name'] : '',
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
pageNumber += 1;
|
// pageNumber += 1;
|
||||||
searchHospitalPackages('');
|
// searchHospitalPackages('');
|
||||||
}
|
// }
|
||||||
|
|
||||||
Future<void> getMyPackageRequests() async {
|
Future<void> getMyPackageRequests() async {
|
||||||
String url = Url.getMyPackageRequests;
|
String url = Url.getMyPackageRequests;
|
||||||
@@ -178,29 +179,29 @@ class MyPackageProvider extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getHospitalPackageRequests() async {
|
// Future<void> getHospitalPackageRequests() async {
|
||||||
String url = Url.getHospitalPackageRequests;
|
// String url = Url.getHospitalPackageRequests;
|
||||||
var response = await http.get(
|
// var response = await http.get(
|
||||||
Uri.parse(url),
|
// Uri.parse(url),
|
||||||
headers: {'Authorization': User.token, "Accept": "application/json"},
|
// headers: {'Authorization': User.token, "Accept": "application/json"},
|
||||||
);
|
// );
|
||||||
|
|
||||||
var packagesData = json.decode(response.body);
|
// var packagesData = json.decode(response.body);
|
||||||
|
|
||||||
originalHospitalPackagesRequests = [];
|
// originalHospitalPackagesRequests = [];
|
||||||
|
|
||||||
for (var package in packagesData['data']) {
|
// for (var package in packagesData['data']) {
|
||||||
originalHospitalPackagesRequests!.add(
|
// originalHospitalPackagesRequests!.add(
|
||||||
MyPackageResultObject(
|
// MyPackageResultObject(
|
||||||
name: package['transferable']['name'],
|
// name: package['transferable']['name'],
|
||||||
id: package['transferable']['id'].toString(),
|
// id: package['transferable']['id'].toString(),
|
||||||
createdAt: package['created_at'].toString(),
|
// createdAt: package['created_at'].toString(),
|
||||||
userName: package['user'] != null ? package['user']['name'] : '',
|
// userName: package['user'] != null ? package['user']['name'] : '',
|
||||||
requestId: package['id'].toString(),
|
// requestId: package['id'].toString(),
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
Future<void> getPackagesHistory(String id) async {
|
Future<void> getPackagesHistory(String id) async {
|
||||||
String url = Url.getPackageResult(id);
|
String url = Url.getPackageResult(id);
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:cssd/models/item_model.dart';
|
import 'package:cssd/models/item_model.dart';
|
||||||
import 'package:cssd/models/package_model.dart';
|
import 'package:cssd/models/package_model.dart';
|
||||||
|
import 'package:flutter_downloader/flutter_downloader.dart';
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
|
||||||
import '../config/urls.dart';
|
import '../config/urls.dart';
|
||||||
import '../config/user.dart';
|
import '../config/user.dart';
|
||||||
@@ -307,6 +309,8 @@ class PackageProvider extends ChangeNotifier {
|
|||||||
hospitalName: 'null',
|
hospitalName: 'null',
|
||||||
// udi: 'null',
|
// udi: 'null',
|
||||||
items: [],
|
items: [],
|
||||||
|
userName: 'null',
|
||||||
|
userCreator: 'null',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
var data = json.decode(response.body)['data'];
|
var data = json.decode(response.body)['data'];
|
||||||
@@ -326,8 +330,22 @@ class PackageProvider extends ChangeNotifier {
|
|||||||
createDate: data['created_at'] != null ? data['created_at'] : '',
|
createDate: data['created_at'] != null ? data['created_at'] : '',
|
||||||
hospitalName:
|
hospitalName:
|
||||||
data['user'] != null ? data['user']['medical_center']['name'] : '',
|
data['user'] != null ? data['user']['medical_center']['name'] : '',
|
||||||
|
userName: data['user'] != null ? data['user']['name'] : '',
|
||||||
|
userCreator: data['creator'] != null ? data['creator']['name'] : '',
|
||||||
items: itemsList,
|
items: itemsList,
|
||||||
);
|
);
|
||||||
return result!;
|
return result!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> exportPackages() async {
|
||||||
|
final baseStorage = await getExternalStorageDirectory();
|
||||||
|
final taskId = await FlutterDownloader.enqueue(
|
||||||
|
url: Url.exportPackages,
|
||||||
|
savedDir: baseStorage!.path,
|
||||||
|
showNotification: true,
|
||||||
|
openFileFromNotification: true,
|
||||||
|
);
|
||||||
|
print(taskId);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,7 +246,6 @@ class TestResultsProvider with ChangeNotifier {
|
|||||||
};
|
};
|
||||||
di.FormData formData = new di.FormData.fromMap({
|
di.FormData formData = new di.FormData.fromMap({
|
||||||
"batch_id": batchId,
|
"batch_id": batchId,
|
||||||
'model_type': 'TestResult',
|
|
||||||
"file": di.MultipartFile.fromBytes(imageListInt, filename: fileName)
|
"file": di.MultipartFile.fromBytes(imageListInt, filename: fileName)
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -268,7 +267,7 @@ class TestResultsProvider with ChangeNotifier {
|
|||||||
await addImage(batchId, image.bytes, image.path!);
|
await addImage(batchId, image.bytes, image.path!);
|
||||||
}
|
}
|
||||||
dynamic vals = values;
|
dynamic vals = values;
|
||||||
vals['file_batch_id'] = batchId;
|
vals['batch_id'] = batchId;
|
||||||
|
|
||||||
// int counter = 0;
|
// int counter = 0;
|
||||||
// if (images.length != 0) {
|
// if (images.length != 0) {
|
||||||
|
|||||||
@@ -108,25 +108,25 @@ class CycleItemBox extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
userData['roles']?.contains('User') ?? false
|
// userData['roles']?.contains('User') ?? false
|
||||||
? Container()
|
// ? Container()
|
||||||
: InkWell(
|
// : InkWell(
|
||||||
customBorder: CircleBorder(),
|
// customBorder: CircleBorder(),
|
||||||
onTap: () {
|
// onTap: () {
|
||||||
Navigator.of(context).pushNamed(
|
// Navigator.of(context).pushNamed(
|
||||||
Routes.cycleUpdateScreen,
|
// Routes.cycleUpdateScreen,
|
||||||
arguments: item!.id,
|
// arguments: item!.id,
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
child: Icon(
|
// child: Icon(
|
||||||
Icons.edit,
|
// Icons.edit,
|
||||||
size: 5 * _deviceBlockSize,
|
// size: 5 * _deviceBlockSize,
|
||||||
color: Colors.black,
|
// color: Colors.black,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
width: 5.0,
|
// width: 5.0,
|
||||||
),
|
// ),
|
||||||
userData['roles']?.contains('User') ?? false
|
userData['roles']?.contains('User') ?? false
|
||||||
? Container()
|
? Container()
|
||||||
: InkWell(
|
: InkWell(
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class ItemDetailsDataBox extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
width: 35 * _deviceBlockSize,
|
width: 35 * _deviceBlockSize,
|
||||||
child: Text(
|
child: Text(
|
||||||
'User',
|
'Owner',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
@@ -181,6 +181,33 @@ class ItemDetailsDataBox extends StatelessWidget {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
width: 35 * _deviceBlockSize,
|
||||||
|
child: Text(
|
||||||
|
'Creator',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 45 * _deviceBlockSize,
|
||||||
|
child: Text(
|
||||||
|
datas.userCreator.toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
Row(
|
Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
|
|||||||
@@ -163,14 +163,14 @@ class ItemItemBox extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.all(7),
|
padding: EdgeInsets.all(7),
|
||||||
width: 6 * _deviceBlockSize,
|
width: 8 * _deviceBlockSize,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
color: item!.status == 1 ? kPink : kBlue,
|
color: item!.status == 1 ? kPink : kBlue,
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
item!.status == 1 ? Icons.close : Icons.check,
|
item!.status == 1 ? Icons.close : Icons.check,
|
||||||
size: 2 * _deviceBlockSize,
|
size: 4 * _deviceBlockSize,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -178,27 +178,26 @@ class ItemItemBox extends StatelessWidget {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: 5.0,
|
width: 5.0,
|
||||||
),
|
),
|
||||||
userData['roles']?.contains('User') ?? false
|
// userData['roles']?.contains('User') ?? false
|
||||||
? Container()
|
// ? Container()
|
||||||
: InkWell(
|
// : InkWell(
|
||||||
onTap: () {
|
// onTap: () {
|
||||||
Navigator.of(context).pushNamed(
|
// Navigator.of(context).pushNamed(
|
||||||
Routes.itemUpdateScreen,
|
// Routes.itemUpdateScreen,
|
||||||
arguments: item!.id,
|
// arguments: item!.id,
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
child: Icon(
|
// child: Icon(
|
||||||
Icons.edit,
|
// Icons.edit,
|
||||||
size: 5 * _deviceBlockSize,
|
// size: 5 * _deviceBlockSize,
|
||||||
color: Colors.black,
|
// color: Colors.black,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
width: 5.0,
|
// width: 5.0,
|
||||||
),
|
// ),
|
||||||
userData['roles']?.contains('User') ?? false
|
userData['roles']?.contains('Admin') ?? false
|
||||||
? Container()
|
? InkWell(
|
||||||
: InkWell(
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@@ -206,7 +205,7 @@ class ItemItemBox extends StatelessWidget {
|
|||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: Text('Delete'),
|
title: Text('Delete'),
|
||||||
content: Text(
|
content: Text(
|
||||||
'Are you sure you want delete this Item?'),
|
'Are you sure you want delete this Item?',),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('Yes'),
|
child: Text('Yes'),
|
||||||
@@ -233,7 +232,49 @@ class ItemItemBox extends StatelessWidget {
|
|||||||
size: 5 * _deviceBlockSize,
|
size: 5 * _deviceBlockSize,
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
|
: userData['roles']?.contains('Supervisor')
|
||||||
|
? item!.packageId != null
|
||||||
|
? InkWell(
|
||||||
|
onTap: () {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: Text('Delete'),
|
||||||
|
content: Text(
|
||||||
|
'Are you sure you want delete this Item?',
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
TextButton(
|
||||||
|
child: Text('Yes'),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
Provider.of<ItemProvider>(
|
||||||
|
context,
|
||||||
|
listen: false)
|
||||||
|
.removeItems(item!.id);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
child: Text('No'),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Icon(
|
||||||
|
Icons.delete,
|
||||||
|
size: 5 * _deviceBlockSize,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Container()
|
||||||
|
: Container(),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 5.0,
|
width: 5.0,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -100,25 +100,25 @@ class LabelItemBox extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
userData['roles']?.contains('User') ?? false
|
// userData['roles']?.contains('User') ?? false
|
||||||
? Container()
|
// ? Container()
|
||||||
: InkWell(
|
// : InkWell(
|
||||||
customBorder: CircleBorder(),
|
// customBorder: CircleBorder(),
|
||||||
onTap: () {
|
// onTap: () {
|
||||||
Navigator.of(context).pushNamed(
|
// Navigator.of(context).pushNamed(
|
||||||
Routes.labelUpdateScreen,
|
// Routes.labelUpdateScreen,
|
||||||
arguments: item!.id,
|
// arguments: item!.id,
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
child: Icon(
|
// child: Icon(
|
||||||
Icons.edit,
|
// Icons.edit,
|
||||||
size: 5 * _deviceBlockSize,
|
// size: 5 * _deviceBlockSize,
|
||||||
color: Colors.black,
|
// color: Colors.black,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
width: 5.0,
|
// width: 5.0,
|
||||||
),
|
// ),
|
||||||
userData['roles']?.contains('User') ?? false
|
userData['roles']?.contains('User') ?? false
|
||||||
? Container()
|
? Container()
|
||||||
: InkWell(
|
: InkWell(
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ class MyItemsDetailsDataBox extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
width: 35 * _deviceBlockSize,
|
width: 35 * _deviceBlockSize,
|
||||||
child: Text(
|
child: Text(
|
||||||
'User',
|
'Owner',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
@@ -190,6 +190,33 @@ class MyItemsDetailsDataBox extends StatelessWidget {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
width: 35 * _deviceBlockSize,
|
||||||
|
child: Text(
|
||||||
|
'Creator',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 45 * _deviceBlockSize,
|
||||||
|
child: Text(
|
||||||
|
datas.userCreator.toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
Row(
|
Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
@@ -332,21 +359,32 @@ class MyItemsDetailsDataBox extends StatelessWidget {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
TransferDestroyButton(
|
userData['roles']?.contains('Admin') ?? false
|
||||||
deviceBlockSize: _deviceBlockSize,
|
? TransferDestroyButton(
|
||||||
firstColor: kDarkBlue,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
secondColor: kDarkBlueSub,
|
firstColor: kDarkBlue,
|
||||||
text: 'Transfer',
|
secondColor: kDarkBlueSub,
|
||||||
onTap: () {
|
text: 'Transfer',
|
||||||
push();
|
onTap: () {
|
||||||
},
|
push();
|
||||||
),
|
},
|
||||||
|
)
|
||||||
|
: datas.packageId != null
|
||||||
|
? TransferDestroyButton(
|
||||||
|
deviceBlockSize: _deviceBlockSize,
|
||||||
|
firstColor: kDarkBlue,
|
||||||
|
secondColor: kDarkBlueSub,
|
||||||
|
text: 'Transfer',
|
||||||
|
onTap: () {
|
||||||
|
push();
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.0,
|
height: 10.0,
|
||||||
),
|
),
|
||||||
userData['roles']?.contains('User') ?? false
|
userData['roles']?.contains('Admin') ?? false
|
||||||
? Container()
|
? TransferDestroyButton(
|
||||||
: TransferDestroyButton(
|
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
firstColor: kPink,
|
firstColor: kPink,
|
||||||
secondColor: kPinkSub,
|
secondColor: kPinkSub,
|
||||||
@@ -417,13 +455,88 @@ class MyItemsDetailsDataBox extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
)
|
||||||
|
: userData['roles'].contains('Supervisor')
|
||||||
|
? datas.packageId != null
|
||||||
|
? TransferDestroyButton(
|
||||||
|
deviceBlockSize: _deviceBlockSize,
|
||||||
|
firstColor: kPink,
|
||||||
|
secondColor: kPinkSub,
|
||||||
|
text: 'Destroy',
|
||||||
|
onTap: () {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: Text(
|
||||||
|
'Are you sure to destroy this Item?',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 4 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
content: SizedBox(
|
||||||
|
width: _deviceBlockSize,
|
||||||
|
height: 220,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'By approving, your item will be removed and it can not be used any more.',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 3 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.0,
|
||||||
|
),
|
||||||
|
ItemCard(_deviceBlockSize),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.0,
|
||||||
|
),
|
||||||
|
TransferDestroyButton(
|
||||||
|
deviceBlockSize: _deviceBlockSize,
|
||||||
|
firstColor: kPink,
|
||||||
|
secondColor: kPinkSub,
|
||||||
|
onTap: () {
|
||||||
|
Provider.of<ItemProvider>(context,
|
||||||
|
listen: false)
|
||||||
|
.removeItems(datas.id)
|
||||||
|
.then(
|
||||||
|
(value) {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
Navigator.pushReplacementNamed(
|
||||||
|
context,
|
||||||
|
Routes.myItemsResultScreen,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
text: 'Destroy',
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5.0,
|
||||||
|
),
|
||||||
|
CancelTransferButton(
|
||||||
|
deviceBlockSize: _deviceBlockSize,
|
||||||
|
color: kDarkBlue,
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: Container()
|
||||||
|
: Container(),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.0,
|
height: 10.0,
|
||||||
),
|
),
|
||||||
userData['roles']?.contains('User') ?? false
|
userData['roles']?.contains('Admin') ?? false
|
||||||
? Container()
|
? TransferDestroyButton(
|
||||||
: TransferDestroyButton(
|
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
firstColor: Colors.black,
|
firstColor: Colors.black,
|
||||||
secondColor: Colors.black87,
|
secondColor: Colors.black87,
|
||||||
@@ -494,7 +607,84 @@ class MyItemsDetailsDataBox extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
)
|
||||||
|
: userData['roles'].contains('Supervisor')
|
||||||
|
? datas.packageId != null
|
||||||
|
? TransferDestroyButton(
|
||||||
|
deviceBlockSize: _deviceBlockSize,
|
||||||
|
firstColor: Colors.black,
|
||||||
|
secondColor: Colors.black87,
|
||||||
|
text: 'Repair',
|
||||||
|
onTap: () {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: Text(
|
||||||
|
'Are you sure to repair this Item?',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 4 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
content: SizedBox(
|
||||||
|
width: _deviceBlockSize,
|
||||||
|
height: 220,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'By approving, your item will be set in repair mode and it can be use anymore unless you disable repair mode.',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 3 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.0,
|
||||||
|
),
|
||||||
|
ItemCard(_deviceBlockSize),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.0,
|
||||||
|
),
|
||||||
|
TransferDestroyButton(
|
||||||
|
deviceBlockSize: _deviceBlockSize,
|
||||||
|
firstColor: Colors.black,
|
||||||
|
secondColor: Colors.black87,
|
||||||
|
onTap: () {
|
||||||
|
Provider.of<MyItemProvider>(context,
|
||||||
|
listen: false)
|
||||||
|
.repairItems(
|
||||||
|
datas.id, 'approved')
|
||||||
|
.then(
|
||||||
|
(value) {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
Navigator.pushReplacementNamed(
|
||||||
|
context,
|
||||||
|
Routes.myItemsResultScreen,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
text: 'Repair',
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5.0,
|
||||||
|
),
|
||||||
|
CancelTransferButton(
|
||||||
|
deviceBlockSize: _deviceBlockSize,
|
||||||
|
color: kDarkBlue,
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: Container()
|
||||||
|
: Container(),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.0,
|
height: 20.0,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ class TransferDestroyButton extends StatelessWidget {
|
|||||||
required this.secondColor,
|
required this.secondColor,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
required this.text,
|
required this.text,
|
||||||
|
this.fontSize = 5.0,
|
||||||
}) : _deviceBlockSize = deviceBlockSize,
|
}) : _deviceBlockSize = deviceBlockSize,
|
||||||
super(key: key);
|
super(key: key);
|
||||||
final double _deviceBlockSize;
|
final double _deviceBlockSize;
|
||||||
@@ -15,6 +16,7 @@ class TransferDestroyButton extends StatelessWidget {
|
|||||||
final Color secondColor;
|
final Color secondColor;
|
||||||
final String text;
|
final String text;
|
||||||
final VoidCallback onTap;
|
final VoidCallback onTap;
|
||||||
|
final double fontSize;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -37,7 +39,7 @@ class TransferDestroyButton extends StatelessWidget {
|
|||||||
text,
|
text,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 5 * _deviceBlockSize,
|
fontSize: fontSize * _deviceBlockSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:cssd/providers/auth.dart';
|
|
||||||
import 'package:cssd/providers/my_items.dart';
|
import 'package:cssd/providers/my_items.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
@@ -32,7 +31,6 @@ class MyItemFilterChip extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final userData = Provider.of<Auth>(context, listen: false).user;
|
|
||||||
return Row(
|
return Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -61,19 +59,11 @@ class MyItemFilterChip extends StatelessWidget {
|
|||||||
_specific,
|
_specific,
|
||||||
);
|
);
|
||||||
itemProvider.setLoading();
|
itemProvider.setLoading();
|
||||||
if (userData['roles']?.contains('User')) {
|
itemProvider.getMyItems().then(
|
||||||
itemProvider.getMyItems().then(
|
(_) {
|
||||||
(_) {
|
itemProvider.resetLoading();
|
||||||
itemProvider.resetLoading();
|
},
|
||||||
},
|
);
|
||||||
);
|
|
||||||
} else {
|
|
||||||
itemProvider.getHospitalItems().then(
|
|
||||||
(_) {
|
|
||||||
itemProvider.resetLoading();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
import 'package:cssd/config/colors.dart';
|
import 'package:cssd/config/colors.dart';
|
||||||
|
import 'package:cssd/config/routes.dart';
|
||||||
import 'package:cssd/models/package_model.dart';
|
import 'package:cssd/models/package_model.dart';
|
||||||
|
import 'package:cssd/providers/auth.dart';
|
||||||
|
import 'package:cssd/providers/packages.dart';
|
||||||
|
import 'package:cssd/widgets/MyItemsScreens/Detail/cancel_transfer_button.dart';
|
||||||
import 'package:cssd/widgets/MyItemsScreens/Detail/transfer_destroy_button.dart';
|
import 'package:cssd/widgets/MyItemsScreens/Detail/transfer_destroy_button.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
class MyPackageDetailsDataBox extends StatelessWidget {
|
class MyPackageDetailsDataBox extends StatelessWidget {
|
||||||
@@ -20,7 +25,7 @@ class MyPackageDetailsDataBox extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// final userData = Provider.of<Auth>(context, listen: false).user;
|
final userData = Provider.of<Auth>(context, listen: false).user;
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.all(20),
|
padding: EdgeInsets.all(20),
|
||||||
child: ListView(
|
child: ListView(
|
||||||
@@ -129,6 +134,64 @@ class MyPackageDetailsDataBox extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Divider(),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
width: 35 * _deviceBlockSize,
|
||||||
|
child: Text(
|
||||||
|
'Owner',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 45 * _deviceBlockSize,
|
||||||
|
child: Text(
|
||||||
|
datas.userName.toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
width: 35 * _deviceBlockSize,
|
||||||
|
child: Text(
|
||||||
|
'Creator',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 45 * _deviceBlockSize,
|
||||||
|
child: Text(
|
||||||
|
datas.userCreator.toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
// Divider(),
|
// Divider(),
|
||||||
// SizedBox(
|
// SizedBox(
|
||||||
// height: 5,
|
// height: 5,
|
||||||
@@ -271,83 +334,83 @@ class MyPackageDetailsDataBox extends StatelessWidget {
|
|||||||
push();
|
push();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
// SizedBox(
|
SizedBox(
|
||||||
// height: 10.0,
|
height: 10.0,
|
||||||
// ),
|
),
|
||||||
// userData['roles']?.contains('User') ?? false
|
userData['roles']?.contains('User') ?? false
|
||||||
// ? Container()
|
? Container()
|
||||||
// : TransferDestroyButton(
|
: TransferDestroyButton(
|
||||||
// deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
// firstColor: kPink,
|
firstColor: kPink,
|
||||||
// secondColor: kPinkSub,
|
secondColor: kPinkSub,
|
||||||
// text: 'Destroy',
|
text: 'Back Items to Item List',
|
||||||
// onTap: () {
|
onTap: () {
|
||||||
// showDialog(
|
showDialog(
|
||||||
// context: context,
|
context: context,
|
||||||
// builder: (context) {
|
builder: (context) {
|
||||||
// return AlertDialog(
|
return AlertDialog(
|
||||||
// title: Text(
|
title: Text(
|
||||||
// 'Are you sure to destroy this Package?',
|
'Are you sure to destroy this Package?',
|
||||||
// style: TextStyle(
|
style: TextStyle(
|
||||||
// fontSize: 4 * _deviceBlockSize,
|
fontSize: 4 * _deviceBlockSize,
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// content: SizedBox(
|
content: SizedBox(
|
||||||
// width: _deviceBlockSize,
|
width: _deviceBlockSize,
|
||||||
// height: 220,
|
height: 220,
|
||||||
// child: Column(
|
child: Column(
|
||||||
// children: [
|
children: [
|
||||||
// Text(
|
Text(
|
||||||
// 'By approving, your package will be removed and it can not be used any more.',
|
'By approving, your package will be removed and it can not be used any more.',
|
||||||
// style: TextStyle(
|
style: TextStyle(
|
||||||
// fontSize: 3 * _deviceBlockSize,
|
fontSize: 3 * _deviceBlockSize,
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// SizedBox(
|
SizedBox(
|
||||||
// height: 10.0,
|
height: 10.0,
|
||||||
// ),
|
),
|
||||||
// PackageCard(_deviceBlockSize),
|
PackageCard(_deviceBlockSize),
|
||||||
// SizedBox(
|
SizedBox(
|
||||||
// height: 20.0,
|
height: 20.0,
|
||||||
// ),
|
),
|
||||||
// TransferDestroyButton(
|
TransferDestroyButton(
|
||||||
// deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
// firstColor: kPink,
|
firstColor: kPink,
|
||||||
// secondColor: kPinkSub,
|
secondColor: kPinkSub,
|
||||||
// onTap: () {
|
onTap: () {
|
||||||
// Provider.of<PackageProvider>(context,
|
Provider.of<PackageProvider>(context,
|
||||||
// listen: false)
|
listen: false)
|
||||||
// .removePackages(datas.id)
|
.removePackages(datas.id)
|
||||||
// .then(
|
.then(
|
||||||
// (value) {
|
(value) {
|
||||||
// Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
// Navigator.pushReplacementNamed(
|
Navigator.pushReplacementNamed(
|
||||||
// context,
|
context,
|
||||||
// Routes.myPackagesResultScreen,
|
Routes.myPackagesResultScreen,
|
||||||
// );
|
);
|
||||||
// },
|
},
|
||||||
// );
|
);
|
||||||
// },
|
},
|
||||||
// text: 'Destroy',
|
text: 'Destroy',
|
||||||
// ),
|
),
|
||||||
// SizedBox(
|
SizedBox(
|
||||||
// height: 5.0,
|
height: 5.0,
|
||||||
// ),
|
),
|
||||||
// CancelTransferButton(
|
CancelTransferButton(
|
||||||
// deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
// color: kDarkPurple,
|
color: kDarkPurple,
|
||||||
// onTap: () {
|
onTap: () {
|
||||||
// Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
// },
|
},
|
||||||
// ),
|
),
|
||||||
// ],
|
],
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// );
|
);
|
||||||
// },
|
},
|
||||||
// );
|
);
|
||||||
// },
|
},
|
||||||
// ),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:cssd/providers/auth.dart';
|
|
||||||
import 'package:cssd/providers/my_packages.dart';
|
import 'package:cssd/providers/my_packages.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
@@ -26,7 +25,6 @@ class MyPackageFilterChip extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final userData = Provider.of<Auth>(context, listen: false).user;
|
|
||||||
return Row(
|
return Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -53,19 +51,11 @@ class MyPackageFilterChip extends StatelessWidget {
|
|||||||
// _udi,
|
// _udi,
|
||||||
);
|
);
|
||||||
packageProvider.setLoading();
|
packageProvider.setLoading();
|
||||||
if (userData['roles']?.contains('User')) {
|
packageProvider.getMyPackages().then(
|
||||||
packageProvider.getMyPackages().then(
|
|
||||||
(_) {
|
(_) {
|
||||||
packageProvider.resetLoading();
|
packageProvider.resetLoading();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
packageProvider.getHospitalPackages().then(
|
|
||||||
(_) {
|
|
||||||
packageProvider.resetLoading();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -132,6 +132,60 @@ class PackageDetailsDataBox extends StatelessWidget {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
width: 35 * _deviceBlockSize,
|
||||||
|
child: Text(
|
||||||
|
'Owner',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 45 * _deviceBlockSize,
|
||||||
|
child: Text(
|
||||||
|
datas.userName.toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
width: 35 * _deviceBlockSize,
|
||||||
|
child: Text(
|
||||||
|
'Creator',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 45 * _deviceBlockSize,
|
||||||
|
child: Text(
|
||||||
|
datas.userCreator.toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
// Row(
|
// Row(
|
||||||
// children: <Widget>[
|
// children: <Widget>[
|
||||||
// Container(
|
// Container(
|
||||||
@@ -264,6 +318,7 @@ class PackageDetailsDataBox extends StatelessWidget {
|
|||||||
secondColor: kPurpleSub,
|
secondColor: kPurpleSub,
|
||||||
onTap: goToAddLabelPage,
|
onTap: goToAddLabelPage,
|
||||||
text: 'Make a Label For Package',
|
text: 'Make a Label For Package',
|
||||||
|
fontSize: 4.0,
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 5.0,
|
height: 5.0,
|
||||||
|
|||||||
@@ -106,25 +106,25 @@ class PackageItemBox extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
userData['roles']?.contains('User') ?? false
|
// userData['roles']?.contains('User') ?? false
|
||||||
? Container()
|
// ? Container()
|
||||||
: InkWell(
|
// : InkWell(
|
||||||
customBorder: CircleBorder(),
|
// customBorder: CircleBorder(),
|
||||||
onTap: () {
|
// onTap: () {
|
||||||
Navigator.of(context).pushNamed(
|
// Navigator.of(context).pushNamed(
|
||||||
Routes.packageUpdateScreen,
|
// Routes.packageUpdateScreen,
|
||||||
arguments: item!.id,
|
// arguments: item!.id,
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
child: Icon(
|
// child: Icon(
|
||||||
Icons.edit,
|
// Icons.edit,
|
||||||
size: 5 * _deviceBlockSize,
|
// size: 5 * _deviceBlockSize,
|
||||||
color: Colors.black,
|
// color: Colors.black,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
width: 5.0,
|
// width: 5.0,
|
||||||
),
|
// ),
|
||||||
userData['roles']?.contains('User') ?? false
|
userData['roles']?.contains('User') ?? false
|
||||||
? Container()
|
? Container()
|
||||||
: InkWell(
|
: InkWell(
|
||||||
|
|||||||
+132
-84
@@ -5,10 +5,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: archive
|
name: archive
|
||||||
sha256: e0902a06f0e00414e4e3438a084580161279f137aeb862274710f29ec10cf01e
|
sha256: "7b875fd4a20b165a3084bd2d210439b22ebc653f21cea4842729c0c30c82596b"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.3.9"
|
version: "3.4.9"
|
||||||
args:
|
args:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -29,10 +29,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: barcode_scan2
|
name: barcode_scan2
|
||||||
sha256: "0b0625d27841a21e36e896195d86b2aada335e3c486f63647cce701495718e16"
|
sha256: "847ff88888213a3b2866d98839ee6d85e4da8002df83e7971d355d24d5f31c4c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2.4"
|
version: "4.3.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -69,34 +69,34 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: camera
|
name: camera
|
||||||
sha256: f63f2687fb1795c36f7c57b18a03071880eabb0fd8b5291b0fcd3fb979cb0fb1
|
sha256: "71fb0e03618a8629a912bbf49bb664869bd16830c1d363b1096df99727b0bebb"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.10.5+4"
|
version: "0.10.5+6"
|
||||||
camera_android:
|
camera_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: camera_android
|
name: camera_android
|
||||||
sha256: ed4f645848074166fc3b8e20350f83ca07e09a2becc1e185040ee561f955d4df
|
sha256: b63304d553dde613ca68fb40aaa76bbbcdbd051683bdbf2019671ec8d9645ce7
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.10.8+8"
|
version: "0.10.8+14"
|
||||||
camera_avfoundation:
|
camera_avfoundation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: camera_avfoundation
|
name: camera_avfoundation
|
||||||
sha256: "718b60ed2e22b4067fe6e2c0e9ebe2856c2de5c8b1289ba95d10db85b0b00bc2"
|
sha256: "3b6d9f550cfd658c71f34a99509528501e5e5d4fa79f11e3a4d6ef380d8e0254"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.13+4"
|
version: "0.9.13+7"
|
||||||
camera_platform_interface:
|
camera_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: camera_platform_interface
|
name: camera_platform_interface
|
||||||
sha256: "8734d1c682f034bdb12d0d6ff379b0535a9b8e44266b530025bf8266d6a62f28"
|
sha256: "86fd4fc597c6e455265ddb5884feb352d0171ad14b9cdf3aba30da59b25738c4"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.5.2"
|
version: "2.6.0"
|
||||||
camera_web:
|
camera_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -189,10 +189,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: cross_file
|
name: cross_file
|
||||||
sha256: fd832b5384d0d6da4f6df60b854d33accaaeb63aa9e10e736a87381f08dee2cb
|
sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.3+5"
|
version: "0.3.3+8"
|
||||||
crypto:
|
crypto:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -213,10 +213,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: dio
|
name: dio
|
||||||
sha256: ce75a1b40947fea0a0e16ce73337122a86762e38b982e1ccb909daa3b9bc4197
|
sha256: "797e1e341c3dd2f69f2dad42564a6feff3bfb87187d05abb93b9609e6f1645c3"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.3.2"
|
version: "5.4.0"
|
||||||
double_back_to_close_app:
|
double_back_to_close_app:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -253,18 +253,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: file
|
name: file
|
||||||
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
|
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.4"
|
version: "7.0.0"
|
||||||
file_picker:
|
file_picker:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: file_picker
|
name: file_picker
|
||||||
sha256: be325344c1f3070354a1d84a231a1ba75ea85d413774ec4bdf444c023342e030
|
sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.5.0"
|
version: "6.1.1"
|
||||||
fixnum:
|
fixnum:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -286,6 +286,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.3.1"
|
version: "3.3.1"
|
||||||
|
flutter_downloader:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_downloader
|
||||||
|
sha256: "36c16cc6657274f3cf7ccb681aeca89df62531ff5956f85e175f6be4b8d6b140"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.11.5"
|
||||||
flutter_image_compress:
|
flutter_image_compress:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -338,10 +346,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_lints
|
name: flutter_lints
|
||||||
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
|
sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "3.0.1"
|
||||||
flutter_phoenix:
|
flutter_phoenix:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -354,10 +362,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_plugin_android_lifecycle
|
name: flutter_plugin_android_lifecycle
|
||||||
sha256: f185ac890306b5779ecbd611f52502d8d4d63d27703ef73161ca0407e815f02c
|
sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.16"
|
version: "2.0.17"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -372,18 +380,18 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: font_awesome_flutter
|
name: font_awesome_flutter
|
||||||
sha256: "5fb789145cae1f4c3245c58b3f8fb287d055c26323879eab57a7bf0cfd1e45f3"
|
sha256: "52671aea66da73b58d42ec6d0912b727a42248dd9a7c76d6c20f275783c48c08"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.5.0"
|
version: "10.6.0"
|
||||||
http:
|
http:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: http
|
name: http
|
||||||
sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525"
|
sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.2"
|
||||||
http_parser:
|
http_parser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -396,10 +404,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: image
|
name: image
|
||||||
sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf
|
sha256: "028f61960d56f26414eb616b48b04eb37d700cbe477b7fb09bf1d7ce57fd9271"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.17"
|
version: "4.1.3"
|
||||||
image_picker:
|
image_picker:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -436,10 +444,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: intl
|
name: intl
|
||||||
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
|
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.18.1"
|
version: "0.19.0"
|
||||||
js:
|
js:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -460,10 +468,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: lints
|
name: lints
|
||||||
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
|
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.1"
|
version: "3.0.0"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -548,10 +556,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_android
|
name: path_provider_android
|
||||||
sha256: "6b8b19bd80da4f11ce91b2d1fb931f3006911477cec227cce23d3253d80df3f1"
|
sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.0"
|
version: "2.2.1"
|
||||||
path_provider_foundation:
|
path_provider_foundation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -584,30 +592,78 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.1"
|
version: "2.2.1"
|
||||||
|
permission_handler:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: permission_handler
|
||||||
|
sha256: "860c6b871c94c78e202dc69546d4d8fd84bd59faeb36f8fb9888668a53ff4f78"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "11.1.0"
|
||||||
|
permission_handler_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: permission_handler_android
|
||||||
|
sha256: "2f1bec180ee2f5665c22faada971a8f024761f632e93ddc23310487df52dcfa6"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "12.0.1"
|
||||||
|
permission_handler_apple:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: permission_handler_apple
|
||||||
|
sha256: "1a816084338ada8d574b1cb48390e6e8b19305d5120fe3a37c98825bacc78306"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "9.2.0"
|
||||||
|
permission_handler_html:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: permission_handler_html
|
||||||
|
sha256: "11b762a8c123dced6461933a88ea1edbbe036078c3f9f41b08886e678e7864df"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.0+2"
|
||||||
|
permission_handler_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: permission_handler_platform_interface
|
||||||
|
sha256: d87349312f7eaf6ce0adaf668daf700ac5b06af84338bd8b8574dfbd93ffe1a1
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.2"
|
||||||
|
permission_handler_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: permission_handler_windows
|
||||||
|
sha256: "1e8640c1e39121128da6b816d236e714d2cf17fac5a105dd6acdd3403a628004"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.0"
|
||||||
petitparser:
|
petitparser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: petitparser
|
name: petitparser
|
||||||
sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750
|
sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.4.0"
|
version: "6.0.2"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: platform
|
name: platform
|
||||||
sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102
|
sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.2"
|
version: "3.1.3"
|
||||||
plugin_platform_interface:
|
plugin_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: plugin_platform_interface
|
name: plugin_platform_interface
|
||||||
sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d
|
sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.6"
|
version: "2.1.7"
|
||||||
pointycastle:
|
pointycastle:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -620,26 +676,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: protobuf
|
name: protobuf
|
||||||
sha256: "01dd9bd0fa02548bf2ceee13545d4a0ec6046459d847b6b061d8a27237108a08"
|
sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "3.1.0"
|
||||||
provider:
|
provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: provider
|
name: provider
|
||||||
sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f
|
sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.5"
|
version: "6.1.1"
|
||||||
quiver:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: quiver
|
|
||||||
sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.2.1"
|
|
||||||
random_string:
|
random_string:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -660,10 +708,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: shared_preferences
|
name: shared_preferences
|
||||||
sha256: b7f41bad7e521d205998772545de63ff4e6c97714775902c199353f8bf1511ac
|
sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.1"
|
version: "2.2.2"
|
||||||
shared_preferences_android:
|
shared_preferences_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -684,10 +732,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_linux
|
name: shared_preferences_linux
|
||||||
sha256: c2eb5bf57a2fe9ad6988121609e47d3e07bb3bdca5b6f8444e4cf302428a128a
|
sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.1"
|
version: "2.3.2"
|
||||||
shared_preferences_platform_interface:
|
shared_preferences_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -700,18 +748,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_web
|
name: shared_preferences_web
|
||||||
sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf
|
sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.1"
|
version: "2.2.2"
|
||||||
shared_preferences_windows:
|
shared_preferences_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_windows
|
name: shared_preferences_windows
|
||||||
sha256: f763a101313bd3be87edffe0560037500967de9c394a714cd598d945517f694f
|
sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.1"
|
version: "2.3.2"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -817,66 +865,66 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: url_launcher
|
name: url_launcher
|
||||||
sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27"
|
sha256: e9aa5ea75c84cf46b3db4eea212523591211c3cf2e13099ee4ec147f54201c86
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.14"
|
version: "6.2.2"
|
||||||
url_launcher_android:
|
url_launcher_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_android
|
name: url_launcher_android
|
||||||
sha256: b04af59516ab45762b2ca6da40fa830d72d0f6045cd97744450b73493fa76330
|
sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.0"
|
version: "6.2.0"
|
||||||
url_launcher_ios:
|
url_launcher_ios:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_ios
|
name: url_launcher_ios
|
||||||
sha256: "7c65021d5dee51813d652357bc65b8dd4a6177082a9966bc8ba6ee477baa795f"
|
sha256: bba3373219b7abb6b5e0d071b0fe66dfbe005d07517a68e38d4fc3638f35c6d3
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.5"
|
version: "6.2.1"
|
||||||
url_launcher_linux:
|
url_launcher_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_linux
|
name: url_launcher_linux
|
||||||
sha256: b651aad005e0cb06a01dbd84b428a301916dc75f0e7ea6165f80057fee2d8e8e
|
sha256: "9f2d390e096fdbe1e6e6256f97851e51afc2d9c423d3432f1d6a02a8a9a8b9fd"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.6"
|
version: "3.1.0"
|
||||||
url_launcher_macos:
|
url_launcher_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_macos
|
name: url_launcher_macos
|
||||||
sha256: b55486791f666e62e0e8ff825e58a023fd6b1f71c49926483f1128d3bbd8fe88
|
sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.7"
|
version: "3.1.0"
|
||||||
url_launcher_platform_interface:
|
url_launcher_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_platform_interface
|
name: url_launcher_platform_interface
|
||||||
sha256: "95465b39f83bfe95fcb9d174829d6476216f2d548b79c38ab2506e0458787618"
|
sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.5"
|
version: "2.2.0"
|
||||||
url_launcher_web:
|
url_launcher_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_web
|
name: url_launcher_web
|
||||||
sha256: "2942294a500b4fa0b918685aff406773ba0a4cd34b7f42198742a94083020ce5"
|
sha256: "7286aec002c8feecc338cc33269e96b73955ab227456e9fb2a91f7fab8a358e9"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.20"
|
version: "2.2.2"
|
||||||
url_launcher_windows:
|
url_launcher_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_windows
|
name: url_launcher_windows
|
||||||
sha256: "95fef3129dc7cfaba2bc3d5ba2e16063bb561fc6d78e63eee16162bc70029069"
|
sha256: "7754a1ad30ee896b265f8d14078b0513a4dba28d358eabb9d5f339886f4a1adc"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.8"
|
version: "3.1.0"
|
||||||
uuid:
|
uuid:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -905,10 +953,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: win32
|
name: win32
|
||||||
sha256: "9e82a402b7f3d518fb9c02d0e9ae45952df31b9bf34d77baf19da2de03fc2aaa"
|
sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.7"
|
version: "5.1.1"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -921,10 +969,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: xml
|
name: xml
|
||||||
sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84"
|
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.3.0"
|
version: "6.5.0"
|
||||||
yaml:
|
yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -934,5 +982,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.2"
|
version: "3.1.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.2.0-194.0.dev <4.0.0"
|
dart: ">=3.2.0 <4.0.0"
|
||||||
flutter: ">=3.13.0"
|
flutter: ">=3.16.0"
|
||||||
|
|||||||
+6
-4
@@ -25,23 +25,25 @@ dependencies:
|
|||||||
cupertino_icons: ^1.0.3
|
cupertino_icons: ^1.0.3
|
||||||
dio: ^5.3.2
|
dio: ^5.3.2
|
||||||
double_back_to_close_app: ^2.0.1
|
double_back_to_close_app: ^2.0.1
|
||||||
file_picker: ^5.5.0
|
file_picker: ^6.1.1
|
||||||
flutter_phoenix: ^1.0.0
|
flutter_phoenix: ^1.0.0
|
||||||
font_awesome_flutter: ^10.5.0
|
font_awesome_flutter: ^10.5.0
|
||||||
http: ^1.1.0
|
http: ^1.1.0
|
||||||
image_picker_gallery_camera: ^0.2.2
|
image_picker_gallery_camera: ^0.2.2
|
||||||
intl: ^0.18.1
|
intl: ^0.19.0
|
||||||
multiselect_formfield: ^0.1.2
|
multiselect_formfield: ^0.1.2
|
||||||
path_provider: ^2.0.2
|
path_provider: ^2.1.1
|
||||||
provider: ^6.0.5
|
provider: ^6.0.5
|
||||||
random_string: ^2.0.1
|
random_string: ^2.0.1
|
||||||
shared_preferences: ^2.0.6
|
shared_preferences: ^2.0.6
|
||||||
url_launcher: ^6.0.6
|
url_launcher: ^6.0.6
|
||||||
equatable: ^2.0.5
|
equatable: ^2.0.5
|
||||||
flutter_lints: ^2.0.3
|
flutter_lints: ^3.0.1
|
||||||
image_picker: ^0.7.5+4
|
image_picker: ^0.7.5+4
|
||||||
flutter_image_compress: ^2.1.0
|
flutter_image_compress: ^2.1.0
|
||||||
network_image: ^0.1.1
|
network_image: ^0.1.1
|
||||||
|
flutter_downloader: ^1.11.5
|
||||||
|
permission_handler: ^11.1.0
|
||||||
# video_player: ^0.10.11+2
|
# video_player: ^0.10.11+2
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|||||||
@@ -6,9 +6,12 @@
|
|||||||
|
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <permission_handler_windows/permission_handler_windows_plugin.h>
|
||||||
#include <url_launcher_windows/url_launcher_windows.h>
|
#include <url_launcher_windows/url_launcher_windows.h>
|
||||||
|
|
||||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
|
PermissionHandlerWindowsPluginRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
|
||||||
UrlLauncherWindowsRegisterWithRegistrar(
|
UrlLauncherWindowsRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
|
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
permission_handler_windows
|
||||||
url_launcher_windows
|
url_launcher_windows
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user