// 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 { // bool isInit = true; // bool isEmpty = false; // ItemDetailObject? datas; // // @override // void didChangeDependencies() async { // if (isInit) { // var _id = ModalRoute.of(context)!.settings.arguments; // await Provider.of(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( // 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(); // }, // ), // ), // ), // ); // } // }