mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 14:48:55 +03:30
commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TestResultAddButton extends StatelessWidget {
|
||||
const TestResultAddButton({
|
||||
Key key,
|
||||
@required double deviceBlockSize,
|
||||
}) : _deviceBlockSize = deviceBlockSize,
|
||||
super(key: key);
|
||||
|
||||
final double _deviceBlockSize;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
customBorder: CircleBorder(),
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(Routes.testResultAddScreen);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.redAccent,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
size: 10 * _deviceBlockSize,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../../providers/test_results.dart';
|
||||
|
||||
class TestResultChip extends StatelessWidget {
|
||||
const TestResultChip({
|
||||
Key key,
|
||||
@required double deviceBlockSize,
|
||||
@required String label,
|
||||
@required String id,
|
||||
@required String labelID,
|
||||
@required String testType,
|
||||
@required String hospital,
|
||||
@required String username,
|
||||
@required String fDate,
|
||||
@required String uDate,
|
||||
}) : _deviceBlockSize = deviceBlockSize,
|
||||
_id = id,
|
||||
_labelID = labelID,
|
||||
_testType = testType,
|
||||
_hispotal = hospital,
|
||||
_label = label,
|
||||
_username = username,
|
||||
_fDate = fDate,
|
||||
_uDate = uDate,
|
||||
super(key: key);
|
||||
|
||||
final double _deviceBlockSize;
|
||||
final String _id;
|
||||
final String _labelID;
|
||||
final String _testType;
|
||||
final String _hispotal;
|
||||
final String _label;
|
||||
final String _username;
|
||||
final String _fDate;
|
||||
final String _uDate;
|
||||
|
||||
@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 labelProviderObject = Provider.of<TestResultsProvider>(context);
|
||||
labelProviderObject.setFilters(
|
||||
_id,
|
||||
_labelID,
|
||||
_username,
|
||||
_testType,
|
||||
_hispotal,
|
||||
_fDate,
|
||||
_uDate,
|
||||
);
|
||||
labelProviderObject.setLoading();
|
||||
labelProviderObject.getTestResults().then((_) {
|
||||
labelProviderObject.resetLoading();
|
||||
});
|
||||
},
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TestResultFloatingButton extends StatelessWidget {
|
||||
const TestResultFloatingButton({
|
||||
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.testResultAddScreen);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Color.fromRGBO(0, 190, 190, 1),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
size: 10 * _deviceBlockSize,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../../providers/test_results.dart';
|
||||
|
||||
class TestResultSearchBox extends StatelessWidget {
|
||||
const TestResultSearchBox({
|
||||
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();
|
||||
},
|
||||
onChanged: (value) {
|
||||
Provider.of<TestResultsProvider>(context, listen: false).search(value);
|
||||
},
|
||||
controller: searchCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.search,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Search by test name',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user