mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 19:08:55 +03:30
commit
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
class CycleResultBanner extends StatelessWidget {
|
||||
const CycleResultBanner({
|
||||
Key key,
|
||||
@required double deviceBlockSize,
|
||||
}) : _deviceBlockSize = deviceBlockSize,
|
||||
super(key: key);
|
||||
|
||||
final double _deviceBlockSize;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'CYCLES',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 7 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: 2,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
InkWell(
|
||||
customBorder: CircleBorder(),
|
||||
onTap: () {
|
||||
Navigator.of(context).popAndPushNamed(Routes.cycleFilterScreen);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Icon(
|
||||
FontAwesomeIcons.filter,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:cssd/models/cycles_models.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class CycleItemBox extends StatelessWidget {
|
||||
final CycleResultObject item;
|
||||
final String labels;
|
||||
|
||||
const CycleItemBox({
|
||||
Key key,
|
||||
@required double deviceBlockSize,
|
||||
this.item,
|
||||
this.labels,
|
||||
}) : _deviceBlockSize = deviceBlockSize,
|
||||
super(key: key);
|
||||
|
||||
final double _deviceBlockSize;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => Navigator.of(context).pushNamed(
|
||||
Routes.cycleDetailScreen,
|
||||
arguments: item.id,
|
||||
),
|
||||
child: Card(
|
||||
elevation: 1,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
item.id,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 3 * _deviceBlockSize,
|
||||
),
|
||||
// Spacer(),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: 50 * _deviceBlockSize,
|
||||
child: Text(
|
||||
'Label Included:',
|
||||
style: TextStyle(
|
||||
fontSize: 3 * _deviceBlockSize,
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 50 * _deviceBlockSize,
|
||||
child: Text(
|
||||
labels,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 3 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 50 * _deviceBlockSize,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Date:',
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 3 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
DateFormat('y-M-d').format(
|
||||
DateTime.parse(
|
||||
item.createdAt,
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 3 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
customBorder: CircleBorder(),
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
Routes.cycleDetailScreen,
|
||||
arguments: item.id,
|
||||
);
|
||||
// TestDetail(testResultId: item.id.toString());
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(7),
|
||||
width: 10 * _deviceBlockSize,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.black,
|
||||
),
|
||||
child: Icon(
|
||||
FontAwesomeIcons.fileAlt,
|
||||
size: 6 * _deviceBlockSize,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cssd/providers/cycles.dart';
|
||||
|
||||
class CycleFilterBaner extends StatelessWidget {
|
||||
const CycleFilterBaner({
|
||||
Key key,
|
||||
@required double deviceBlockSize,
|
||||
}) : _deviceBlockSize = deviceBlockSize,
|
||||
super(key: key);
|
||||
|
||||
final double _deviceBlockSize;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).popAndPushNamed(Routes.cycleFilterScreen);
|
||||
},
|
||||
child: Chip(
|
||||
backgroundColor: Colors.black,
|
||||
label: Text(
|
||||
'Filters',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
deleteIcon: Icon(
|
||||
FontAwesomeIcons.filter,
|
||||
color: Colors.white,
|
||||
size: 4 * _deviceBlockSize,
|
||||
),
|
||||
onDeleted: () {
|
||||
Navigator.of(context).popAndPushNamed(Routes.cycleFilterScreen);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CycleFilterChip extends StatelessWidget {
|
||||
const CycleFilterChip({
|
||||
Key key,
|
||||
@required double deviceBlockSize,
|
||||
@required String label,
|
||||
@required String id,
|
||||
@required String cycleNumber,
|
||||
@required String sterilizerId,
|
||||
@required String hospital,
|
||||
@required String date,
|
||||
}) : _deviceBlockSize = deviceBlockSize,
|
||||
_label = label,
|
||||
_id = id,
|
||||
_cycleNumber = cycleNumber,
|
||||
_sterilizerId = sterilizerId,
|
||||
_hospital = hospital,
|
||||
_date = date,
|
||||
super(key: key);
|
||||
|
||||
final double _deviceBlockSize;
|
||||
final String _label;
|
||||
final String _id;
|
||||
final String _cycleNumber;
|
||||
final String _sterilizerId;
|
||||
final String _hospital;
|
||||
final String _date;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(children: <Widget>[
|
||||
SizedBox(
|
||||
width: _deviceBlockSize,
|
||||
),
|
||||
Chip(
|
||||
backgroundColor: Colors.black,
|
||||
label: Text(
|
||||
_label,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
deleteIcon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.white,
|
||||
),
|
||||
onDeleted: () {
|
||||
var cycleProvider = Provider.of<CyclesProvider>(context);
|
||||
cycleProvider.setFilters(
|
||||
_id,
|
||||
_cycleNumber,
|
||||
_sterilizerId,
|
||||
_hospital,
|
||||
_date,
|
||||
);
|
||||
// cycle.resetPageNumber();
|
||||
// cycle.setFilters(
|
||||
// '',
|
||||
// cycle.filters.cycleNumber,
|
||||
// cycle.filters.sterilizerId,
|
||||
// cycle.filters.hospital,
|
||||
// cycle.filters.date,
|
||||
// );
|
||||
cycleProvider.setLoading();
|
||||
cycleProvider.getCycleResults().then((_) {
|
||||
cycleProvider.resetLoading();
|
||||
});
|
||||
// _reloadItems();
|
||||
},
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cssd/providers/cycles.dart';
|
||||
class CycleResultSearchBox extends StatelessWidget {
|
||||
const CycleResultSearchBox({
|
||||
Key key,
|
||||
@required this.searchCTRL,
|
||||
@required double deviceBlockSize,
|
||||
}) : _deviceBlockSize = deviceBlockSize,
|
||||
super(key: key);
|
||||
|
||||
final TextEditingController searchCTRL;
|
||||
final double _deviceBlockSize;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TextField(
|
||||
onEditingComplete: () {
|
||||
FocusScope.of(context).unfocus();
|
||||
},
|
||||
controller: searchCTRL,
|
||||
onChanged: (value) {
|
||||
Provider.of<CyclesProvider>(context, listen: false).search(value);
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.search,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Search by cycle ID',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user