Comment some useless code of item detail

This commit is contained in:
hanie.khodkari
2025-04-22 20:59:08 +03:30
parent 00e727a793
commit 96f0e519d9
8 changed files with 558 additions and 556 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ class Routes {
static const itemAddScreen = '/ItemAddScreen';
static const itemResultScreen = '/ItemResultScreen';
static const itemFilterScreen = '/ItemFilterScreen';
static const itemDetailScreen = '/ItemDetailScreen';
// static const itemDetailScreen = '/ItemDetailScreen';
static const formTestResultScreen = '/FormTestResultScreen';
static const cycleUpdateScreen = '/CycleUpdateScreen';
static const packageUpdateScreen = '/PackageUpdateScreen';
@@ -39,7 +39,7 @@ class Routes {
static const packageScanScreen = '/PackageScanScreen';
static const myItemsResultScreen = '/MyItemsResultScreen';
static const myItemsFilterScreen = '/MyItemsFilterScreen';
static const myItemsDetailScreen = '/MyItemsDetailScreen';
static const itemDetailScreen = '/itemDetailScreen';
static const itemsTransferScreen = '/ItemsTransferScreen';
static const myItemsHistoryScreen = '/MyItemsHistoryScreen';
static const myItemsScanScreen = '/MyItemsScanScreen';
+3 -1
View File
@@ -4,6 +4,7 @@ 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/MyItemsPages/Result/my_items_result_screen.dart';
@@ -23,6 +24,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/TestPages/test_form_page.dart';
import 'package:cssd/providers/items.dart';
@@ -186,7 +188,7 @@ class MyApp extends StatelessWidget {
Routes.packageScanScreen: (ctx) => PackageScanScreen(),
Routes.myItemsResultScreen: (ctx) => MyItemsResultScreen(),
Routes.myItemsFilterScreen: (ctx) => MyItemsFilterScreen(),
Routes.myItemsDetailScreen: (ctx) => MyItemsDetailScreen(),
// Routes.myItemsDetailScreen: (ctx) => MyItemsDetailScreen(),
Routes.itemsTransferScreen: (ctx) => ItemsTransferScreen(),
Routes.myItemsScanScreen: (ctx) => MyItemsScanScreen(),
Routes.myItemsHistoryScreen: (ctx) => MyItemsHistoryScreen(),
+105 -105
View File
@@ -1,105 +1,105 @@
import 'package:cssd/models/item_model.dart';
import 'package:cssd/providers/items.dart';
import 'package:cssd/widgets/ItemScreens/Details/item_detail_box.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../config/routes.dart';
import '../../providers/connectivity.dart';
import '../../widgets/Global/internet_error.dart';
class ItemDetailScreen extends StatefulWidget {
final String? testResultId;
ItemDetailScreen({
this.testResultId,
});
@override
_ItemDetailScreenState createState() => _ItemDetailScreenState();
}
class _ItemDetailScreenState extends State<ItemDetailScreen> {
bool isInit = true;
bool isEmpty = false;
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(
() {
if (result.id == 'null') {
isEmpty = true;
}
datas = 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 PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pop();
},
child: SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Items',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: isEmpty
? Center(
child: Text('This Item does\'nt exists!'),
)
: ItemDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
)
: ConnectionErrorBox();
},
),
),
),
);
}
}
// import 'package:cssd/models/item_model.dart';
// import 'package:cssd/providers/items.dart';
// import 'package:cssd/widgets/ItemScreens/Details/item_detail_box.dart';
// import 'package:flutter/material.dart';
// import 'package:provider/provider.dart';
//
// import '../../config/routes.dart';
// import '../../providers/connectivity.dart';
// import '../../widgets/Global/internet_error.dart';
//
// class ItemDetailScreen extends StatefulWidget {
// final String? testResultId;
//
// ItemDetailScreen({
// this.testResultId,
// });
//
// @override
// _ItemDetailScreenState createState() => _ItemDetailScreenState();
// }
//
// class _ItemDetailScreenState extends State<ItemDetailScreen> {
// bool isInit = true;
// bool isEmpty = false;
// 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(
// () {
// if (result.id == 'null') {
// isEmpty = true;
// }
// datas = 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 PopScope(
// canPop: false,
// onPopInvoked: (didPop) {
// if (didPop) return;
// Navigator.of(context).pop();
// },
// child: SafeArea(
// child: Scaffold(
// appBar: AppBar(
// titleSpacing: -10,
// title: Text(
// 'Items',
// style: TextStyle(
// color: Colors.white,
// ),
// ),
// backgroundColor: Colors.black,
// leading: IconButton(
// icon: Icon(
// Icons.keyboard_arrow_left,
// color: Colors.white,
// size: 35,
// ),
// onPressed: () => Navigator.of(context).pop(),
// ),
// ),
// body: Consumer<ConnectivityProvider>(
// builder: (ct, connection, _) {
// return connection.conStatus != 'offline'
// ? isInit
// ? Center(
// child: CircularProgressIndicator(
// color: Colors.black,
// ),
// )
// : isEmpty
// ? Center(
// child: Text('This Item does\'nt exists!'),
// )
// : ItemDetailsDataBox(
// datas: datas!,
// deviceBlockSize: _deviceBlockSize,
// )
// : ConnectionErrorBox();
// },
// ),
// ),
// ),
// );
// }
// }
@@ -8,18 +8,18 @@ import 'package:provider/provider.dart';
import '../../providers/connectivity.dart';
import '../../widgets/Global/internet_error.dart';
class MyItemsDetailScreen extends StatefulWidget {
class ItemDetailScreen extends StatefulWidget {
final String? testResultId;
MyItemsDetailScreen({
ItemDetailScreen({
this.testResultId,
});
@override
_MyItemsDetailScreenState createState() => _MyItemsDetailScreenState();
_ItemDetailScreenState createState() => _ItemDetailScreenState();
}
class _MyItemsDetailScreenState extends State<MyItemsDetailScreen> {
class _ItemDetailScreenState extends State<ItemDetailScreen> {
bool isInit = true;
bool isEmpty = false;
ItemDetailObject? datas;
@@ -85,7 +85,7 @@ class _MyItemsDetailScreenState extends State<MyItemsDetailScreen> {
? Center(
child: Text('This Item does\'nt exists!'),
)
: MyItemsDetailsDataBox(
: ItemDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
push: () {
@@ -1,439 +1,439 @@
import 'package:carousel_slider/carousel_slider.dart';
import 'package:cssd/config/colors.dart';
import 'package:cssd/models/item_model.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:pinch_zoom/pinch_zoom.dart';
import 'package:url_launcher/url_launcher.dart';
class ItemDetailsDataBox extends StatelessWidget {
const ItemDetailsDataBox({
Key? key,
required this.datas,
required double deviceBlockSize,
}) : _deviceBlockSize = deviceBlockSize,
super(key: key);
final ItemDetailObject datas;
final double _deviceBlockSize;
@override
Widget build(BuildContext context) {
print(datas.status);
return Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
SizedBox(
height: 10,
),
Text(
'Item Details',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
letterSpacing: 3,
),
),
SizedBox(
height: 10,
),
Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Color.fromRGBO(235, 235, 235, 1),
border: Border(
left: BorderSide(
color: datas.status == 'approved'
? kBlue
: datas.status == 'rejected'
? kPink
: Colors.grey,
width: 2,
),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
DateFormat.yMMMd().format(
DateTime.parse(
datas.createdAt,
),
),
style: TextStyle(
color: datas.status == 'approved'
? kBlue
: datas.status == 'rejected'
? kPink
: Colors.grey,
),
),
Divider(),
Text(
'ID: ${datas.id}',
style: TextStyle(
color: datas.status == 'approved'
? kBlue
: datas.status == 'rejected'
? kPink
: Colors.grey,
fontWeight: FontWeight.w700,
),
),
SizedBox(
height: 30,
),
Row(
children: <Widget>[
Container(
width: 35 * _deviceBlockSize,
child: Text(
'Item Name',
style: TextStyle(
color: Colors.grey,
),
),
),
Container(
width: 45 * _deviceBlockSize,
child: Text(
datas.name.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
),
overflow: TextOverflow.clip,
),
),
],
),
Divider(),
SizedBox(
height: 5,
),
Row(
children: <Widget>[
Container(
width: 35 * _deviceBlockSize,
child: Text(
'Size',
style: TextStyle(
color: Colors.grey,
),
),
),
Container(
width: 45 * _deviceBlockSize,
child: Text(
datas.size.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
),
overflow: TextOverflow.clip,
),
),
],
),
Divider(),
SizedBox(
height: 5,
),
Row(
children: <Widget>[
Container(
width: 35 * _deviceBlockSize,
child: Text(
'Specific',
style: TextStyle(
color: Colors.grey,
),
),
),
Container(
width: 45 * _deviceBlockSize,
child: Text(
datas.specific.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
),
overflow: TextOverflow.clip,
),
),
],
),
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,
),
Row(
children: <Widget>[
Container(
width: 35 * _deviceBlockSize,
child: Text(
'UDI',
style: TextStyle(
color: Colors.grey,
),
),
),
Container(
width: 45 * _deviceBlockSize,
child: Text(
datas.udi.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
),
overflow: TextOverflow.clip,
),
),
],
),
Divider(),
SizedBox(
height: 5,
),
Row(
children: <Widget>[
Container(
width: 35 * _deviceBlockSize,
child: Text(
'Date',
style: TextStyle(
color: Colors.grey,
),
),
),
Container(
width: 45 * _deviceBlockSize,
child: Text(
DateFormat('d-M-y').format(
DateTime.parse(
datas.createdAt,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
),
overflow: TextOverflow.clip,
),
),
],
),
Divider(),
SizedBox(
height: 5,
),
Row(
children: <Widget>[
Container(
width: 35 * _deviceBlockSize,
child: Text(
'Description',
style: TextStyle(
color: Colors.grey,
),
),
),
Container(
width: 45 * _deviceBlockSize,
child: Text(
datas.description.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
),
overflow: TextOverflow.clip,
),
),
],
),
Divider(),
SizedBox(
height: 5,
),
Row(
children: <Widget>[
Container(
width: 35 * _deviceBlockSize,
child: Text(
'Hospital Name',
style: TextStyle(
color: Colors.grey,
),
),
),
Container(
width: 45 * _deviceBlockSize,
child: Text(
datas.hospital,
style: TextStyle(
fontWeight: FontWeight.w700,
),
overflow: TextOverflow.clip,
),
),
],
),
Divider(),
SizedBox(
height: 5,
),
Row(
children: <Widget>[
Container(
width: 35 * _deviceBlockSize,
child: Text(
'Status',
style: TextStyle(
color: Colors.grey,
),
),
),
Container(
width: 45 * _deviceBlockSize,
child: Text(
datas.status == 'approved'
? 'Approved'
: datas.status == 'rejected'
? 'Rejected'
: 'Pending..',
style: TextStyle(
fontWeight: FontWeight.w700,
color: datas.status == 'approved'
? kBlue
: datas.status == 'rejected'
? kPink
: Colors.grey,
),
overflow: TextOverflow.clip,
),
),
],
),
if (datas.filePath!.isNotEmpty) Divider(),
if (datas.filePath!.isNotEmpty)
SizedBox(
height: 10,
),
if (datas.filePath!.isNotEmpty)
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
child: CarouselSlider.builder(
disableGesture: true,
itemBuilder: (ctx, index, realIndex) {
return InkWell(
child: Image(
image: NetworkImage(datas.filePath![index])),
onTap: () {
showDialog(
context: context,
builder: (BuildContext context) => PinchZoom(
child: Image.network(datas.filePath![index])),
);
},
);
},
itemCount: datas.filePath!.length,
options: CarouselOptions(
enlargeCenterPage: true,
aspectRatio: 16 / 8,
viewportFraction: datas.filePath?.length == 1 ? 1 : 0.6,
padEnds: false,
pauseAutoPlayOnTouch: true,
disableCenter: false,
autoPlay: false,
enlargeFactor: 0.5,
enableInfiniteScroll:
datas.filePath?.length == 1 ? false : true,
),
),
),
],
),
),
SizedBox(
height: 20,
),
InkWell(
onTap: () async => await launch(
'https://cssd-doc.com/Show/Item/${datas.id.toString()}',
),
child: Container(
padding: EdgeInsets.symmetric(vertical: 20),
width: double.infinity,
decoration: BoxDecoration(
color: Color.fromRGBO(230, 230, 230, 1),
borderRadius: BorderRadius.circular(25),
),
child: Center(
child: Text(
'Show More Details',
style: TextStyle(fontWeight: FontWeight.w700),
),
),
),
),
SizedBox(
height: 30,
),
],
),
);
}
}
// import 'package:carousel_slider/carousel_slider.dart';
// import 'package:cssd/config/colors.dart';
// import 'package:cssd/models/item_model.dart';
// import 'package:flutter/material.dart';
// import 'package:intl/intl.dart';
// import 'package:pinch_zoom/pinch_zoom.dart';
// import 'package:url_launcher/url_launcher.dart';
//
// class ItemDetailsDataBox extends StatelessWidget {
// const ItemDetailsDataBox({
// Key? key,
// required this.datas,
// required double deviceBlockSize,
// }) : _deviceBlockSize = deviceBlockSize,
// super(key: key);
//
// final ItemDetailObject datas;
// final double _deviceBlockSize;
//
// @override
// Widget build(BuildContext context) {
// print(datas.status);
// return Padding(
// padding: EdgeInsets.all(20),
// child: ListView(
// children: <Widget>[
// SizedBox(
// height: 10,
// ),
// Text(
// 'Item Details',
// style: TextStyle(
// fontWeight: FontWeight.w700,
// fontSize: 5 * _deviceBlockSize,
// letterSpacing: 3,
// ),
// ),
// SizedBox(
// height: 10,
// ),
// Container(
// padding: EdgeInsets.all(10),
// decoration: BoxDecoration(
// color: Color.fromRGBO(235, 235, 235, 1),
// border: Border(
// left: BorderSide(
// color: datas.status == 'approved'
// ? kBlue
// : datas.status == 'rejected'
// ? kPink
// : Colors.grey,
// width: 2,
// ),
// ),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// Text(
// DateFormat.yMMMd().format(
// DateTime.parse(
// datas.createdAt,
// ),
// ),
// style: TextStyle(
// color: datas.status == 'approved'
// ? kBlue
// : datas.status == 'rejected'
// ? kPink
// : Colors.grey,
// ),
// ),
// Divider(),
// Text(
// 'ID: ${datas.id}',
// style: TextStyle(
// color: datas.status == 'approved'
// ? kBlue
// : datas.status == 'rejected'
// ? kPink
// : Colors.grey,
// fontWeight: FontWeight.w700,
// ),
// ),
// SizedBox(
// height: 30,
// ),
// Row(
// children: <Widget>[
// Container(
// width: 35 * _deviceBlockSize,
// child: Text(
// 'Item Name',
// style: TextStyle(
// color: Colors.grey,
// ),
// ),
// ),
// Container(
// width: 45 * _deviceBlockSize,
// child: Text(
// datas.name.toString(),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// ),
// overflow: TextOverflow.clip,
// ),
// ),
// ],
// ),
// Divider(),
// SizedBox(
// height: 5,
// ),
// Row(
// children: <Widget>[
// Container(
// width: 35 * _deviceBlockSize,
// child: Text(
// 'Size',
// style: TextStyle(
// color: Colors.grey,
// ),
// ),
// ),
// Container(
// width: 45 * _deviceBlockSize,
// child: Text(
// datas.size.toString(),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// ),
// overflow: TextOverflow.clip,
// ),
// ),
// ],
// ),
// Divider(),
// SizedBox(
// height: 5,
// ),
// Row(
// children: <Widget>[
// Container(
// width: 35 * _deviceBlockSize,
// child: Text(
// 'Specific',
// style: TextStyle(
// color: Colors.grey,
// ),
// ),
// ),
// Container(
// width: 45 * _deviceBlockSize,
// child: Text(
// datas.specific.toString(),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// ),
// overflow: TextOverflow.clip,
// ),
// ),
// ],
// ),
// 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,
// ),
// Row(
// children: <Widget>[
// Container(
// width: 35 * _deviceBlockSize,
// child: Text(
// 'UDI',
// style: TextStyle(
// color: Colors.grey,
// ),
// ),
// ),
// Container(
// width: 45 * _deviceBlockSize,
// child: Text(
// datas.udi.toString(),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// ),
// overflow: TextOverflow.clip,
// ),
// ),
// ],
// ),
// Divider(),
// SizedBox(
// height: 5,
// ),
// Row(
// children: <Widget>[
// Container(
// width: 35 * _deviceBlockSize,
// child: Text(
// 'Date',
// style: TextStyle(
// color: Colors.grey,
// ),
// ),
// ),
// Container(
// width: 45 * _deviceBlockSize,
// child: Text(
// DateFormat('d-M-y').format(
// DateTime.parse(
// datas.createdAt,
// ),
// ),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// ),
// overflow: TextOverflow.clip,
// ),
// ),
// ],
// ),
// Divider(),
// SizedBox(
// height: 5,
// ),
// Row(
// children: <Widget>[
// Container(
// width: 35 * _deviceBlockSize,
// child: Text(
// 'Description',
// style: TextStyle(
// color: Colors.grey,
// ),
// ),
// ),
// Container(
// width: 45 * _deviceBlockSize,
// child: Text(
// datas.description.toString(),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// ),
// overflow: TextOverflow.clip,
// ),
// ),
// ],
// ),
// Divider(),
// SizedBox(
// height: 5,
// ),
// Row(
// children: <Widget>[
// Container(
// width: 35 * _deviceBlockSize,
// child: Text(
// 'Hospital Name',
// style: TextStyle(
// color: Colors.grey,
// ),
// ),
// ),
// Container(
// width: 45 * _deviceBlockSize,
// child: Text(
// datas.hospital,
// style: TextStyle(
// fontWeight: FontWeight.w700,
// ),
// overflow: TextOverflow.clip,
// ),
// ),
// ],
// ),
// Divider(),
// SizedBox(
// height: 5,
// ),
// Row(
// children: <Widget>[
// Container(
// width: 35 * _deviceBlockSize,
// child: Text(
// 'Status',
// style: TextStyle(
// color: Colors.grey,
// ),
// ),
// ),
// Container(
// width: 45 * _deviceBlockSize,
// child: Text(
// datas.status == 'approved'
// ? 'Approved'
// : datas.status == 'rejected'
// ? 'Rejected'
// : 'Pending..',
// style: TextStyle(
// fontWeight: FontWeight.w700,
// color: datas.status == 'approved'
// ? kBlue
// : datas.status == 'rejected'
// ? kPink
// : Colors.grey,
// ),
// overflow: TextOverflow.clip,
// ),
// ),
// ],
// ),
// if (datas.filePath!.isNotEmpty) Divider(),
// if (datas.filePath!.isNotEmpty)
// SizedBox(
// height: 10,
// ),
// if (datas.filePath!.isNotEmpty)
// Container(
// width: double.infinity,
// padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
// child: CarouselSlider.builder(
// disableGesture: true,
// itemBuilder: (ctx, index, realIndex) {
// return InkWell(
// child: Image(
// image: NetworkImage(datas.filePath![index])),
// onTap: () {
// showDialog(
// context: context,
// builder: (BuildContext context) => PinchZoom(
// child: Image.network(datas.filePath![index])),
// );
// },
// );
// },
// itemCount: datas.filePath!.length,
// options: CarouselOptions(
// enlargeCenterPage: true,
// aspectRatio: 16 / 8,
// viewportFraction: datas.filePath?.length == 1 ? 1 : 0.6,
// padEnds: false,
// pauseAutoPlayOnTouch: true,
// disableCenter: false,
// autoPlay: false,
// enlargeFactor: 0.5,
// enableInfiniteScroll:
// datas.filePath?.length == 1 ? false : true,
// ),
// ),
// ),
// ],
// ),
// ),
// SizedBox(
// height: 20,
// ),
// InkWell(
// onTap: () async => await launch(
// 'https://cssd-doc.com/Show/Item/${datas.id.toString()}',
// ),
// child: Container(
// padding: EdgeInsets.symmetric(vertical: 20),
// width: double.infinity,
// decoration: BoxDecoration(
// color: Color.fromRGBO(230, 230, 230, 1),
// borderRadius: BorderRadius.circular(25),
// ),
// child: Center(
// child: Text(
// 'Show More Details',
// style: TextStyle(fontWeight: FontWeight.w700),
// ),
// ),
// ),
// ),
// SizedBox(
// height: 30,
// ),
// ],
// ),
// );
// }
// }
@@ -14,8 +14,8 @@ import 'package:pinch_zoom/pinch_zoom.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class MyItemsDetailsDataBox extends StatelessWidget {
const MyItemsDetailsDataBox({
class ItemDetailsDataBox extends StatelessWidget {
const ItemDetailsDataBox({
Key? key,
required this.datas,
required double deviceBlockSize,
@@ -24,7 +24,7 @@ class RequestsDataBox extends StatelessWidget {
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => Navigator.of(context).pushNamed(
Routes.myItemsDetailScreen,
Routes.itemDetailScreen,
arguments: item!.id,
),
child: Card(
@@ -27,7 +27,7 @@ class MyItemsItemDataBox extends StatelessWidget {
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => Navigator.of(context).pushNamed(
Routes.myItemsDetailScreen,
Routes.itemDetailScreen,
arguments: items!.id,
),
child: Card(