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