mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 04:28:55 +03:30
1.7.1
This commit is contained in:
+144
-141
@@ -1,11 +1,11 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import '../config/routes.dart';
|
||||
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
import 'package:cssd/widgets/CycleScreens/Result/banner.dart';
|
||||
import 'package:cssd/widgets/CycleScreens/Result/data_box.dart';
|
||||
import 'package:cssd/widgets/CycleScreens/Result/filter_objects.dart';
|
||||
import 'package:cssd/widgets/CycleScreens/Result/search_box.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
import '../providers/connectivity.dart';
|
||||
import '../widgets/CycleScreens/Result/banner.dart';
|
||||
import '../widgets/CycleScreens/Result/data_box.dart';
|
||||
import '../widgets/CycleScreens/Result/filter_objects.dart';
|
||||
import '../widgets/CycleScreens/Result/search_box.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
|
||||
import '../providers/cycles.dart';
|
||||
|
||||
@@ -62,142 +62,145 @@ class _CycleResultScreenState extends State<CycleResultScreen> {
|
||||
final _media = MediaQuery.of(context);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
floatingActionButton: CycleResultFloatingButton(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Home'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
floatingActionButton: CycleResultFloatingButton(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? Padding(
|
||||
padding:
|
||||
EdgeInsets.only(top: 20, right: 20, bottom: 60, left: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
CycleResultBanner(deviceBlockSize: _deviceBlockSize),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Consumer<CyclesProvider>(builder: (ctx, cycle, _) {
|
||||
return Container(
|
||||
height: 50,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: true,
|
||||
children: <Widget>[
|
||||
CycleFilterBaner(deviceBlockSize: _deviceBlockSize),
|
||||
cycle.filters.id != ''
|
||||
? CycleFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'ID',
|
||||
id: '',
|
||||
cycleNumber: cycle.filters.cycleNumber,
|
||||
sterilizerId: cycle.filters.sterilizerId,
|
||||
hospital: cycle.filters.hospital,
|
||||
date: cycle.filters.date,
|
||||
)
|
||||
: Container(),
|
||||
cycle.filters.cycleNumber != ''
|
||||
? CycleFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Cycle Number',
|
||||
id: cycle.filters.id,
|
||||
cycleNumber: '',
|
||||
sterilizerId: cycle.filters.sterilizerId,
|
||||
hospital: cycle.filters.hospital,
|
||||
date: cycle.filters.date,
|
||||
)
|
||||
: Container(),
|
||||
cycle.filters.sterilizerId != ''
|
||||
? CycleFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Sterilizer ID',
|
||||
id: cycle.filters.id,
|
||||
cycleNumber: cycle.filters.cycleNumber,
|
||||
sterilizerId: '',
|
||||
hospital: cycle.filters.hospital,
|
||||
date: cycle.filters.date,
|
||||
)
|
||||
: Container(),
|
||||
cycle.filters.hospital != ''
|
||||
? CycleFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Hospital',
|
||||
id: cycle.filters.id,
|
||||
cycleNumber: cycle.filters.cycleNumber,
|
||||
sterilizerId: cycle.filters.sterilizerId,
|
||||
hospital: '',
|
||||
date: cycle.filters.date,
|
||||
)
|
||||
: Container(),
|
||||
cycle.filters.date != ''
|
||||
? CycleFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Date',
|
||||
id: cycle.filters.id,
|
||||
cycleNumber: cycle.filters.cycleNumber,
|
||||
sterilizerId: cycle.filters.sterilizerId,
|
||||
hospital: cycle.filters.hospital,
|
||||
date: '',
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
CycleResultSearchBox(
|
||||
searchCTRL: searchCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Expanded(
|
||||
child: Consumer<CyclesProvider>(
|
||||
builder: (context, cycleResults, _) {
|
||||
return cycleResults.isloading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: ListView.builder(
|
||||
controller: sc,
|
||||
itemBuilder: (context, index) {
|
||||
String labels = '';
|
||||
for (var label
|
||||
in cycleResults.items[index].label) {
|
||||
labels += label;
|
||||
labels += ' , ';
|
||||
}
|
||||
labels = labels.substring(
|
||||
0, labels.length - 3); // remove extra ,
|
||||
return CycleItemBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
item: cycleResults.items[index],
|
||||
labels: labels,
|
||||
);
|
||||
},
|
||||
itemCount: cycleResults.items.length,
|
||||
shrinkWrap: true,
|
||||
);
|
||||
},
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Home'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? Padding(
|
||||
padding:
|
||||
EdgeInsets.only(top: 20, right: 20, bottom: 60, left: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
CycleResultBanner(deviceBlockSize: _deviceBlockSize),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
Consumer<CyclesProvider>(builder: (ctx, cycle, _) {
|
||||
return Container(
|
||||
height: 50,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: true,
|
||||
children: <Widget>[
|
||||
CycleFilterBaner(
|
||||
deviceBlockSize: _deviceBlockSize),
|
||||
cycle.filters.id != ''
|
||||
? CycleFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'ID',
|
||||
id: '',
|
||||
cycleNumber: cycle.filters.cycleNumber,
|
||||
sterilizerId: cycle.filters.sterilizerId,
|
||||
hospital: cycle.filters.hospital,
|
||||
date: cycle.filters.date,
|
||||
)
|
||||
: Container(),
|
||||
cycle.filters.cycleNumber != ''
|
||||
? CycleFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Cycle Number',
|
||||
id: cycle.filters.id,
|
||||
cycleNumber: '',
|
||||
sterilizerId: cycle.filters.sterilizerId,
|
||||
hospital: cycle.filters.hospital,
|
||||
date: cycle.filters.date,
|
||||
)
|
||||
: Container(),
|
||||
cycle.filters.sterilizerId != ''
|
||||
? CycleFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Sterilizer ID',
|
||||
id: cycle.filters.id,
|
||||
cycleNumber: cycle.filters.cycleNumber,
|
||||
sterilizerId: '',
|
||||
hospital: cycle.filters.hospital,
|
||||
date: cycle.filters.date,
|
||||
)
|
||||
: Container(),
|
||||
cycle.filters.hospital != ''
|
||||
? CycleFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Hospital',
|
||||
id: cycle.filters.id,
|
||||
cycleNumber: cycle.filters.cycleNumber,
|
||||
sterilizerId: cycle.filters.sterilizerId,
|
||||
hospital: '',
|
||||
date: cycle.filters.date,
|
||||
)
|
||||
: Container(),
|
||||
cycle.filters.date != ''
|
||||
? CycleFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Date',
|
||||
id: cycle.filters.id,
|
||||
cycleNumber: cycle.filters.cycleNumber,
|
||||
sterilizerId: cycle.filters.sterilizerId,
|
||||
hospital: cycle.filters.hospital,
|
||||
date: '',
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
CycleResultSearchBox(
|
||||
searchCTRL: searchCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Expanded(
|
||||
child: Consumer<CyclesProvider>(
|
||||
builder: (context, cycleResults, _) {
|
||||
return cycleResults.isloading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: ListView.builder(
|
||||
controller: sc,
|
||||
itemBuilder: (context, index) {
|
||||
String labels = '';
|
||||
for (var label
|
||||
in cycleResults.items[index].label) {
|
||||
labels += label;
|
||||
labels += ' , ';
|
||||
}
|
||||
labels = labels.substring(0,
|
||||
labels.length - 3); // remove extra ,
|
||||
return CycleItemBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
item: cycleResults.items[index],
|
||||
labels: labels,
|
||||
);
|
||||
},
|
||||
itemCount: cycleResults.items.length,
|
||||
shrinkWrap: true,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user