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