mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-10 19:48:56 +03:30
1.7.1
This commit is contained in:
+2
-2
@@ -3,7 +3,6 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_phoenix/flutter_phoenix.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import './pages/home_screen.dart';
|
||||
import 'config/routes.dart';
|
||||
import 'pages/cycle_add_screen.dart';
|
||||
import 'pages/cycle_detail_screen.dart';
|
||||
@@ -11,6 +10,7 @@ import 'pages/cycle_filter_screen.dart';
|
||||
import 'pages/cycle_result_screen.dart';
|
||||
import 'pages/cycle_scan_screen.dart';
|
||||
import 'pages/forget_pass_screen.dart';
|
||||
import 'pages/home_screen.dart';
|
||||
import 'pages/label_add_screen.dart';
|
||||
import 'pages/label_detail_screen.dart';
|
||||
import 'pages/label_filter_screen.dart';
|
||||
@@ -90,7 +90,7 @@ class MyApp extends StatelessWidget {
|
||||
title: 'CSSD-DOC',
|
||||
theme: ThemeData(
|
||||
primaryColor: Colors.black,
|
||||
cursorColor: Colors.black,
|
||||
// cursorColor: Colors.black,
|
||||
fontFamily: 'montserrat',
|
||||
// primaryTextTheme: TextTheme(
|
||||
// body1: TextStyle(
|
||||
|
||||
+197
-192
@@ -1,17 +1,18 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:cssd/models/cycles_models.dart';
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
import 'package:cssd/providers/cycles.dart';
|
||||
import 'package:cssd/widgets/CycleScreens/Add/add_label_box.dart';
|
||||
import 'package:cssd/widgets/CycleScreens/Add/date_picker.dart';
|
||||
import 'package:cssd/widgets/CycleScreens/Add/save_button.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
import '../config/routes.dart';
|
||||
import '../models/cycles_models.dart';
|
||||
import '../providers/connectivity.dart';
|
||||
import '../providers/cycles.dart';
|
||||
import '../widgets/CycleScreens/Add/add_label_box.dart';
|
||||
import '../widgets/CycleScreens/Add/date_picker.dart';
|
||||
import '../widgets/CycleScreens/Add/save_button.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
|
||||
class CycleAddScreen extends StatefulWidget {
|
||||
// static const route = '/CycleAddScreen';
|
||||
@@ -84,202 +85,206 @@ class _CycleAddScreenState extends State<CycleAddScreen> {
|
||||
);
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Cycles'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Cycles'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context)
|
||||
.pushReplacementNamed(Routes.cycleResultScreen),
|
||||
),
|
||||
onPressed: () => Navigator.of(context)
|
||||
.pushReplacementNamed(Routes.cycleResultScreen),
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'ADD A CYCLE',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
|
||||
TextFormField(
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Strilizer ID required!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: striizerIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Strilizer ID',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_cycleNumberFocusNode);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Cycle number required!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: cycleNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Cycle Number',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
focusNode: _cycleNumberFocusNode,
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_descriptionFocosNode);
|
||||
},
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 10),
|
||||
child: Text(
|
||||
'LABELS INCLUDED',
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'ADD A CYCLE',
|
||||
style: TextStyle(
|
||||
color: Colors.deepOrange,
|
||||
letterSpacing: 2,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
|
||||
TextFormField(
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Strilizer ID required!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: striizerIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Strilizer ID',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_cycleNumberFocusNode);
|
||||
},
|
||||
),
|
||||
),
|
||||
Consumer<CyclesProvider>(
|
||||
builder: (ctx, cycleProvider, _) =>
|
||||
ListView.builder(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (ctx, index) => CycleAddLabelBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
labelValues: cycleProvider.labelValues[index],
|
||||
labelVals: cycleProvider.labelVals,
|
||||
initialLabelValue:
|
||||
cycleProvider.initialLabelValue,
|
||||
index: index,
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Cycle number required!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: cycleNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Cycle Number',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
itemCount: cycleProvider.labelValues.length,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
focusNode: _cycleNumberFocusNode,
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_descriptionFocosNode);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
CycleAddDatePicker(
|
||||
dateCTRL: dateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
controller: descriptionCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.alignLeft,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Description',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 10),
|
||||
child: Text(
|
||||
'LABELS INCLUDED',
|
||||
style: TextStyle(
|
||||
color: Colors.deepOrange,
|
||||
letterSpacing: 2,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
Consumer<CyclesProvider>(
|
||||
builder: (ctx, cycleProvider, _) =>
|
||||
ListView.builder(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (ctx, index) => CycleAddLabelBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
labelValues:
|
||||
cycleProvider.labelValues[index],
|
||||
labelVals: cycleProvider.labelVals,
|
||||
initialLabelValue:
|
||||
cycleProvider.initialLabelValue,
|
||||
index: index,
|
||||
),
|
||||
itemCount: cycleProvider.labelValues.length,
|
||||
),
|
||||
),
|
||||
keyboardType: TextInputType.multiline,
|
||||
focusNode: _descriptionFocosNode,
|
||||
minLines: 1,
|
||||
maxLines: 5,
|
||||
),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
CycleAddSaveButton(
|
||||
form: _form,
|
||||
labelValues: Provider.of<CyclesProvider>(context,
|
||||
listen: false)
|
||||
.labelValues,
|
||||
cycleNumberCTRL: cycleNumberCTRL,
|
||||
dateValue: dateCTRL.text,
|
||||
descriptionCTRL: descriptionCTRL,
|
||||
striizerIdCTRL: striizerIdCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 100,
|
||||
),
|
||||
|
||||
// DropDownBox(values: ['Washer ID']),
|
||||
],
|
||||
CycleAddDatePicker(
|
||||
dateCTRL: dateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
controller: descriptionCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.alignLeft,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Description',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.multiline,
|
||||
focusNode: _descriptionFocosNode,
|
||||
minLines: 1,
|
||||
maxLines: 5,
|
||||
),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
CycleAddSaveButton(
|
||||
form: _form,
|
||||
labelValues: Provider.of<CyclesProvider>(
|
||||
context,
|
||||
listen: false)
|
||||
.labelValues,
|
||||
cycleNumberCTRL: cycleNumberCTRL,
|
||||
dateValue: dateCTRL.text,
|
||||
descriptionCTRL: descriptionCTRL,
|
||||
striizerIdCTRL: striizerIdCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 100,
|
||||
),
|
||||
|
||||
// DropDownBox(values: ['Washer ID']),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import 'package:cssd/models/cycles_models.dart';
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
import 'package:cssd/providers/cycles.dart';
|
||||
import 'package:cssd/widgets/CycleScreens/Details/datas_box.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../models/cycles_models.dart';
|
||||
import '../providers/connectivity.dart';
|
||||
import '../providers/cycles.dart';
|
||||
import '../widgets/CycleScreens/Details/datas_box.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
|
||||
class CycleDetailScreen extends StatefulWidget {
|
||||
// static const route = '/CycleDetailScreen';
|
||||
final String testResultId;
|
||||
@@ -49,35 +50,36 @@ class _CycleDetailScreenState extends State<CycleDetailScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
print(datas);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Cycles'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Cycles'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: isEmpty
|
||||
? Center(
|
||||
child: Text('This Cycle doesnt exists!'),
|
||||
)
|
||||
: CycleDetailsDataBox(
|
||||
datas: datas,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: isEmpty
|
||||
? Center(
|
||||
child: Text('This Cycle doesnt exists!'),
|
||||
)
|
||||
: CycleDetailsDataBox(
|
||||
datas: datas,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+200
-198
@@ -1,4 +1,4 @@
|
||||
import 'package:barcode_scan/barcode_scan.dart';
|
||||
import 'package:barcode_scan2/barcode_scan2.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -98,206 +98,208 @@ class _CycleFilterScreenState extends State<CycleFilterScreen> {
|
||||
);
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Cycles'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Cycles'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context)
|
||||
.pushReplacementNamed(Routes.cycleResultScreen),
|
||||
),
|
||||
onPressed: () => Navigator.of(context)
|
||||
.pushReplacementNamed(Routes.cycleResultScreen),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'FILTER RESULTS',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 8,
|
||||
child: TextFormField(
|
||||
controller: cycleIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Cycle ID',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_cycleNumberFocusNode);
|
||||
},
|
||||
),
|
||||
),
|
||||
// Spacer(),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
scan().then(
|
||||
(String result) {
|
||||
if (result == 'cancel') {
|
||||
print('cancel');
|
||||
} else if (result == 'error') {
|
||||
print('error');
|
||||
} else if (result == 'access') {
|
||||
print('access');
|
||||
} else {
|
||||
print(result);
|
||||
cycleIdCTRL.text = result;
|
||||
// Navigator.of(context).pushNamed(
|
||||
// CycleDetailScreen.route,
|
||||
// arguments: result,
|
||||
// );
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.black,
|
||||
),
|
||||
child: Icon(
|
||||
FontAwesomeIcons.barcode,
|
||||
size: 5 * _deviceBlockSize,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
controller: cycleNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Cycle Number',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
focusNode: _cycleNumberFocusNode,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_strilizerIdFocusNode);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextField(
|
||||
controller: striizerIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Strilizer ID',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
focusNode: _strilizerIdFocusNode,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.done,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
CycleFilterSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
hospitalCTRL: hospitalCTRL,
|
||||
hospitalVals: hospitalVals,
|
||||
label: 'Hospital',
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
CycleFilterDatePicker(
|
||||
dateCTRL: dateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
CycleFilterSaveButton(
|
||||
hospitalVals: hospitalVals,
|
||||
hospitalCTRL: hospitalCTRL,
|
||||
cycleIdCTRL: cycleIdCTRL,
|
||||
cycleNumberCTRL: cycleNumberCTRL,
|
||||
striizerIdCTRL: striizerIdCTRL,
|
||||
dateCTRL: dateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 100,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'FILTER RESULTS',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 8,
|
||||
child: TextFormField(
|
||||
controller: cycleIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Cycle ID',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_cycleNumberFocusNode);
|
||||
},
|
||||
),
|
||||
),
|
||||
// Spacer(),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
scan().then(
|
||||
(String result) {
|
||||
if (result == 'cancel') {
|
||||
print('cancel');
|
||||
} else if (result == 'error') {
|
||||
print('error');
|
||||
} else if (result == 'access') {
|
||||
print('access');
|
||||
} else {
|
||||
print(result);
|
||||
cycleIdCTRL.text = result;
|
||||
// Navigator.of(context).pushNamed(
|
||||
// CycleDetailScreen.route,
|
||||
// arguments: result,
|
||||
// );
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.black,
|
||||
),
|
||||
child: Icon(
|
||||
FontAwesomeIcons.barcode,
|
||||
size: 5 * _deviceBlockSize,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
controller: cycleNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Cycle Number',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
focusNode: _cycleNumberFocusNode,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_strilizerIdFocusNode);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextField(
|
||||
controller: striizerIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Strilizer ID',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
focusNode: _strilizerIdFocusNode,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.done,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
CycleFilterSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
hospitalCTRL: hospitalCTRL,
|
||||
hospitalVals: hospitalVals,
|
||||
label: 'Hospital',
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
CycleFilterDatePicker(
|
||||
dateCTRL: dateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
CycleFilterSaveButton(
|
||||
hospitalVals: hospitalVals,
|
||||
hospitalCTRL: hospitalCTRL,
|
||||
cycleIdCTRL: cycleIdCTRL,
|
||||
cycleNumberCTRL: cycleNumberCTRL,
|
||||
striizerIdCTRL: striizerIdCTRL,
|
||||
dateCTRL: dateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 100,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
+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();
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+154
-151
@@ -1,13 +1,13 @@
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
import 'package:barcode_scan2/barcode_scan2.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:barcode_scan/barcode_scan.dart';
|
||||
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../providers/connectivity.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
|
||||
class CycleScanScreen extends StatefulWidget {
|
||||
// static const route = '/cycleScanScreen';
|
||||
@override
|
||||
@@ -27,167 +27,170 @@ class _CycleScanScreenState extends State<CycleScanScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
titleSpacing: -10,
|
||||
title: Text('CSSD'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
titleSpacing: -10,
|
||||
title: Text('CSSD'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 30),
|
||||
child: Text(
|
||||
'LOOKING FOR A CYCLE?',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5.5 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
child: Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 10),
|
||||
height: 200,
|
||||
decoration: BoxDecoration(border: Border.all()),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Please Scan The Cycle Barcode',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w100,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 30),
|
||||
child: Text(
|
||||
'LOOKING FOR A CYCLE?',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5.5 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
scan().then(
|
||||
(String result) {
|
||||
if (result == 'cancel') {
|
||||
print('cancel');
|
||||
} else if (result == 'error') {
|
||||
print('error');
|
||||
} else if (result == 'access') {
|
||||
print('access');
|
||||
} else {
|
||||
launch(
|
||||
'https://cssd-doc.com/Show/Cycle/$result',
|
||||
);
|
||||
// Navigator.of(context).pushNamed(
|
||||
// Routes.cycleDetailScreen,
|
||||
// arguments: result,
|
||||
// );
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
Form(
|
||||
key: _form,
|
||||
child: TextFormField(
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Id required!!';
|
||||
}
|
||||
return null;
|
||||
GestureDetector(
|
||||
child: Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 10),
|
||||
height: 200,
|
||||
decoration: BoxDecoration(border: Border.all()),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Please Scan The Cycle Barcode',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w100,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
scan().then(
|
||||
(String result) {
|
||||
if (result == 'cancel') {
|
||||
print('cancel');
|
||||
} else if (result == 'error') {
|
||||
print('error');
|
||||
} else if (result == 'access') {
|
||||
print('access');
|
||||
} else {
|
||||
launch(
|
||||
'https://cssd-doc.com/Show/Cycle/$result',
|
||||
);
|
||||
// Navigator.of(context).pushNamed(
|
||||
// Routes.cycleDetailScreen,
|
||||
// arguments: result,
|
||||
// );
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
controller: idCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Or enter a cycle ID',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
horizontal: 3,
|
||||
),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
// borderRadius: BorderRadius.only(Radius.circular(4)),
|
||||
borderSide: BorderSide(
|
||||
color: Colors.grey,
|
||||
),
|
||||
Form(
|
||||
key: _form,
|
||||
child: TextFormField(
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Id required!!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: idCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Or enter a cycle ID',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
horizontal: 3,
|
||||
),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
// borderRadius: BorderRadius.only(Radius.circular(4)),
|
||||
borderSide: BorderSide(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
thickness: 3,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (!_form.currentState.validate()) {
|
||||
return;
|
||||
}
|
||||
launch(
|
||||
'https://cssd-doc.com/Show/Cycle/${idCTRL.text}',
|
||||
);
|
||||
// Navigator.of(context).pushNamed(
|
||||
// Routes.cycleDetailScreen,
|
||||
// arguments: idCTRL.text,
|
||||
// );
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
margin: EdgeInsets.only(bottom: 50,left: 20,right: 20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.red, Colors.orange],
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'GO!',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
thickness: 3,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (!_form.currentState.validate()) {
|
||||
return;
|
||||
}
|
||||
launch(
|
||||
'https://cssd-doc.com/Show/Cycle/${idCTRL.text}',
|
||||
);
|
||||
// Navigator.of(context).pushNamed(
|
||||
// Routes.cycleDetailScreen,
|
||||
// arguments: idCTRL.text,
|
||||
// );
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
margin:
|
||||
EdgeInsets.only(bottom: 50, left: 20, right: 20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.red, Colors.orange],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'GO!',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
],
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class _ForgetPassScreenState extends State<ForgetPassScreen> {
|
||||
title: Text('Error'),
|
||||
content: Text(message),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text('Ok'),
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
@@ -90,106 +90,108 @@ class _ForgetPassScreenState extends State<ForgetPassScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('CSSD'),
|
||||
),
|
||||
body: Selector<ConnectivityProvider, String>(
|
||||
builder: (ctx, value, _) => value != 'offline'
|
||||
? _isLoading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Text(
|
||||
'FORGET PASSWORD',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Cell number is required.';
|
||||
}
|
||||
RegExp regExp =
|
||||
RegExp(r'^09[0,1,2,3,9]{1}[0-9]{8}$');
|
||||
if (!regExp.hasMatch(value)) {
|
||||
return 'Enter a valid cell number';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: cellNumberController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
Icons.call,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Cell Number',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.phone,
|
||||
textInputAction: TextInputAction.next,
|
||||
onSaved: (value) {
|
||||
cellNumberController.text = value;
|
||||
},
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _requestCode(),
|
||||
child: Container(
|
||||
width: 40 * _deviceBlockSize,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Text(
|
||||
'Request Code',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('CSSD'),
|
||||
),
|
||||
body: Selector<ConnectivityProvider, String>(
|
||||
builder: (ctx, value, _) => value != 'offline'
|
||||
? _isLoading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Text(
|
||||
'FORGET PASSWORD',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox(),
|
||||
selector: (_, connectivity) => connectivity.conStatus,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Cell number is required.';
|
||||
}
|
||||
RegExp regExp =
|
||||
RegExp(r'^09[0,1,2,3,9]{1}[0-9]{8}$');
|
||||
if (!regExp.hasMatch(value)) {
|
||||
return 'Enter a valid cell number';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: cellNumberController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
Icons.call,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Cell Number',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.phone,
|
||||
textInputAction: TextInputAction.next,
|
||||
onSaved: (value) {
|
||||
cellNumberController.text = value;
|
||||
},
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _requestCode(),
|
||||
child: Container(
|
||||
width: 40 * _deviceBlockSize,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Text(
|
||||
'Request Code',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox(),
|
||||
selector: (_, connectivity) => connectivity.conStatus,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
+191
-189
@@ -1,4 +1,4 @@
|
||||
import 'package:barcode_scan/platform_wrapper.dart';
|
||||
import 'package:barcode_scan2/platform_wrapper.dart';
|
||||
import 'package:double_back_to_close_app/double_back_to_close_app.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -6,13 +6,13 @@ import 'package:flutter_phoenix/flutter_phoenix.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import './my_info_screen.dart';
|
||||
import '../providers/auth.dart';
|
||||
import '../providers/connectivity.dart';
|
||||
import '../widgets/Global/drawer.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
import 'cycle_result_screen.dart';
|
||||
import 'label_result_screen.dart';
|
||||
import 'my_info_screen.dart';
|
||||
import 'test_result_screen.dart';
|
||||
import 'test_verify_screen.dart';
|
||||
|
||||
@@ -25,195 +25,197 @@ class HomePage extends StatelessWidget {
|
||||
final userData = Provider.of<Auth>(context, listen: false).user;
|
||||
|
||||
// print(userData['roles']);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomPadding: false,
|
||||
drawer: Selector<ConnectivityProvider, String>(
|
||||
builder: (ctx, value, _) =>
|
||||
value != 'offline' ? AppDrawer() : Container(),
|
||||
selector: (_, connctivity) => connctivity.conStatus,
|
||||
)
|
||||
// Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
// return connection.conStatus != 'offline' ? AppDrawer() : Container();
|
||||
// })
|
||||
,
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('CSSD'),
|
||||
actions: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 10.0),
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
Icons.power_settings_new,
|
||||
),
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
title: Text('LogOut'),
|
||||
content: Text('Are you sure for logout?'),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
child: Text('Yes'),
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
Provider.of<Auth>(context, listen: false).logout();
|
||||
Phoenix.rebirth(context);
|
||||
},
|
||||
),
|
||||
FlatButton(
|
||||
child: Text('No'),
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(
|
||||
builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? DoubleBackToCloseApp(
|
||||
snackBar: SnackBar(
|
||||
duration: Duration(seconds: 2),
|
||||
backgroundColor: Colors.black,
|
||||
content: Text(
|
||||
'Double tap for exit . . .',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 0, bottom: 10, left: 20, right: 20),
|
||||
child: ListView(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20, bottom: 10),
|
||||
child: Text(
|
||||
'WELCOME HOME',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 20,
|
||||
letterSpacing: 3.5,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
// resizeToAvoidBottomPadding: false,
|
||||
drawer: Selector<ConnectivityProvider, String>(
|
||||
builder: (ctx, value, _) =>
|
||||
value != 'offline' ? AppDrawer() : Container(),
|
||||
selector: (_, connctivity) => connctivity.conStatus,
|
||||
)
|
||||
// Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
// return connection.conStatus != 'offline' ? AppDrawer() : Container();
|
||||
// })
|
||||
,
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('CSSD'),
|
||||
actions: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 10.0),
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
Icons.power_settings_new,
|
||||
),
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
title: Text('LogOut'),
|
||||
content: Text('Are you sure for logout?'),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: Text('Yes'),
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
Provider.of<Auth>(context, listen: false).logout();
|
||||
Phoenix.rebirth(context);
|
||||
},
|
||||
),
|
||||
SelectionItem(
|
||||
startColor: Color(0xFFFCB8A2),
|
||||
endColor: Color(0xFFFFECD2),
|
||||
firstLine: 'My INFO',
|
||||
secondLine: 'List, Details & Add a one',
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return Consumer<Auth>(
|
||||
builder: (ctx, auth, _) {
|
||||
return MyInfoScreen();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
child: Text('No'),
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
),
|
||||
SelectionItem(
|
||||
startColor: Color(0xFFD5F5FD),
|
||||
endColor: Color(0xFFE9FFF7),
|
||||
firstLine: 'TEST RESULTS',
|
||||
secondLine: 'List, Details & Add a one',
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return Consumer<Auth>(
|
||||
builder: (ctx, auth, _) {
|
||||
return TestResultScreen();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
// MyTestResult(
|
||||
// isAdmin: false,
|
||||
// ),
|
||||
),
|
||||
SelectionItem(
|
||||
startColor: Color(0xFFE2D2C4),
|
||||
endColor: Color(0xFFFAF7F5),
|
||||
firstLine: 'LABELS',
|
||||
secondLine: 'List, Details & Add a one',
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return Consumer<Auth>(
|
||||
builder: (ctx, auth, _) {
|
||||
return LabelResultScreen();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
SelectionItem(
|
||||
startColor: Color(0xFFA7CCE1),
|
||||
endColor: Color(0xFFECF7ED),
|
||||
firstLine: 'CYCLES',
|
||||
secondLine: 'List, Details & Add a one',
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return Consumer<Auth>(
|
||||
builder: (ctx, auth, _) {
|
||||
return CycleResultScreen();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
// SelectionItem(
|
||||
// startColor: Color(0xFFA7CCE1),
|
||||
// endColor: Color(0xFFECF7ED),
|
||||
// firstLine: 'image',
|
||||
// secondLine: 'image',
|
||||
// onTap: CaptureImage(),
|
||||
// ),
|
||||
userData['roles'].contains('User')
|
||||
? Container()
|
||||
: SelectionItem(
|
||||
startColor: Color(0xFFA7CCE1),
|
||||
endColor: Color(0xFFECF7ED),
|
||||
firstLine: 'TEST TO VERIFY',
|
||||
secondLine: 'Verify and reject Test Results',
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return Consumer<Auth>(
|
||||
builder: (ctx, auth, _) {
|
||||
return TestVerifyScreen();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
BarcodeSelectionItem(),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(
|
||||
builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? DoubleBackToCloseApp(
|
||||
snackBar: SnackBar(
|
||||
duration: Duration(seconds: 2),
|
||||
backgroundColor: Colors.black,
|
||||
content: Text(
|
||||
'Double tap for exit . . .',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 0, bottom: 10, left: 20, right: 20),
|
||||
child: ListView(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20, bottom: 10),
|
||||
child: Text(
|
||||
'WELCOME HOME',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 20,
|
||||
letterSpacing: 3.5,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
SelectionItem(
|
||||
startColor: Color(0xFFFCB8A2),
|
||||
endColor: Color(0xFFFFECD2),
|
||||
firstLine: 'My INFO',
|
||||
secondLine: 'List, Details & Add a one',
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return Consumer<Auth>(
|
||||
builder: (ctx, auth, _) {
|
||||
return MyInfoScreen();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
SelectionItem(
|
||||
startColor: Color(0xFFD5F5FD),
|
||||
endColor: Color(0xFFE9FFF7),
|
||||
firstLine: 'TEST RESULTS',
|
||||
secondLine: 'List, Details & Add a one',
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return Consumer<Auth>(
|
||||
builder: (ctx, auth, _) {
|
||||
return TestResultScreen();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
// MyTestResult(
|
||||
// isAdmin: false,
|
||||
// ),
|
||||
),
|
||||
SelectionItem(
|
||||
startColor: Color(0xFFE2D2C4),
|
||||
endColor: Color(0xFFFAF7F5),
|
||||
firstLine: 'LABELS',
|
||||
secondLine: 'List, Details & Add a one',
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return Consumer<Auth>(
|
||||
builder: (ctx, auth, _) {
|
||||
return LabelResultScreen();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
SelectionItem(
|
||||
startColor: Color(0xFFA7CCE1),
|
||||
endColor: Color(0xFFECF7ED),
|
||||
firstLine: 'CYCLES',
|
||||
secondLine: 'List, Details & Add a one',
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return Consumer<Auth>(
|
||||
builder: (ctx, auth, _) {
|
||||
return CycleResultScreen();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
// SelectionItem(
|
||||
// startColor: Color(0xFFA7CCE1),
|
||||
// endColor: Color(0xFFECF7ED),
|
||||
// firstLine: 'image',
|
||||
// secondLine: 'image',
|
||||
// onTap: CaptureImage(),
|
||||
// ),
|
||||
userData['roles'].contains('User')
|
||||
? Container()
|
||||
: SelectionItem(
|
||||
startColor: Color(0xFFA7CCE1),
|
||||
endColor: Color(0xFFECF7ED),
|
||||
firstLine: 'TEST TO VERIFY',
|
||||
secondLine: 'Verify and reject Test Results',
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return Consumer<Auth>(
|
||||
builder: (ctx, auth, _) {
|
||||
return TestVerifyScreen();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
BarcodeSelectionItem(),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -359,7 +361,7 @@ class BarcodeSelectionItem extends StatelessWidget {
|
||||
print(result);
|
||||
showDialog(
|
||||
context: context,
|
||||
child: AlertDialog(
|
||||
builder: (_) => AlertDialog(
|
||||
title: Text(
|
||||
'نتیجه ی اسکن',
|
||||
textDirection: TextDirection.rtl,
|
||||
@@ -376,7 +378,7 @@ class BarcodeSelectionItem extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
await launch(result);
|
||||
Navigator.of(context).pop();
|
||||
|
||||
+176
-174
@@ -84,195 +84,197 @@ class _LabelAddScreenState extends State<LabelAddScreen> {
|
||||
);
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Labels'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Labels'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context)
|
||||
.pushReplacementNamed(Routes.labelResultScreen),
|
||||
),
|
||||
onPressed: () => Navigator.of(context)
|
||||
.pushReplacementNamed(Routes.labelResultScreen),
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'ADD A LABEL',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextFormField(
|
||||
onChanged: (val) {
|
||||
setState(() {
|
||||
lotNumberCTRL.text =
|
||||
val + ' - ' + cycleNumberCTRL.text;
|
||||
});
|
||||
},
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Strilizer ID required!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: striizerIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize),
|
||||
isDense: true,
|
||||
labelText: 'Strilizer ID',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'ADD A LABEL',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_cycleNumberFocusNode);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextFormField(
|
||||
onChanged: (val) {
|
||||
setState(
|
||||
() {
|
||||
TextFormField(
|
||||
onChanged: (val) {
|
||||
setState(() {
|
||||
lotNumberCTRL.text =
|
||||
striizerIdCTRL.text + ' - ' + val;
|
||||
},
|
||||
);
|
||||
},
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Cycle number required!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: cycleNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize,
|
||||
val + ' - ' + cycleNumberCTRL.text;
|
||||
});
|
||||
},
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Strilizer ID required!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: striizerIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize),
|
||||
isDense: true,
|
||||
labelText: 'Strilizer ID',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Cycle Number',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_cycleNumberFocusNode);
|
||||
},
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
focusNode: _cycleNumberFocusNode,
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.done,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextFormField(
|
||||
readOnly: true,
|
||||
controller: lotNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize,
|
||||
TextFormField(
|
||||
onChanged: (val) {
|
||||
setState(
|
||||
() {
|
||||
lotNumberCTRL.text =
|
||||
striizerIdCTRL.text + ' - ' + val;
|
||||
},
|
||||
);
|
||||
},
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Cycle number required!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: cycleNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Cycle Number',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Lot Number',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
horizontal: 3,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
focusNode: _cycleNumberFocusNode,
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.done,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
LabelAddSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
packageCTRL: packageCTRL,
|
||||
packageVals: packageVals,
|
||||
packageValue: packageValue,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
LabelAddDatePicker(
|
||||
dateCTRL: sDateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Sterile Date',
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
LabelAddDatePicker(
|
||||
dateCTRL: eDateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Expire Date',
|
||||
),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
LabelAddSaveButton(
|
||||
form: _form,
|
||||
lotNumberCTRL: lotNumberCTRL,
|
||||
cycleNumberCTRL: cycleNumberCTRL,
|
||||
sDateCTRL: sDateCTRL,
|
||||
packageValue: packageValue,
|
||||
eDateCTRL: eDateCTRL,
|
||||
striizerIdCTRL: striizerIdCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 100,
|
||||
),
|
||||
],
|
||||
TextFormField(
|
||||
readOnly: true,
|
||||
controller: lotNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Lot Number',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
horizontal: 3,
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
LabelAddSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
packageCTRL: packageCTRL,
|
||||
packageVals: packageVals,
|
||||
packageValue: packageValue,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
LabelAddDatePicker(
|
||||
dateCTRL: sDateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Sterile Date',
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
LabelAddDatePicker(
|
||||
dateCTRL: eDateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Expire Date',
|
||||
),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
LabelAddSaveButton(
|
||||
form: _form,
|
||||
lotNumberCTRL: lotNumberCTRL,
|
||||
cycleNumberCTRL: cycleNumberCTRL,
|
||||
sDateCTRL: sDateCTRL,
|
||||
packageValue: packageValue,
|
||||
eDateCTRL: eDateCTRL,
|
||||
striizerIdCTRL: striizerIdCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 100,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:cssd/models/label_models.dart';
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
import 'package:cssd/providers/labels.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
import 'package:cssd/widgets/LabelScreens/Detail/datas_box.dart';
|
||||
import '../models/label_models.dart';
|
||||
import '../providers/connectivity.dart';
|
||||
import '../providers/labels.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
import '../widgets/LabelScreens/Detail/datas_box.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -50,35 +50,36 @@ class _LabelDetailScreenState extends State<LabelDetailScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
print(datas);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Labels'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Labels'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: isEmpty
|
||||
? Center(
|
||||
child: Text('This Lable doesnt exists!'),
|
||||
)
|
||||
: LabelDetailsDataBox(
|
||||
datas: datas,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: isEmpty
|
||||
? Center(
|
||||
child: Text('This Lable doesnt exists!'),
|
||||
)
|
||||
: LabelDetailsDataBox(
|
||||
datas: datas,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+191
-187
@@ -1,16 +1,17 @@
|
||||
import 'package:barcode_scan/barcode_scan.dart';
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:cssd/models/label_models.dart';
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
import 'package:cssd/providers/labels.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
import 'package:cssd/widgets/LabelScreens/Filter/save_button.dart';
|
||||
import 'package:cssd/widgets/LabelScreens/Filter/selector_box.dart';
|
||||
import 'package:barcode_scan2/barcode_scan2.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
import '../config/routes.dart';
|
||||
import '../models/label_models.dart';
|
||||
import '../providers/connectivity.dart';
|
||||
import '../providers/labels.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
import '../widgets/LabelScreens/Filter/save_button.dart';
|
||||
import '../widgets/LabelScreens/Filter/selector_box.dart';
|
||||
|
||||
class LabelFilterScreen extends StatefulWidget {
|
||||
// static const route = '/LabelFilterScreen';
|
||||
@@ -90,203 +91,206 @@ class _LabelFilterScreenState extends State<LabelFilterScreen> {
|
||||
);
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Labels'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Labels'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context)
|
||||
.pushReplacementNamed(Routes.labelResultScreen),
|
||||
),
|
||||
onPressed: () => Navigator.of(context)
|
||||
.pushReplacementNamed(Routes.labelResultScreen),
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(
|
||||
builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'FILTER RESULTS',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 8,
|
||||
child: TextFormField(
|
||||
controller: labelIdCTRl,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Label ID',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_cycleNumberFocusNode);
|
||||
},
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(
|
||||
builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'FILTER RESULTS',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
scan().then(
|
||||
(String result) {
|
||||
if (result == 'cancel') {
|
||||
print('cancel');
|
||||
} else if (result == 'error') {
|
||||
print('error');
|
||||
} else if (result == 'access') {
|
||||
print('access');
|
||||
} else {
|
||||
print(result);
|
||||
labelIdCTRl.text = result;
|
||||
// Navigator.of(context).pushNamed(
|
||||
// CycleDetailScreen.route,
|
||||
// arguments: result,
|
||||
// );
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.black,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 8,
|
||||
child: TextFormField(
|
||||
controller: labelIdCTRl,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Label ID',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
child: Icon(
|
||||
FontAwesomeIcons.barcode,
|
||||
size: 5 * _deviceBlockSize,
|
||||
color: Colors.white,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context).requestFocus(
|
||||
_cycleNumberFocusNode);
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
controller: cycleNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Cycle Number',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
scan().then(
|
||||
(String result) {
|
||||
if (result == 'cancel') {
|
||||
print('cancel');
|
||||
} else if (result == 'error') {
|
||||
print('error');
|
||||
} else if (result == 'access') {
|
||||
print('access');
|
||||
} else {
|
||||
print(result);
|
||||
labelIdCTRl.text = result;
|
||||
// Navigator.of(context).pushNamed(
|
||||
// CycleDetailScreen.route,
|
||||
// arguments: result,
|
||||
// );
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.black,
|
||||
),
|
||||
child: Icon(
|
||||
FontAwesomeIcons.barcode,
|
||||
size: 5 * _deviceBlockSize,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
focusNode: _cycleNumberFocusNode,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_strilizerIdFocusNode);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
controller: striizerIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
TextFormField(
|
||||
controller: cycleNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Cycle Number',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Strilizer ID',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
focusNode: _cycleNumberFocusNode,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_strilizerIdFocusNode);
|
||||
},
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
controller: striizerIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Strilizer ID',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
focusNode: _strilizerIdFocusNode,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
focusNode: _strilizerIdFocusNode,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
|
||||
LabelFilterSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
hospitalCTRL: hospitalCTRL,
|
||||
hospitalVals: hospitalVals,
|
||||
),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
LabelFilterSaveButton(
|
||||
hospitalVals: hospitalVals,
|
||||
hospitalCTRL: hospitalCTRL,
|
||||
labelIdCTRl: labelIdCTRl,
|
||||
cycleNumberCTRL: cycleNumberCTRL,
|
||||
striizerIdCTRL: striizerIdCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
// DropDownBox(values: ['Washer ID']),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
LabelFilterSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
hospitalCTRL: hospitalCTRL,
|
||||
hospitalVals: hospitalVals,
|
||||
),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
LabelFilterSaveButton(
|
||||
hospitalVals: hospitalVals,
|
||||
hospitalCTRL: hospitalCTRL,
|
||||
labelIdCTRl: labelIdCTRl,
|
||||
cycleNumberCTRL: cycleNumberCTRL,
|
||||
striizerIdCTRL: striizerIdCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
// DropDownBox(values: ['Washer ID']),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> scan() async {
|
||||
try {
|
||||
var barcode = await BarcodeScanner.scan();
|
||||
|
||||
+149
-143
@@ -1,15 +1,16 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
import 'package:cssd/widgets/Global/page_header.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
import 'package:cssd/widgets/LabelScreens/Result/data_box.dart';
|
||||
import 'package:cssd/widgets/LabelScreens/Result/filter_chip_box.dart';
|
||||
import 'package:cssd/widgets/LabelScreens/Result/floating_buttons.dart';
|
||||
import 'package:cssd/widgets/LabelScreens/Result/search_box.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../config/routes.dart';
|
||||
import '../providers/connectivity.dart';
|
||||
import '../providers/labels.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
import '../widgets/Global/page_header.dart';
|
||||
import '../widgets/LabelScreens/Result/data_box.dart';
|
||||
import '../widgets/LabelScreens/Result/filter_chip_box.dart';
|
||||
import '../widgets/LabelScreens/Result/floating_buttons.dart';
|
||||
import '../widgets/LabelScreens/Result/search_box.dart';
|
||||
|
||||
class LabelResultScreen extends StatefulWidget {
|
||||
// static const route = '/LabelResultScreen';
|
||||
@@ -61,150 +62,155 @@ class _LabelResultScreenState extends State<LabelResultScreen> {
|
||||
final _media = MediaQuery.of(context);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
floatingActionButton:
|
||||
LabelFloatingButtons(deviceBlockSize: _deviceBlockSize),
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Home'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
floatingActionButton:
|
||||
LabelFloatingButtons(deviceBlockSize: _deviceBlockSize),
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Home'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
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>[
|
||||
PageHeader(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'LABELS',
|
||||
route: Routes.labelFilterScreen,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Consumer<LabelsProvider>(
|
||||
builder: (context, label, _) {
|
||||
return Container(
|
||||
height: 50,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: true,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).popAndPushNamed(
|
||||
Routes.labelFilterScreen,
|
||||
);
|
||||
},
|
||||
child: Chip(
|
||||
backgroundColor: Colors.black,
|
||||
label: Text(
|
||||
'Filters',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
deleteIcon: Icon(
|
||||
FontAwesomeIcons.filter,
|
||||
color: Colors.white,
|
||||
size: 4 * _deviceBlockSize,
|
||||
),
|
||||
onDeleted: () {
|
||||
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>[
|
||||
PageHeader(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'LABELS',
|
||||
route: Routes.labelFilterScreen,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Consumer<LabelsProvider>(
|
||||
builder: (context, label, _) {
|
||||
return Container(
|
||||
height: 50,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: true,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).popAndPushNamed(
|
||||
Routes.labelFilterScreen,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
label.filters.id != ''
|
||||
? LabelFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
id: '',
|
||||
cycleNumber: label.filters.cycleNumber,
|
||||
sterilizerId:
|
||||
label.filters.sterilizerId,
|
||||
hospital: label.filters.hospital,
|
||||
label: 'ID',
|
||||
)
|
||||
: Container(),
|
||||
label.filters.cycleNumber != ''
|
||||
? LabelFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
id: label.filters.id,
|
||||
cycleNumber: '',
|
||||
sterilizerId:
|
||||
label.filters.sterilizerId,
|
||||
hospital: label.filters.hospital,
|
||||
label: 'Cycle Number',
|
||||
)
|
||||
: Container(),
|
||||
label.filters.sterilizerId != ''
|
||||
? LabelFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
id: label.filters.id,
|
||||
cycleNumber: label.filters.cycleNumber,
|
||||
sterilizerId: '',
|
||||
hospital: label.filters.hospital,
|
||||
label: 'Sterilizer ID',
|
||||
)
|
||||
: Container(),
|
||||
label.filters.hospital != ''
|
||||
? LabelFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
id: label.filters.id,
|
||||
cycleNumber: label.filters.cycleNumber,
|
||||
sterilizerId:
|
||||
label.filters.sterilizerId,
|
||||
hospital: '',
|
||||
label: 'Hospital',
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
LabelSearchBox(
|
||||
searchCTRL: searchCTRL,
|
||||
deviceBlockSize: _deviceBlockSize),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Expanded(
|
||||
child: Consumer<LabelsProvider>(
|
||||
builder: (context, labelResults, _) {
|
||||
return labelResults.isloading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: ListView.builder(
|
||||
controller: sc,
|
||||
itemBuilder: (context, index) =>
|
||||
LabelItemBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
item: labelResults.items[index],
|
||||
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.labelFilterScreen,
|
||||
);
|
||||
},
|
||||
),
|
||||
itemCount: labelResults.items.length,
|
||||
shrinkWrap: true,
|
||||
);
|
||||
),
|
||||
label.filters.id != ''
|
||||
? LabelFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
id: '',
|
||||
cycleNumber:
|
||||
label.filters.cycleNumber,
|
||||
sterilizerId:
|
||||
label.filters.sterilizerId,
|
||||
hospital: label.filters.hospital,
|
||||
label: 'ID',
|
||||
)
|
||||
: Container(),
|
||||
label.filters.cycleNumber != ''
|
||||
? LabelFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
id: label.filters.id,
|
||||
cycleNumber: '',
|
||||
sterilizerId:
|
||||
label.filters.sterilizerId,
|
||||
hospital: label.filters.hospital,
|
||||
label: 'Cycle Number',
|
||||
)
|
||||
: Container(),
|
||||
label.filters.sterilizerId != ''
|
||||
? LabelFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
id: label.filters.id,
|
||||
cycleNumber:
|
||||
label.filters.cycleNumber,
|
||||
sterilizerId: '',
|
||||
hospital: label.filters.hospital,
|
||||
label: 'Sterilizer ID',
|
||||
)
|
||||
: Container(),
|
||||
label.filters.hospital != ''
|
||||
? LabelFilterChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
id: label.filters.id,
|
||||
cycleNumber:
|
||||
label.filters.cycleNumber,
|
||||
sterilizerId:
|
||||
label.filters.sterilizerId,
|
||||
hospital: '',
|
||||
label: 'Hospital',
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
LabelSearchBox(
|
||||
searchCTRL: searchCTRL,
|
||||
deviceBlockSize: _deviceBlockSize),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Expanded(
|
||||
child: Consumer<LabelsProvider>(
|
||||
builder: (context, labelResults, _) {
|
||||
return labelResults.isloading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: ListView.builder(
|
||||
controller: sc,
|
||||
itemBuilder: (context, index) =>
|
||||
LabelItemBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
item: labelResults.items[index],
|
||||
),
|
||||
itemCount: labelResults.items.length,
|
||||
shrinkWrap: true,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
import 'package:cssd/widgets/LabelScreens/Scan/input_box.dart';
|
||||
import 'package:cssd/widgets/LabelScreens/Scan/save_button.dart';
|
||||
import 'package:cssd/widgets/LabelScreens/Scan/scan_box.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../providers/connectivity.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
import '../widgets/LabelScreens/Scan/input_box.dart';
|
||||
import '../widgets/LabelScreens/Scan/save_button.dart';
|
||||
import '../widgets/LabelScreens/Scan/scan_box.dart';
|
||||
// import 'package:flutter/services.dart';
|
||||
// import 'package:barcode_scan/barcode_scan.dart';
|
||||
// import 'package:barcode_scan2/barcode_scan2.dart';
|
||||
|
||||
class LabelScanScreen extends StatefulWidget {
|
||||
// static const route = '/LabelScanScreen';
|
||||
@@ -27,63 +28,65 @@ class _LabelScanScreenState extends State<LabelScanScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
titleSpacing: -10,
|
||||
title: Text('CSSD'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
titleSpacing: -10,
|
||||
title: Text('CSSD'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(
|
||||
builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 30),
|
||||
child: Text(
|
||||
'LOOKING FOR A Label?',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5.5 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: 3,
|
||||
body: Consumer<ConnectivityProvider>(
|
||||
builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 30),
|
||||
child: Text(
|
||||
'LOOKING FOR A Label?',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5.5 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
LabelScanBox(),
|
||||
Form(
|
||||
key: _form,
|
||||
child: LabelScanInputBox(
|
||||
idCTRL: idCTRL, deviceBlockSize: _deviceBlockSize),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
thickness: 3,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
FilterScanSaveButton(
|
||||
form: _form,
|
||||
idCTRL: idCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
],
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
LabelScanBox(),
|
||||
Form(
|
||||
key: _form,
|
||||
child: LabelScanInputBox(
|
||||
idCTRL: idCTRL, deviceBlockSize: _deviceBlockSize),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
thickness: 3,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
FilterScanSaveButton(
|
||||
form: _form,
|
||||
idCTRL: idCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
],
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
+177
-175
@@ -107,196 +107,198 @@ class _LabelUpdateScreenState extends State<LabelUpdateScreen> {
|
||||
);
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Labels'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Labels'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context)
|
||||
.pushReplacementNamed(Routes.labelResultScreen),
|
||||
),
|
||||
onPressed: () => Navigator.of(context)
|
||||
.pushReplacementNamed(Routes.labelResultScreen),
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Update A LABEL',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextFormField(
|
||||
onChanged: (val) {
|
||||
setState(() {
|
||||
lotNumberCTRL.text =
|
||||
val + ' - ' + cycleNumberCTRL.text;
|
||||
});
|
||||
},
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Strilizer ID required!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: striizerIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize),
|
||||
isDense: true,
|
||||
labelText: 'Strilizer ID',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Update A LABEL',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_cycleNumberFocusNode);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextFormField(
|
||||
onChanged: (val) {
|
||||
setState(
|
||||
() {
|
||||
TextFormField(
|
||||
onChanged: (val) {
|
||||
setState(() {
|
||||
lotNumberCTRL.text =
|
||||
striizerIdCTRL.text + ' - ' + val;
|
||||
},
|
||||
);
|
||||
},
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Cycle number required!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: cycleNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize,
|
||||
val + ' - ' + cycleNumberCTRL.text;
|
||||
});
|
||||
},
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Strilizer ID required!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: striizerIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize),
|
||||
isDense: true,
|
||||
labelText: 'Strilizer ID',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Cycle Number',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_cycleNumberFocusNode);
|
||||
},
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
focusNode: _cycleNumberFocusNode,
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.done,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextFormField(
|
||||
readOnly: true,
|
||||
controller: lotNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize,
|
||||
TextFormField(
|
||||
onChanged: (val) {
|
||||
setState(
|
||||
() {
|
||||
lotNumberCTRL.text =
|
||||
striizerIdCTRL.text + ' - ' + val;
|
||||
},
|
||||
);
|
||||
},
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Cycle number required!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: cycleNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Cycle Number',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Lot Number',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
horizontal: 3,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
focusNode: _cycleNumberFocusNode,
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.done,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
LabelAddSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
packageCTRL: packageCTRL,
|
||||
packageVals: packageVals,
|
||||
packageValue: packageValue,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
LabelAddDatePicker(
|
||||
dateCTRL: sDateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Sterile Date',
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
LabelAddDatePicker(
|
||||
dateCTRL: eDateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Expire Date',
|
||||
),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
LabelUpdateButton(
|
||||
form: _form,
|
||||
id: datas.id,
|
||||
lotNumberCTRL: lotNumberCTRL,
|
||||
cycleNumberCTRL: cycleNumberCTRL,
|
||||
sDateCTRL: sDateCTRL,
|
||||
packageValue: packageValue,
|
||||
eDateCTRL: eDateCTRL,
|
||||
striizerIdCTRL: striizerIdCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 100,
|
||||
),
|
||||
],
|
||||
TextFormField(
|
||||
readOnly: true,
|
||||
controller: lotNumberCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Lot Number',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
horizontal: 3,
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
LabelAddSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
packageCTRL: packageCTRL,
|
||||
packageVals: packageVals,
|
||||
packageValue: packageValue,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
LabelAddDatePicker(
|
||||
dateCTRL: sDateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Sterile Date',
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
LabelAddDatePicker(
|
||||
dateCTRL: eDateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Expire Date',
|
||||
),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
LabelUpdateButton(
|
||||
form: _form,
|
||||
id: datas.id,
|
||||
lotNumberCTRL: lotNumberCTRL,
|
||||
cycleNumberCTRL: cycleNumberCTRL,
|
||||
sDateCTRL: sDateCTRL,
|
||||
packageValue: packageValue,
|
||||
eDateCTRL: eDateCTRL,
|
||||
striizerIdCTRL: striizerIdCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 100,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
+176
-174
@@ -1,11 +1,12 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:cssd/providers/auth.dart';
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../config/routes.dart';
|
||||
import '../providers/auth.dart';
|
||||
import '../providers/connectivity.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
|
||||
class LoginScreen extends StatefulWidget {
|
||||
// static const route = '/HomeScreen';
|
||||
|
||||
@@ -44,7 +45,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
title: Text('Error'),
|
||||
content: Text(message),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text('Ok'),
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
@@ -110,186 +111,187 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('CSSD'),
|
||||
),
|
||||
body: Selector<ConnectivityProvider, String>(
|
||||
builder: (ctx, value, _) => value != 'offline'
|
||||
? _isLoading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Text(
|
||||
'LOGIN',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Cell number is required.';
|
||||
}
|
||||
RegExp regExp =
|
||||
RegExp(r'^09[0,1,2,3,9]{1}[0-9]{8}$');
|
||||
if (!regExp.hasMatch(value)) {
|
||||
return 'Enter a valid cell number';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: cellNumberController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
Icons.call,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Cell Number',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('CSSD'),
|
||||
),
|
||||
body: Selector<ConnectivityProvider, String>(
|
||||
builder: (ctx, value, _) => value != 'offline'
|
||||
? _isLoading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Text(
|
||||
'LOGIN',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.phone,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_passwordFocusNode);
|
||||
},
|
||||
onSaved: (value) {
|
||||
map['cellNumber'] = value;
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Password is required.';
|
||||
}
|
||||
if (value.length < 8) {
|
||||
return 'Password at least is 8 characters.';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
obscureText: _hidePass,
|
||||
controller: passwordController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Password',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
suffixIcon: InkWell(
|
||||
child: Icon(FontAwesomeIcons.eye),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_hidePass = !_hidePass;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Cell number is required.';
|
||||
}
|
||||
RegExp regExp =
|
||||
RegExp(r'^09[0,1,2,3,9]{1}[0-9]{8}$');
|
||||
if (!regExp.hasMatch(value)) {
|
||||
return 'Enter a valid cell number';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: cellNumberController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
Icons.call,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
onFieldSubmitted: (_) {
|
||||
_login();
|
||||
},
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
focusNode: _passwordFocusNode,
|
||||
onSaved: (value) {
|
||||
map['password'] = value;
|
||||
},
|
||||
labelText: 'Cell Number',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _login(),
|
||||
child: Container(
|
||||
width: 40 * _deviceBlockSize,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.phone,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_passwordFocusNode);
|
||||
},
|
||||
onSaved: (value) {
|
||||
map['cellNumber'] = value;
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Password is required.';
|
||||
}
|
||||
if (value.length < 8) {
|
||||
return 'Password at least is 8 characters.';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
obscureText: _hidePass,
|
||||
controller: passwordController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Password',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
suffixIcon: InkWell(
|
||||
child: Icon(FontAwesomeIcons.eye),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_hidePass = !_hidePass;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
onFieldSubmitted: (_) {
|
||||
_login();
|
||||
},
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
focusNode: _passwordFocusNode,
|
||||
onSaved: (value) {
|
||||
map['password'] = value;
|
||||
},
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _login(),
|
||||
child: Container(
|
||||
width: 40 * _deviceBlockSize,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.exit_to_app,
|
||||
color: Colors.white,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.exit_to_app,
|
||||
color: Colors.white,
|
||||
),
|
||||
Text(
|
||||
'Login',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
Spacer()
|
||||
],
|
||||
)),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
FlatButton(
|
||||
padding: EdgeInsets.all(0),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'Forgot Password ?',
|
||||
style: TextStyle(
|
||||
color: Colors.black54,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
Text(
|
||||
'Login',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
Spacer()
|
||||
],
|
||||
)),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
TextButton(
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'Forgot Password ?',
|
||||
style: TextStyle(
|
||||
color: Colors.black54,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
onPressed: () => Navigator.of(context)
|
||||
.pushNamed(Routes.forgetPassScreen),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox(),
|
||||
selector: (_, connectivity) => connectivity.conStatus,
|
||||
));
|
||||
onPressed: () => Navigator.of(context)
|
||||
.pushNamed(Routes.forgetPassScreen),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox(),
|
||||
selector: (_, connectivity) => connectivity.conStatus,
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+132
-129
@@ -40,138 +40,141 @@ class _MyInfoScreenState extends State<MyInfoScreen> {
|
||||
final _media = MediaQuery.of(context);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Dashboard'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Dashboard'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: ListView(
|
||||
children: <Widget>[
|
||||
InfoHeader(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'MY INFO',
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
InfoInputBox(
|
||||
controller: usernameCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Full Name',
|
||||
icon: FontAwesomeIcons.sortNumericDown,
|
||||
inputType: TextInputType.text,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextFormField(
|
||||
readOnly: true,
|
||||
initialValue: user['cell_number'],
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
Icons.call,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Cell Number',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Colors.grey,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.next,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
InfoInputBox(
|
||||
controller: emailCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Email Address',
|
||||
icon: FontAwesomeIcons.envelope,
|
||||
inputType: TextInputType.emailAddress,
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 60, vertical: 10),
|
||||
margin: EdgeInsets.only(top: 50, bottom: 20),
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Text(
|
||||
'Save',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
onTap: () async {
|
||||
await Provider.of<Auth>(context, listen: false)
|
||||
.setUserData(
|
||||
user['id'],
|
||||
usernameCTRL.text,
|
||||
emailCTRL.text,
|
||||
)
|
||||
.then(
|
||||
(value) async => await showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text(
|
||||
'Info changed successfully.',
|
||||
),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
child: Text('Ok'),
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: ListView(
|
||||
children: <Widget>[
|
||||
InfoHeader(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'MY INFO',
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
InfoInputBox(
|
||||
controller: usernameCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Full Name',
|
||||
icon: FontAwesomeIcons.sortNumericDown,
|
||||
inputType: TextInputType.text,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
TextFormField(
|
||||
readOnly: true,
|
||||
initialValue: user['cell_number'],
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
Icons.call,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Cell Number',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Colors.grey,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: TextInputAction.next,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
InfoInputBox(
|
||||
controller: emailCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Email Address',
|
||||
icon: FontAwesomeIcons.envelope,
|
||||
inputType: TextInputType.emailAddress,
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 60, vertical: 10),
|
||||
margin: EdgeInsets.only(top: 50, bottom: 20),
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Text(
|
||||
'Save',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
onTap: () async {
|
||||
await Provider.of<Auth>(context,
|
||||
listen: false)
|
||||
.setUserData(
|
||||
user['id'],
|
||||
usernameCTRL.text,
|
||||
emailCTRL.text,
|
||||
)
|
||||
.then(
|
||||
(value) async => await showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text(
|
||||
'Info changed successfully.',
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: Text('Ok'),
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+159
-157
@@ -43,7 +43,7 @@ class _RePassScreenState extends State<RePassScreen> {
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text(message),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text('Ok'),
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
@@ -79,163 +79,165 @@ class _RePassScreenState extends State<RePassScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('CSSD'),
|
||||
),
|
||||
body: Selector<ConnectivityProvider, String>(
|
||||
builder: (ctx, value, _) => value != 'offline'
|
||||
? _isLoading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Text(
|
||||
'CHANGE PASSWORD',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Password is required.';
|
||||
}
|
||||
if (value.length < 8) {
|
||||
return 'Password at least is 8 characters.';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
obscureText: _hidePass,
|
||||
controller: passwordController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Password',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
suffixIcon: InkWell(
|
||||
child: Icon(FontAwesomeIcons.eye),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_hidePass = !_hidePass;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
onFieldSubmitted: (_) {
|
||||
_sendRePass();
|
||||
},
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.length < 8) {
|
||||
return 'Password at least is 8 characters.';
|
||||
}
|
||||
if (value != passwordController.text) {
|
||||
return 'Password doesnt match!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
obscureText: _hideRePass,
|
||||
controller: rePasswordController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Confirm Password',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
suffixIcon: InkWell(
|
||||
child: Icon(FontAwesomeIcons.eye),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_hideRePass = !_hideRePass;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
onFieldSubmitted: (_) {
|
||||
_sendRePass();
|
||||
},
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _sendRePass(),
|
||||
child: Container(
|
||||
width: 40 * _deviceBlockSize,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Text(
|
||||
'Change',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('CSSD'),
|
||||
),
|
||||
body: Selector<ConnectivityProvider, String>(
|
||||
builder: (ctx, value, _) => value != 'offline'
|
||||
? _isLoading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Text(
|
||||
'CHANGE PASSWORD',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox(),
|
||||
selector: (_, connectivity) => connectivity.conStatus,
|
||||
));
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Password is required.';
|
||||
}
|
||||
if (value.length < 8) {
|
||||
return 'Password at least is 8 characters.';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
obscureText: _hidePass,
|
||||
controller: passwordController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Password',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
suffixIcon: InkWell(
|
||||
child: Icon(FontAwesomeIcons.eye),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_hidePass = !_hidePass;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
onFieldSubmitted: (_) {
|
||||
_sendRePass();
|
||||
},
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.length < 8) {
|
||||
return 'Password at least is 8 characters.';
|
||||
}
|
||||
if (value != passwordController.text) {
|
||||
return 'Password doesnt match!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
obscureText: _hideRePass,
|
||||
controller: rePasswordController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Confirm Password',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
suffixIcon: InkWell(
|
||||
child: Icon(FontAwesomeIcons.eye),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_hideRePass = !_hideRePass;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
onFieldSubmitted: (_) {
|
||||
_sendRePass();
|
||||
},
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _sendRePass(),
|
||||
child: Container(
|
||||
width: 40 * _deviceBlockSize,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Text(
|
||||
'Change',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox(),
|
||||
selector: (_, connectivity) => connectivity.conStatus,
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+259
-257
@@ -39,7 +39,7 @@ class _RegisterState extends State<Register> {
|
||||
// title: Text('error occured'),
|
||||
// content: Text(message),
|
||||
// actions: <Widget>[
|
||||
// FlatButton(
|
||||
// TextButton(
|
||||
// child: Text('Ok'),
|
||||
// onPressed: () {
|
||||
// Navigator.of(ctx).pop();
|
||||
@@ -84,294 +84,296 @@ class _RegisterState extends State<Register> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
appBar:AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Login'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Login'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
),
|
||||
body: _isLoading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Text(
|
||||
'register',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 7 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
body: _isLoading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Text(
|
||||
'register',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 7 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Cell number is required.';
|
||||
}
|
||||
RegExp regExp = RegExp(r'^09[0,1,2,3,9]{1}[0-9]{8}$');
|
||||
if (!regExp.hasMatch(value)) {
|
||||
return 'Enter a valid cell number';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
style: TextStyle(fontWeight: FontWeight.w700),
|
||||
keyboardType: TextInputType.phone,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context).requestFocus(_passwordFocusNode);
|
||||
},
|
||||
controller: cellNumberController,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
icon: Icon(
|
||||
Icons.call,
|
||||
color: Colors.grey,
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Cell number is required.';
|
||||
}
|
||||
RegExp regExp = RegExp(r'^09[0,1,2,3,9]{1}[0-9]{8}$');
|
||||
if (!regExp.hasMatch(value)) {
|
||||
return 'Enter a valid cell number';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
style: TextStyle(fontWeight: FontWeight.w700),
|
||||
keyboardType: TextInputType.phone,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context).requestFocus(_passwordFocusNode);
|
||||
},
|
||||
controller: cellNumberController,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
icon: Icon(
|
||||
Icons.call,
|
||||
color: Colors.grey,
|
||||
),
|
||||
border: UnderlineInputBorder(),
|
||||
fillColor: Colors.red,
|
||||
labelText: 'Cell Number',
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 5),
|
||||
),
|
||||
border: UnderlineInputBorder(),
|
||||
fillColor: Colors.red,
|
||||
labelText: 'Cell Number',
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 5),
|
||||
onSaved: (value) {
|
||||
map['cellNumber'] = value;
|
||||
},
|
||||
),
|
||||
onSaved: (value) {
|
||||
map['cellNumber'] = value;
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Password is required.';
|
||||
}
|
||||
if (value.length < 8) {
|
||||
return 'Password at least is 8 characters.';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
obscureText: _hidePass,
|
||||
textInputAction: TextInputAction.done,
|
||||
onFieldSubmitted: (_) {
|
||||
_register();
|
||||
},
|
||||
style: TextStyle(fontWeight: FontWeight.w700),
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
color: Colors.grey,
|
||||
),
|
||||
border: UnderlineInputBorder(),
|
||||
fillColor: Colors.red,
|
||||
labelText: 'Password',
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 5),
|
||||
suffixIcon: InkWell(
|
||||
child: Icon(FontAwesomeIcons.eye),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_hidePass = !_hidePass;
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
focusNode: _passwordFocusNode,
|
||||
onSaved: (value) {
|
||||
map['password'] = value;
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Full Name is required.';
|
||||
}
|
||||
// RegExp regExp = RegExp(r'^09[0,1,2,3,9]{1}[0-9]{8}$');
|
||||
// if (!regExp.hasMatch(value)) {
|
||||
// return 'Enter a valid cell number';
|
||||
// }
|
||||
return null;
|
||||
},
|
||||
// keyboardType: TextInputType.phone,
|
||||
// textInputAction: TextInputAction.next,
|
||||
// onFieldSubmitted: (_) {
|
||||
// FocusScope.of(context).requestFocus(_passwordFocusNode);
|
||||
// },
|
||||
// controller: cellNumberController,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
color: Colors.grey,
|
||||
),
|
||||
border: UnderlineInputBorder(),
|
||||
fillColor: Colors.red,
|
||||
labelText: 'Full Name',
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 5),
|
||||
),
|
||||
style: TextStyle(fontWeight: FontWeight.w700),
|
||||
// onSaved: (value) {
|
||||
// map['cellNumber'] = value;
|
||||
// },
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
// width: double.infinity,
|
||||
children: <Widget>[
|
||||
Icon(
|
||||
FontAwesomeIcons.alignLeft,
|
||||
color: Colors.grey,
|
||||
size: 5 * _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
width: 3 * _deviceBlockSize,
|
||||
),
|
||||
Expanded(
|
||||
// width: MediaQuery.of(context).size.width - 70,
|
||||
child: DropdownButton(
|
||||
focusColor: Colors.red,
|
||||
icon: Icon(FontAwesomeIcons.angleDown),
|
||||
isExpanded: true,
|
||||
hint: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Text(
|
||||
curhospitalVal,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Colors.black,
|
||||
// color: _mainFontColor,
|
||||
// fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
isDense: true,
|
||||
items: hospitalVals.map((String value) {
|
||||
return new DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Container(
|
||||
child: Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
// color: _mainFontColor,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (val) {
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Password is required.';
|
||||
}
|
||||
if (value.length < 8) {
|
||||
return 'Password at least is 8 characters.';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
obscureText: _hidePass,
|
||||
textInputAction: TextInputAction.done,
|
||||
onFieldSubmitted: (_) {
|
||||
_register();
|
||||
},
|
||||
style: TextStyle(fontWeight: FontWeight.w700),
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
color: Colors.grey,
|
||||
),
|
||||
border: UnderlineInputBorder(),
|
||||
fillColor: Colors.red,
|
||||
labelText: 'Password',
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 5),
|
||||
suffixIcon: InkWell(
|
||||
child: Icon(FontAwesomeIcons.eye),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
curhospitalVal = val;
|
||||
_hidePass = !_hidePass;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _register(),
|
||||
child: Container(
|
||||
focusNode: _passwordFocusNode,
|
||||
onSaved: (value) {
|
||||
map['password'] = value;
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Full Name is required.';
|
||||
}
|
||||
// RegExp regExp = RegExp(r'^09[0,1,2,3,9]{1}[0-9]{8}$');
|
||||
// if (!regExp.hasMatch(value)) {
|
||||
// return 'Enter a valid cell number';
|
||||
// }
|
||||
return null;
|
||||
},
|
||||
// keyboardType: TextInputType.phone,
|
||||
// textInputAction: TextInputAction.next,
|
||||
// onFieldSubmitted: (_) {
|
||||
// FocusScope.of(context).requestFocus(_passwordFocusNode);
|
||||
// },
|
||||
// controller: cellNumberController,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
color: Colors.grey,
|
||||
),
|
||||
border: UnderlineInputBorder(),
|
||||
fillColor: Colors.red,
|
||||
labelText: 'Full Name',
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 5),
|
||||
),
|
||||
style: TextStyle(fontWeight: FontWeight.w700),
|
||||
// onSaved: (value) {
|
||||
// map['cellNumber'] = value;
|
||||
// },
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
// width: double.infinity,
|
||||
children: <Widget>[
|
||||
Icon(
|
||||
FontAwesomeIcons.alignLeft,
|
||||
color: Colors.grey,
|
||||
size: 5 * _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
width: 3 * _deviceBlockSize,
|
||||
),
|
||||
Expanded(
|
||||
// width: MediaQuery.of(context).size.width - 70,
|
||||
child: DropdownButton(
|
||||
focusColor: Colors.red,
|
||||
icon: Icon(FontAwesomeIcons.angleDown),
|
||||
isExpanded: true,
|
||||
hint: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Text(
|
||||
curhospitalVal,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Colors.black,
|
||||
// color: _mainFontColor,
|
||||
// fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
isDense: true,
|
||||
items: hospitalVals.map((String value) {
|
||||
return new DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Container(
|
||||
child: Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
// color: _mainFontColor,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (val) {
|
||||
setState(() {
|
||||
curhospitalVal = val;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _register(),
|
||||
child: Container(
|
||||
width: 40 * _deviceBlockSize,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 5,
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.add,
|
||||
color: Colors.white,
|
||||
),
|
||||
Text(
|
||||
'register',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
Spacer()
|
||||
],
|
||||
)
|
||||
// TextButton.icon(
|
||||
// padding: EdgeInsets.all(0),
|
||||
// onPressed: () {
|
||||
// _register();
|
||||
// },
|
||||
// icon: Icon(Icons.exit_to_app,
|
||||
// color: Colors.white, size: 17),
|
||||
// label: Text('register',
|
||||
// style: TextStyle(color: Colors.white)),
|
||||
// ),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Container(
|
||||
width: 40 * _deviceBlockSize,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 5,
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
border: Border.all(
|
||||
color: Colors.black,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.add,
|
||||
color: Colors.white,
|
||||
Icons.exit_to_app,
|
||||
// size: 6 * _pixelRatio,
|
||||
),
|
||||
Text(
|
||||
'register',
|
||||
style: TextStyle(color: Colors.white),
|
||||
'Login',
|
||||
style: TextStyle(
|
||||
// fontSize: 5.5,
|
||||
),
|
||||
),
|
||||
Spacer()
|
||||
Spacer(),
|
||||
],
|
||||
)
|
||||
// FlatButton.icon(
|
||||
// padding: EdgeInsets.all(0),
|
||||
// onPressed: () {
|
||||
// _register();
|
||||
// },
|
||||
// icon: Icon(Icons.exit_to_app,
|
||||
// color: Colors.white, size: 17),
|
||||
// label: Text('register',
|
||||
// style: TextStyle(color: Colors.white)),
|
||||
// ),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Container(
|
||||
width: 40 * _deviceBlockSize,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 5,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
border: Border.all(
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.exit_to_app,
|
||||
// size: 6 * _pixelRatio,
|
||||
),
|
||||
Text(
|
||||
'Login',
|
||||
style: TextStyle(
|
||||
// fontSize: 5.5,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+197
-195
@@ -1,17 +1,18 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
import 'package:cssd/widgets/TestResultScreens/Add/selector_box.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:barcode_scan/barcode_scan.dart';
|
||||
import 'package:cssd/providers/test_results.dart';
|
||||
import 'package:barcode_scan2/barcode_scan2.dart';
|
||||
// import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart';
|
||||
|
||||
import 'package:cssd/pages/test_form_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../config/routes.dart';
|
||||
import '../providers/connectivity.dart';
|
||||
import '../providers/test_results.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
import '../widgets/TestResultScreens/Add/selector_box.dart';
|
||||
|
||||
class TestResultAddScreen extends StatefulWidget {
|
||||
// static const route = '/TestResultAddScreen';
|
||||
@override
|
||||
@@ -59,206 +60,207 @@ class _TestResultAddScreenState extends State<TestResultAddScreen> {
|
||||
);
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Test Results'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Test Results'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
// padding: EdgeInsets.all(0),
|
||||
onPressed: () => Navigator.of(context)
|
||||
.popAndPushNamed(Routes.testResultScreen),
|
||||
),
|
||||
// padding: EdgeInsets.all(0),
|
||||
onPressed: () =>
|
||||
Navigator.of(context).popAndPushNamed(Routes.testResultScreen),
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: ListView(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 20, vertical: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(
|
||||
top: 10,
|
||||
),
|
||||
child: Text(
|
||||
'ADD A TEST RESULT',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
fontWeight: FontWeight.w700,
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: ListView(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 20, vertical: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(
|
||||
top: 10,
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 5, bottom: 30),
|
||||
padding: EdgeInsets.all(10),
|
||||
height: 200,
|
||||
decoration: BoxDecoration(border: Border.all()),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'PLEASE SCAN THE TEST BARCODE',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w100,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
child: Text(
|
||||
'ADD A TEST RESULT',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
scan().then(
|
||||
(String result) {
|
||||
if (result == 'cancel') {
|
||||
print('cancel');
|
||||
} else if (result == 'error') {
|
||||
print('error');
|
||||
} else if (result == 'access') {
|
||||
print('access');
|
||||
} else {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return FormPage(
|
||||
uniqueCode: result,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: 70 * _deviceBlockSize,
|
||||
child: TestResultAddSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
dataCTRL: testTypeCTRL,
|
||||
dataVals: testTypeVals,
|
||||
label: 'Choose a Test Type'),
|
||||
GestureDetector(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 5, bottom: 30),
|
||||
padding: EdgeInsets.all(10),
|
||||
height: 200,
|
||||
decoration: BoxDecoration(border: Border.all()),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'PLEASE SCAN THE TEST BARCODE',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w100,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'OR',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 7 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8 * _deviceBlockSize,
|
||||
),
|
||||
Container(
|
||||
width: 50 * _deviceBlockSize,
|
||||
child: TextFormField(
|
||||
onChanged: (val) {
|
||||
if (val != '') {
|
||||
setState(() {
|
||||
testTypeCTRL.text = '';
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
testTypeCTRL.text =
|
||||
testTypeVals[0];
|
||||
});
|
||||
}
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
scan().then(
|
||||
(String result) {
|
||||
if (result == 'cancel') {
|
||||
print('cancel');
|
||||
} else if (result == 'error') {
|
||||
print('error');
|
||||
} else if (result == 'access') {
|
||||
print('access');
|
||||
} else {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return FormPage(
|
||||
uniqueCode: result,
|
||||
);
|
||||
},
|
||||
controller: testIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
),
|
||||
labelText: 'Enter a Test Code',
|
||||
labelStyle: TextStyle(
|
||||
fontSize: 3 * _deviceBlockSize),
|
||||
contentPadding: EdgeInsets.only(
|
||||
bottom: 5, top: 5),
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 5 * _deviceBlockSize,
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 100,
|
||||
margin: EdgeInsets.only(bottom: 50),
|
||||
child: FlatButton(
|
||||
padding: EdgeInsets.all(0),
|
||||
color: Color(0xFFEB4A64),
|
||||
shape: RoundedRectangleBorder(
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: 70 * _deviceBlockSize,
|
||||
child: TestResultAddSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
dataCTRL: testTypeCTRL,
|
||||
dataVals: testTypeVals,
|
||||
label: 'Choose a Test Type'),
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'OR',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 7 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8 * _deviceBlockSize,
|
||||
),
|
||||
Container(
|
||||
width: 50 * _deviceBlockSize,
|
||||
child: TextFormField(
|
||||
onChanged: (val) {
|
||||
if (val != '') {
|
||||
setState(() {
|
||||
testTypeCTRL.text = '';
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
testTypeCTRL.text =
|
||||
testTypeVals[0];
|
||||
});
|
||||
}
|
||||
},
|
||||
controller: testIdCTRL,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
),
|
||||
labelText: 'Enter a Test Code',
|
||||
labelStyle: TextStyle(
|
||||
fontSize: 3 * _deviceBlockSize),
|
||||
contentPadding: EdgeInsets.only(
|
||||
bottom: 5, top: 5),
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 5 * _deviceBlockSize,
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 100,
|
||||
margin: EdgeInsets.only(bottom: 50),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFEB4A64),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Text(
|
||||
'GO',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w700),
|
||||
child: TextButton(
|
||||
child: Text(
|
||||
'GO',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w700),
|
||||
),
|
||||
onPressed: () {
|
||||
if (testIdCTRL.text != '') {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return FormPage(
|
||||
uniqueCode: testIdCTRL.text);
|
||||
},
|
||||
),
|
||||
);
|
||||
} else if (testTypeCTRL.text != '') {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return FormPage(
|
||||
name: testTypeCTRL.text,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
// print(testCode);
|
||||
},
|
||||
),
|
||||
onPressed: () {
|
||||
if (testIdCTRL.text != '') {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return FormPage(
|
||||
uniqueCode: testIdCTRL.text);
|
||||
},
|
||||
),
|
||||
);
|
||||
} else if (testTypeCTRL.text != '') {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return FormPage(
|
||||
name: testTypeCTRL.text,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
// print(testCode);
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
import 'package:cssd/providers/test_results.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
import 'package:cssd/widgets/TestResultScreens/Details/datas_box.dart';
|
||||
import '../providers/connectivity.dart';
|
||||
import '../providers/test_results.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
import '../widgets/TestResultScreens/Details/datas_box.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -42,31 +42,33 @@ class _TestDetailsScreenState extends State<TestDetailsScreen> {
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
// print(datas);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Test Result Detail'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Test Result Detail'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(
|
||||
builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: DatasBox(
|
||||
datas: datas,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
body: Consumer<ConnectivityProvider>(
|
||||
builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: DatasBox(
|
||||
datas: datas,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
+251
-248
@@ -1,4 +1,4 @@
|
||||
import 'package:barcode_scan/barcode_scan.dart';
|
||||
import 'package:barcode_scan2/barcode_scan2.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -131,264 +131,267 @@ class _TestFilterScreenState extends State<TestFilterScreen> {
|
||||
);
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Tests'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).popAndPushNamed(
|
||||
Routes.testResultScreen,
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Tests'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).popAndPushNamed(
|
||||
Routes.testResultScreen,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(
|
||||
builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'FILTER RESULTS',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 8,
|
||||
child: TextFormField(
|
||||
controller: idCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'ID',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.text,
|
||||
textInputAction: TextInputAction.next,
|
||||
// onFieldSubmitted: (_) {
|
||||
// FocusScope.of(context)
|
||||
// .requestFocus(_cycleNumberFocusNode);
|
||||
// },
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(
|
||||
builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? isInit
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'FILTER RESULTS',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
scan().then(
|
||||
(String result) {
|
||||
if (result == 'cancel') {
|
||||
print('cancel');
|
||||
} else if (result == 'error') {
|
||||
print('error');
|
||||
} else if (result == 'access') {
|
||||
print('access');
|
||||
} else {
|
||||
print(result);
|
||||
idCTRL.text = result;
|
||||
// Navigator.of(context).pushNamed(
|
||||
// CycleDetailScreen.route,
|
||||
// arguments: result,
|
||||
// );
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.black,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 8,
|
||||
child: TextFormField(
|
||||
controller: idCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'ID',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
child: Icon(
|
||||
FontAwesomeIcons.barcode,
|
||||
size: 5 * _deviceBlockSize,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.text,
|
||||
textInputAction: TextInputAction.next,
|
||||
// onFieldSubmitted: (_) {
|
||||
// FocusScope.of(context)
|
||||
// .requestFocus(_cycleNumberFocusNode);
|
||||
// },
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
scan().then(
|
||||
(String result) {
|
||||
if (result == 'cancel') {
|
||||
print('cancel');
|
||||
} else if (result == 'error') {
|
||||
print('error');
|
||||
} else if (result == 'access') {
|
||||
print('access');
|
||||
} else {
|
||||
print(result);
|
||||
idCTRL.text = result;
|
||||
// Navigator.of(context).pushNamed(
|
||||
// CycleDetailScreen.route,
|
||||
// arguments: result,
|
||||
// );
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.black,
|
||||
),
|
||||
child: Icon(
|
||||
FontAwesomeIcons.barcode,
|
||||
size: 5 * _deviceBlockSize,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
TestResultFilterSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
dataCTRL: labelIdCTRL,
|
||||
dataVals: labelIDVals,
|
||||
label: 'Label ID',
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
|
||||
TextFormField(
|
||||
controller: usernameCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Username',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.next,
|
||||
// onFieldSubmitted: (_) {
|
||||
// FocusScope.of(context)
|
||||
// .requestFocus(_cycleNumberFocusNode);
|
||||
// },
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
TestResultFilterSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
dataCTRL: testTypeCTRL,
|
||||
dataVals: testTypeVals,
|
||||
label: 'Test Type',
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
TestResultFilterSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
dataCTRL: hospitalCTRL,
|
||||
dataVals: hospitalVals,
|
||||
label: 'Hospital',
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
|
||||
TestResultFilterDatePicker(
|
||||
dateCTRL: fDateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Date From',
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
TestResultFilterDatePicker(
|
||||
dateCTRL: uDateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Date Until',
|
||||
),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Provider.of<TestResultsProvider>(context)
|
||||
.setFilters(
|
||||
idCTRL.text,
|
||||
labelIdCTRL.text != ''
|
||||
? labelIdCTRL.text
|
||||
: '',
|
||||
usernameCTRL.text,
|
||||
testTypeCTRL.text != ''
|
||||
? testTypes[testTypeCTRL.text]
|
||||
: '',
|
||||
hospitalCTRL.text != ''
|
||||
? hospitals[hospitalCTRL.text]
|
||||
: '',
|
||||
fDateCTRL.text,
|
||||
uDateCTRL.text,
|
||||
);
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text('Filters changed.'),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
// Navigator.of(context).pop();
|
||||
},
|
||||
child: Text('Ok'),
|
||||
)
|
||||
],
|
||||
),
|
||||
).then(
|
||||
(_) =>
|
||||
Navigator.of(context).popAndPushNamed(
|
||||
Routes.testResultScreen,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'FILTER',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
TestResultFilterSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
dataCTRL: labelIdCTRL,
|
||||
dataVals: labelIDVals,
|
||||
label: 'Label ID',
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
|
||||
TextFormField(
|
||||
controller: usernameCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Username',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.next,
|
||||
// onFieldSubmitted: (_) {
|
||||
// FocusScope.of(context)
|
||||
// .requestFocus(_cycleNumberFocusNode);
|
||||
// },
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
TestResultFilterSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
dataCTRL: testTypeCTRL,
|
||||
dataVals: testTypeVals,
|
||||
label: 'Test Type',
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
TestResultFilterSelectorBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
dataCTRL: hospitalCTRL,
|
||||
dataVals: hospitalVals,
|
||||
label: 'Hospital',
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
|
||||
TestResultFilterDatePicker(
|
||||
dateCTRL: fDateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Date From',
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
TestResultFilterDatePicker(
|
||||
dateCTRL: uDateCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Date Until',
|
||||
),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Provider.of<TestResultsProvider>(context)
|
||||
.setFilters(
|
||||
idCTRL.text,
|
||||
labelIdCTRL.text != ''
|
||||
? labelIdCTRL.text
|
||||
: '',
|
||||
usernameCTRL.text,
|
||||
testTypeCTRL.text != ''
|
||||
? testTypes[testTypeCTRL.text]
|
||||
: '',
|
||||
hospitalCTRL.text != ''
|
||||
? hospitals[hospitalCTRL.text]
|
||||
: '',
|
||||
fDateCTRL.text,
|
||||
uDateCTRL.text,
|
||||
);
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text('Filters changed.'),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
// Navigator.of(context).pop();
|
||||
},
|
||||
child: Text('Ok'),
|
||||
)
|
||||
],
|
||||
),
|
||||
).then(
|
||||
(_) => Navigator.of(context).popAndPushNamed(
|
||||
Routes.testResultScreen,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'FILTER',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
// DropDownBox(values: ['Washer ID']),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
// DropDownBox(values: ['Washer ID']),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:cssd/providers/input.dart';
|
||||
import 'package:cssd/providers/test_results.dart';
|
||||
import 'package:cssd/widgets/TestResultScreens/Add/form_creator.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:random_string/random_string.dart';
|
||||
|
||||
import '../config/routes.dart';
|
||||
import '../providers/input.dart';
|
||||
import '../providers/test_results.dart';
|
||||
import '../widgets/TestResultScreens/Add/form_creator.dart';
|
||||
|
||||
class FormPage extends StatefulWidget {
|
||||
final String name;
|
||||
final String uniqueCode;
|
||||
@@ -50,7 +51,7 @@ class _FormPageState extends State<FormPage> {
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text('Test added.'),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
@@ -97,73 +98,76 @@ class _FormPageState extends State<FormPage> {
|
||||
);
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('Add Test Result'),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(Icons.save),
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('Add Test Result'),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(Icons.save),
|
||||
onPressed: () {
|
||||
_saveForm();
|
||||
},
|
||||
)
|
||||
],
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () {
|
||||
_saveForm();
|
||||
Navigator.of(context)
|
||||
.popAndPushNamed(Routes.testResultScreen);
|
||||
},
|
||||
)
|
||||
],
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).popAndPushNamed(Routes.testResultScreen);
|
||||
},
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: _isLoading
|
||||
? Center(child: CircularProgressIndicator())
|
||||
: Form(
|
||||
key: _form,
|
||||
child: Consumer<Inputs>(
|
||||
builder: (context, inputs, _) {
|
||||
formInputs = inputs.inputItems;
|
||||
return formInputs.length != 0
|
||||
? FormCreator(
|
||||
form: inputs.inputItems,
|
||||
onChanged: (value) {
|
||||
formInputs = value;
|
||||
},
|
||||
)
|
||||
: Center(
|
||||
child: Text('An error happen!!!'),
|
||||
);
|
||||
},
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: _isLoading
|
||||
? Center(child: CircularProgressIndicator())
|
||||
: Form(
|
||||
key: _form,
|
||||
child: Consumer<Inputs>(
|
||||
builder: (context, inputs, _) {
|
||||
formInputs = inputs.inputItems;
|
||||
return formInputs.length != 0
|
||||
? FormCreator(
|
||||
form: inputs.inputItems,
|
||||
onChanged: (value) {
|
||||
formInputs = value;
|
||||
},
|
||||
)
|
||||
: Center(
|
||||
child: Text('An error happen!!!'),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// https://www.cssd-doc.com/api/GetInfo
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// _saveForm();
|
||||
// },
|
||||
// child: Container(
|
||||
// padding: EdgeInsets.symmetric(horizontal: 60, vertical: 15),
|
||||
// margin: EdgeInsets.symmetric(vertical: 20, horizontal: 50),
|
||||
// decoration: BoxDecoration(
|
||||
// gradient: LinearGradient(colors: [Colors.blue, Colors.green]),
|
||||
// borderRadius: BorderRadius.circular(10),
|
||||
// ),
|
||||
// child: Text(
|
||||
// 'Save',
|
||||
// style: TextStyle(color: Colors.white, fontSize: 17),
|
||||
// textAlign: TextAlign.center,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
)),
|
||||
),
|
||||
// https://www.cssd-doc.com/api/GetInfo
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// _saveForm();
|
||||
// },
|
||||
// child: Container(
|
||||
// padding: EdgeInsets.symmetric(horizontal: 60, vertical: 15),
|
||||
// margin: EdgeInsets.symmetric(vertical: 20, horizontal: 50),
|
||||
// decoration: BoxDecoration(
|
||||
// gradient: LinearGradient(colors: [Colors.blue, Colors.green]),
|
||||
// borderRadius: BorderRadius.circular(10),
|
||||
// ),
|
||||
// child: Text(
|
||||
// 'Save',
|
||||
// style: TextStyle(color: Colors.white, fontSize: 17),
|
||||
// textAlign: TextAlign.center,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+220
-217
@@ -1,6 +1,3 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:cssd/models/test_result_models.dart';
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
// import 'package:cssd/providers/test_result.dart';
|
||||
import 'package:cssd/providers/test_results.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
@@ -11,6 +8,10 @@ import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../config/routes.dart';
|
||||
import '../models/test_result_models.dart';
|
||||
import '../providers/connectivity.dart';
|
||||
|
||||
class TestResultScreen extends StatefulWidget {
|
||||
// static const route = '/TestResultScreen';
|
||||
final bool isAdmin;
|
||||
@@ -69,225 +70,227 @@ class _TestResultScreenState extends State<TestResultScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
floatingActionButton:
|
||||
TestResultFloatingButton(deviceBlockSize: _deviceBlockSize),
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Home'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
floatingActionButton:
|
||||
TestResultFloatingButton(deviceBlockSize: _deviceBlockSize),
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Home'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(
|
||||
builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? Padding(
|
||||
padding:
|
||||
EdgeInsets.only(top: 20, left: 20, right: 20, bottom: 60),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
// padding: EdgeInsets.only(top: 20, bottom: 40),
|
||||
child: Text(
|
||||
'MY TEST RESULTS',
|
||||
// textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: 2,
|
||||
),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context)
|
||||
.popAndPushNamed(Routes.testFilterScreen);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(7),
|
||||
child: Icon(
|
||||
FontAwesomeIcons.filter,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Consumer<TestResultsProvider>(
|
||||
builder: (context, testResult, _) {
|
||||
return Container(
|
||||
height: 50,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: true,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).popAndPushNamed(
|
||||
Routes.testFilterScreen);
|
||||
},
|
||||
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.testFilterScreen,
|
||||
);
|
||||
},
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(
|
||||
builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 20, left: 20, right: 20, bottom: 60),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
// padding: EdgeInsets.only(top: 20, bottom: 40),
|
||||
child: Text(
|
||||
'MY TEST RESULTS',
|
||||
// textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: 2,
|
||||
),
|
||||
testResult.filters.id != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'ID',
|
||||
id: '',
|
||||
labelID: testResult.filters.labelID,
|
||||
testType: testResult.filters.testType,
|
||||
hospital: testResult.filters.hospital,
|
||||
username: testResult.filters.userName,
|
||||
fDate: testResult.filters.fDate,
|
||||
uDate: testResult.filters.uDate,
|
||||
)
|
||||
: Container(),
|
||||
testResult.filters.labelID != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Label ID',
|
||||
id: testResult.filters.id,
|
||||
labelID: '',
|
||||
testType: testResult.filters.testType,
|
||||
hospital: testResult.filters.hospital,
|
||||
username: testResult.filters.userName,
|
||||
fDate: testResult.filters.fDate,
|
||||
uDate: testResult.filters.uDate,
|
||||
)
|
||||
: Container(),
|
||||
testResult.filters.testType != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Test Type',
|
||||
id: testResult.filters.id,
|
||||
labelID: testResult.filters.labelID,
|
||||
testType: '',
|
||||
hospital: testResult.filters.hospital,
|
||||
username: testResult.filters.userName,
|
||||
fDate: testResult.filters.fDate,
|
||||
uDate: testResult.filters.uDate,
|
||||
)
|
||||
: Container(),
|
||||
testResult.filters.hospital != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Hospital',
|
||||
id: testResult.filters.id,
|
||||
labelID: testResult.filters.labelID,
|
||||
testType: testResult.filters.testType,
|
||||
hospital: '',
|
||||
username: testResult.filters.userName,
|
||||
fDate: testResult.filters.fDate,
|
||||
uDate: testResult.filters.uDate,
|
||||
)
|
||||
: Container(),
|
||||
testResult.filters.userName != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Username',
|
||||
id: testResult.filters.id,
|
||||
labelID: testResult.filters.labelID,
|
||||
testType: testResult.filters.testType,
|
||||
hospital: testResult.filters.hospital,
|
||||
username: '',
|
||||
fDate: testResult.filters.fDate,
|
||||
uDate: testResult.filters.uDate,
|
||||
)
|
||||
: Container(),
|
||||
testResult.filters.fDate != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'From Date',
|
||||
id: testResult.filters.id,
|
||||
labelID: testResult.filters.labelID,
|
||||
testType: testResult.filters.testType,
|
||||
hospital: testResult.filters.hospital,
|
||||
username: testResult.filters.userName,
|
||||
fDate: '',
|
||||
uDate: testResult.filters.uDate,
|
||||
)
|
||||
: Container(),
|
||||
testResult.filters.uDate != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Until Date',
|
||||
id: testResult.filters.id,
|
||||
labelID: testResult.filters.labelID,
|
||||
testType: testResult.filters.testType,
|
||||
hospital: testResult.filters.hospital,
|
||||
username: testResult.filters.userName,
|
||||
fDate: testResult.filters.fDate,
|
||||
uDate: '',
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
TestResultSearchBox(
|
||||
searchCTRL: searchCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Expanded(
|
||||
child: Consumer<TestResultsProvider>(
|
||||
builder: (context, testResults, _) {
|
||||
return testResults.isloading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: ListView.builder(
|
||||
controller: sc,
|
||||
itemBuilder: (context, index) =>
|
||||
TestItemBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
item: testResults.items[index],
|
||||
Spacer(),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context)
|
||||
.popAndPushNamed(Routes.testFilterScreen);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(7),
|
||||
child: Icon(
|
||||
FontAwesomeIcons.filter,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Consumer<TestResultsProvider>(
|
||||
builder: (context, testResult, _) {
|
||||
return Container(
|
||||
height: 50,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: true,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).popAndPushNamed(
|
||||
Routes.testFilterScreen);
|
||||
},
|
||||
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.testFilterScreen,
|
||||
);
|
||||
},
|
||||
),
|
||||
itemCount: testResults.items.length,
|
||||
shrinkWrap: true,
|
||||
);
|
||||
),
|
||||
testResult.filters.id != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'ID',
|
||||
id: '',
|
||||
labelID: testResult.filters.labelID,
|
||||
testType: testResult.filters.testType,
|
||||
hospital: testResult.filters.hospital,
|
||||
username: testResult.filters.userName,
|
||||
fDate: testResult.filters.fDate,
|
||||
uDate: testResult.filters.uDate,
|
||||
)
|
||||
: Container(),
|
||||
testResult.filters.labelID != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Label ID',
|
||||
id: testResult.filters.id,
|
||||
labelID: '',
|
||||
testType: testResult.filters.testType,
|
||||
hospital: testResult.filters.hospital,
|
||||
username: testResult.filters.userName,
|
||||
fDate: testResult.filters.fDate,
|
||||
uDate: testResult.filters.uDate,
|
||||
)
|
||||
: Container(),
|
||||
testResult.filters.testType != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Test Type',
|
||||
id: testResult.filters.id,
|
||||
labelID: testResult.filters.labelID,
|
||||
testType: '',
|
||||
hospital: testResult.filters.hospital,
|
||||
username: testResult.filters.userName,
|
||||
fDate: testResult.filters.fDate,
|
||||
uDate: testResult.filters.uDate,
|
||||
)
|
||||
: Container(),
|
||||
testResult.filters.hospital != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Hospital',
|
||||
id: testResult.filters.id,
|
||||
labelID: testResult.filters.labelID,
|
||||
testType: testResult.filters.testType,
|
||||
hospital: '',
|
||||
username: testResult.filters.userName,
|
||||
fDate: testResult.filters.fDate,
|
||||
uDate: testResult.filters.uDate,
|
||||
)
|
||||
: Container(),
|
||||
testResult.filters.userName != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Username',
|
||||
id: testResult.filters.id,
|
||||
labelID: testResult.filters.labelID,
|
||||
testType: testResult.filters.testType,
|
||||
hospital: testResult.filters.hospital,
|
||||
username: '',
|
||||
fDate: testResult.filters.fDate,
|
||||
uDate: testResult.filters.uDate,
|
||||
)
|
||||
: Container(),
|
||||
testResult.filters.fDate != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'From Date',
|
||||
id: testResult.filters.id,
|
||||
labelID: testResult.filters.labelID,
|
||||
testType: testResult.filters.testType,
|
||||
hospital: testResult.filters.hospital,
|
||||
username: testResult.filters.userName,
|
||||
fDate: '',
|
||||
uDate: testResult.filters.uDate,
|
||||
)
|
||||
: Container(),
|
||||
testResult.filters.uDate != ''
|
||||
? TestResultChip(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
label: 'Until Date',
|
||||
id: testResult.filters.id,
|
||||
labelID: testResult.filters.labelID,
|
||||
testType: testResult.filters.testType,
|
||||
hospital: testResult.filters.hospital,
|
||||
username: testResult.filters.userName,
|
||||
fDate: testResult.filters.fDate,
|
||||
uDate: '',
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
TestResultSearchBox(
|
||||
searchCTRL: searchCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Expanded(
|
||||
child: Consumer<TestResultsProvider>(
|
||||
builder: (context, testResults, _) {
|
||||
return testResults.isloading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: ListView.builder(
|
||||
controller: sc,
|
||||
itemBuilder: (context, index) =>
|
||||
TestItemBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
item: testResults.items[index],
|
||||
),
|
||||
itemCount: testResults.items.length,
|
||||
shrinkWrap: true,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -376,7 +379,7 @@ class TestItemBox extends StatelessWidget {
|
||||
// content: Text(
|
||||
// 'Are you sure for delete this test?'),
|
||||
// actions: <Widget>[
|
||||
// FlatButton(
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Provider.of<TestResultsProvider>(
|
||||
// context)
|
||||
@@ -388,7 +391,7 @@ class TestItemBox extends StatelessWidget {
|
||||
// },
|
||||
// child: Text('Yes'),
|
||||
// ),
|
||||
// FlatButton(
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Navigator.of(ctx).pop();
|
||||
// },
|
||||
|
||||
+150
-147
@@ -1,13 +1,13 @@
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
import 'package:barcode_scan2/barcode_scan2.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:barcode_scan/barcode_scan.dart';
|
||||
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../providers/connectivity.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
|
||||
class TestScanScreen extends StatefulWidget {
|
||||
// static const route = '/TestScanScreen';
|
||||
@override
|
||||
@@ -27,163 +27,166 @@ class _TestScanScreenState extends State<TestScanScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
titleSpacing: -10,
|
||||
title: Text('CSSD'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
titleSpacing: -10,
|
||||
title: Text('CSSD'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
),
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 30),
|
||||
child: Text(
|
||||
'LOOKING FOR A Test Result?',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5.5 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
child: Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 10),
|
||||
height: 200,
|
||||
decoration: BoxDecoration(border: Border.all()),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Please Scan The Test Result Barcode',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w100,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
|
||||
return connection.conStatus != 'offline'
|
||||
? ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 30),
|
||||
child: Text(
|
||||
'LOOKING FOR A Test Result?',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5.5 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
scan().then(
|
||||
(String result) {
|
||||
if (result == 'cancel') {
|
||||
print('cancel');
|
||||
} else if (result == 'error') {
|
||||
print('error');
|
||||
} else if (result == 'access') {
|
||||
print('access');
|
||||
} else {
|
||||
launch(
|
||||
'https://cssd-doc.com/Show/TestResult/$result',
|
||||
);
|
||||
// Navigator.of(context).pushNamed(
|
||||
// Routes.cycleDetailScreen,
|
||||
// arguments: result,
|
||||
// );
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
Form(
|
||||
key: _form,
|
||||
child: TextFormField(
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Id required!!';
|
||||
}
|
||||
return null;
|
||||
GestureDetector(
|
||||
child: Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 10),
|
||||
height: 200,
|
||||
decoration: BoxDecoration(border: Border.all()),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Please Scan The Test Result Barcode',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w100,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
scan().then(
|
||||
(String result) {
|
||||
if (result == 'cancel') {
|
||||
print('cancel');
|
||||
} else if (result == 'error') {
|
||||
print('error');
|
||||
} else if (result == 'access') {
|
||||
print('access');
|
||||
} else {
|
||||
launch(
|
||||
'https://cssd-doc.com/Show/TestResult/$result',
|
||||
);
|
||||
// Navigator.of(context).pushNamed(
|
||||
// Routes.cycleDetailScreen,
|
||||
// arguments: result,
|
||||
// );
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
controller: idCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Or enter a Test Result ID',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
horizontal: 3,
|
||||
),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
// borderRadius: BorderRadius.only(Radius.circular(4)),
|
||||
borderSide: BorderSide(
|
||||
color: Colors.grey,
|
||||
),
|
||||
Form(
|
||||
key: _form,
|
||||
child: TextFormField(
|
||||
validator: (val) {
|
||||
if (val.isEmpty) {
|
||||
return 'Id required!!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: idCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.sortNumericDown,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'Or enter a Test Result ID',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
horizontal: 3,
|
||||
),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
// borderRadius: BorderRadius.only(Radius.circular(4)),
|
||||
borderSide: BorderSide(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
thickness: 3,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (!_form.currentState.validate()) {
|
||||
return;
|
||||
}
|
||||
launch(
|
||||
'https://cssd-doc.com/Show/TestResult/${idCTRL.text}',
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
margin: EdgeInsets.only(bottom: 50, left: 20, right: 20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.red, Colors.orange],
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'GO!',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
thickness: 3,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (!_form.currentState.validate()) {
|
||||
return;
|
||||
}
|
||||
launch(
|
||||
'https://cssd-doc.com/Show/TestResult/${idCTRL.text}',
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
margin:
|
||||
EdgeInsets.only(bottom: 50, left: 20, right: 20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.red, Colors.orange],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'GO!',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
],
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+233
-231
@@ -1,11 +1,11 @@
|
||||
import 'package:cssd/providers/test_results.dart';
|
||||
import 'package:cssd/widgets/TestResultScreens/Main/search_box.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../config/routes.dart';
|
||||
import '../models/test_result_models.dart';
|
||||
import '../providers/auth.dart';
|
||||
import '../providers/test_results.dart';
|
||||
import '../widgets/TestResultScreens/Main/search_box.dart';
|
||||
|
||||
class TestVerifyScreen extends StatefulWidget {
|
||||
// static const route = '/TestVerifyScreen';
|
||||
@@ -70,236 +70,238 @@ class _TestVerifyScreenState extends State<TestVerifyScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Home'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Home'),
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_left,
|
||||
size: 35,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: EdgeInsets.only(top: 20, left: 20, right: 20, bottom: 60),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
// padding: EdgeInsets.only(top: 20, bottom: 40),
|
||||
child: Text(
|
||||
'TESTS TO VERIFY',
|
||||
// textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: 2,
|
||||
body: Padding(
|
||||
padding: EdgeInsets.only(top: 20, left: 20, right: 20, bottom: 60),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
// padding: EdgeInsets.only(top: 20, bottom: 40),
|
||||
child: Text(
|
||||
'TESTS TO VERIFY',
|
||||
// textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: 2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Spacer(),
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// Navigator.of(context)
|
||||
// .popAndPushNamed(Routes.testFilterScreen);
|
||||
// },
|
||||
// child: Container(
|
||||
// padding: EdgeInsets.all(7),
|
||||
// child: Icon(
|
||||
// FontAwesomeIcons.filter,
|
||||
// size: 7 * _deviceBlockSize,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
// Consumer<TestResultsProvider>(
|
||||
// builder: (context, testResult, _) {
|
||||
// return Container(
|
||||
// height: 50,
|
||||
// child: ListView(
|
||||
// scrollDirection: Axis.horizontal,
|
||||
// shrinkWrap: true,
|
||||
// children: <Widget>[
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// Navigator.of(context)
|
||||
// .popAndPushNamed(Routes.testFilterScreen);
|
||||
// },
|
||||
// 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.testFilterScreen);
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// testResult.filters.id != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'ID',
|
||||
// id: '',
|
||||
// labelID: testResult.filters.labelID,
|
||||
// testType: testResult.filters.testType,
|
||||
// hospital: testResult.filters.hospital,
|
||||
// username: testResult.filters.userName,
|
||||
// fDate: testResult.filters.fDate,
|
||||
// uDate: testResult.filters.uDate,
|
||||
// )
|
||||
// : Container(),
|
||||
// testResult.filters.labelID != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'Label ID',
|
||||
// id: testResult.filters.id,
|
||||
// labelID: '',
|
||||
// testType: testResult.filters.testType,
|
||||
// hospital: testResult.filters.hospital,
|
||||
// username: testResult.filters.userName,
|
||||
// fDate: testResult.filters.fDate,
|
||||
// uDate: testResult.filters.uDate,
|
||||
// )
|
||||
// : Container(),
|
||||
// testResult.filters.testType != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'Test Type',
|
||||
// id: testResult.filters.id,
|
||||
// labelID: testResult.filters.labelID,
|
||||
// testType: '',
|
||||
// hospital: testResult.filters.hospital,
|
||||
// username: testResult.filters.userName,
|
||||
// fDate: testResult.filters.fDate,
|
||||
// uDate: testResult.filters.uDate,
|
||||
// )
|
||||
// : Container(),
|
||||
// testResult.filters.hospital != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'Hospital',
|
||||
// id: testResult.filters.id,
|
||||
// labelID: testResult.filters.labelID,
|
||||
// testType: testResult.filters.testType,
|
||||
// hospital: '',
|
||||
// username: testResult.filters.userName,
|
||||
// fDate: testResult.filters.fDate,
|
||||
// uDate: testResult.filters.uDate,
|
||||
// )
|
||||
// : Container(),
|
||||
// testResult.filters.userName != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'Username',
|
||||
// id: testResult.filters.id,
|
||||
// labelID: testResult.filters.labelID,
|
||||
// testType: testResult.filters.testType,
|
||||
// hospital: testResult.filters.hospital,
|
||||
// username: '',
|
||||
// fDate: testResult.filters.fDate,
|
||||
// uDate: testResult.filters.uDate,
|
||||
// )
|
||||
// : Container(),
|
||||
// testResult.filters.fDate != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'From Date',
|
||||
// id: testResult.filters.id,
|
||||
// labelID: testResult.filters.labelID,
|
||||
// testType: testResult.filters.testType,
|
||||
// hospital: testResult.filters.hospital,
|
||||
// username: testResult.filters.userName,
|
||||
// fDate: '',
|
||||
// uDate: testResult.filters.uDate,
|
||||
// )
|
||||
// : Container(),
|
||||
// testResult.filters.uDate != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'Until Date',
|
||||
// id: testResult.filters.id,
|
||||
// labelID: testResult.filters.labelID,
|
||||
// testType: testResult.filters.testType,
|
||||
// hospital: testResult.filters.hospital,
|
||||
// username: testResult.filters.userName,
|
||||
// fDate: testResult.filters.fDate,
|
||||
// uDate: '',
|
||||
// )
|
||||
// : Container(),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
TestResultSearchBox(
|
||||
searchCTRL: searchCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Expanded(
|
||||
child: Consumer<TestResultsProvider>(
|
||||
builder: (context, testResults, _) {
|
||||
return testResults.isloading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: ListView.builder(
|
||||
controller: sc,
|
||||
itemBuilder: (context, index) =>
|
||||
(testResults.items[index].verified == 'None' &&
|
||||
userData['roles']
|
||||
.contains('Supervisor')) ||
|
||||
userData['roles'].contains('Admin')
|
||||
? TestItemBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
item: testResults.items[index],
|
||||
id: testResults.items[index].id,
|
||||
userData: userData,
|
||||
)
|
||||
: Container(),
|
||||
// Column(
|
||||
// children: <Widget>[
|
||||
// Text(testResults.items[index].name),
|
||||
// Text(testResults.items[index].isVerified.toString()),
|
||||
// Text(testResults.items[index].hospital),
|
||||
// Text(testResults.items[index].date),
|
||||
|
||||
// ],
|
||||
// ),
|
||||
// ChangeNotifierProvider.value(
|
||||
// value: testResults.items[index],
|
||||
// child: ResultCard(
|
||||
// isAdmin: widget.isAdmin,
|
||||
// ),
|
||||
// ),
|
||||
itemCount: testResults.items.length,
|
||||
shrinkWrap: true,
|
||||
);
|
||||
},
|
||||
// Spacer(),
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// Navigator.of(context)
|
||||
// .popAndPushNamed(Routes.testFilterScreen);
|
||||
// },
|
||||
// child: Container(
|
||||
// padding: EdgeInsets.all(7),
|
||||
// child: Icon(
|
||||
// FontAwesomeIcons.filter,
|
||||
// size: 7 * _deviceBlockSize,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
// Consumer<TestResultsProvider>(
|
||||
// builder: (context, testResult, _) {
|
||||
// return Container(
|
||||
// height: 50,
|
||||
// child: ListView(
|
||||
// scrollDirection: Axis.horizontal,
|
||||
// shrinkWrap: true,
|
||||
// children: <Widget>[
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// Navigator.of(context)
|
||||
// .popAndPushNamed(Routes.testFilterScreen);
|
||||
// },
|
||||
// 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.testFilterScreen);
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// testResult.filters.id != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'ID',
|
||||
// id: '',
|
||||
// labelID: testResult.filters.labelID,
|
||||
// testType: testResult.filters.testType,
|
||||
// hospital: testResult.filters.hospital,
|
||||
// username: testResult.filters.userName,
|
||||
// fDate: testResult.filters.fDate,
|
||||
// uDate: testResult.filters.uDate,
|
||||
// )
|
||||
// : Container(),
|
||||
// testResult.filters.labelID != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'Label ID',
|
||||
// id: testResult.filters.id,
|
||||
// labelID: '',
|
||||
// testType: testResult.filters.testType,
|
||||
// hospital: testResult.filters.hospital,
|
||||
// username: testResult.filters.userName,
|
||||
// fDate: testResult.filters.fDate,
|
||||
// uDate: testResult.filters.uDate,
|
||||
// )
|
||||
// : Container(),
|
||||
// testResult.filters.testType != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'Test Type',
|
||||
// id: testResult.filters.id,
|
||||
// labelID: testResult.filters.labelID,
|
||||
// testType: '',
|
||||
// hospital: testResult.filters.hospital,
|
||||
// username: testResult.filters.userName,
|
||||
// fDate: testResult.filters.fDate,
|
||||
// uDate: testResult.filters.uDate,
|
||||
// )
|
||||
// : Container(),
|
||||
// testResult.filters.hospital != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'Hospital',
|
||||
// id: testResult.filters.id,
|
||||
// labelID: testResult.filters.labelID,
|
||||
// testType: testResult.filters.testType,
|
||||
// hospital: '',
|
||||
// username: testResult.filters.userName,
|
||||
// fDate: testResult.filters.fDate,
|
||||
// uDate: testResult.filters.uDate,
|
||||
// )
|
||||
// : Container(),
|
||||
// testResult.filters.userName != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'Username',
|
||||
// id: testResult.filters.id,
|
||||
// labelID: testResult.filters.labelID,
|
||||
// testType: testResult.filters.testType,
|
||||
// hospital: testResult.filters.hospital,
|
||||
// username: '',
|
||||
// fDate: testResult.filters.fDate,
|
||||
// uDate: testResult.filters.uDate,
|
||||
// )
|
||||
// : Container(),
|
||||
// testResult.filters.fDate != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'From Date',
|
||||
// id: testResult.filters.id,
|
||||
// labelID: testResult.filters.labelID,
|
||||
// testType: testResult.filters.testType,
|
||||
// hospital: testResult.filters.hospital,
|
||||
// username: testResult.filters.userName,
|
||||
// fDate: '',
|
||||
// uDate: testResult.filters.uDate,
|
||||
// )
|
||||
// : Container(),
|
||||
// testResult.filters.uDate != ''
|
||||
// ? TestResultChip(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// label: 'Until Date',
|
||||
// id: testResult.filters.id,
|
||||
// labelID: testResult.filters.labelID,
|
||||
// testType: testResult.filters.testType,
|
||||
// hospital: testResult.filters.hospital,
|
||||
// username: testResult.filters.userName,
|
||||
// fDate: testResult.filters.fDate,
|
||||
// uDate: '',
|
||||
// )
|
||||
// : Container(),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
TestResultSearchBox(
|
||||
searchCTRL: searchCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Expanded(
|
||||
child: Consumer<TestResultsProvider>(
|
||||
builder: (context, testResults, _) {
|
||||
return testResults.isloading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: ListView.builder(
|
||||
controller: sc,
|
||||
itemBuilder: (context, index) =>
|
||||
(testResults.items[index].verified == 'None' &&
|
||||
userData['roles']
|
||||
.contains('Supervisor')) ||
|
||||
userData['roles'].contains('Admin')
|
||||
? TestItemBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
item: testResults.items[index],
|
||||
id: testResults.items[index].id,
|
||||
userData: userData,
|
||||
)
|
||||
: Container(),
|
||||
// Column(
|
||||
// children: <Widget>[
|
||||
// Text(testResults.items[index].name),
|
||||
// Text(testResults.items[index].isVerified.toString()),
|
||||
// Text(testResults.items[index].hospital),
|
||||
// Text(testResults.items[index].date),
|
||||
|
||||
// ],
|
||||
// ),
|
||||
// ChangeNotifierProvider.value(
|
||||
// value: testResults.items[index],
|
||||
// child: ResultCard(
|
||||
// isAdmin: widget.isAdmin,
|
||||
// ),
|
||||
// ),
|
||||
itemCount: testResults.items.length,
|
||||
shrinkWrap: true,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -401,7 +403,7 @@ class TestItemBox extends StatelessWidget {
|
||||
content: Text(
|
||||
'Are you sure for verify this test?'),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
Provider.of<TestResultsProvider>(
|
||||
context)
|
||||
@@ -418,7 +420,7 @@ class TestItemBox extends StatelessWidget {
|
||||
},
|
||||
child: Text('Yes'),
|
||||
),
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
@@ -454,7 +456,7 @@ class TestItemBox extends StatelessWidget {
|
||||
content: Text(
|
||||
'Are you sure for reject this test?'),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
await Provider.of<TestResultsProvider>(
|
||||
context)
|
||||
@@ -471,7 +473,7 @@ class TestItemBox extends StatelessWidget {
|
||||
},
|
||||
child: Text('Yes'),
|
||||
),
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
|
||||
+108
-105
@@ -1,11 +1,12 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:cssd/providers/auth.dart';
|
||||
import 'package:cssd/providers/connectivity.dart';
|
||||
import 'package:cssd/widgets/Global/internet_error.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../config/routes.dart';
|
||||
import '../providers/auth.dart';
|
||||
import '../providers/connectivity.dart';
|
||||
import '../widgets/Global/internet_error.dart';
|
||||
|
||||
class VerifyPassScreen extends StatefulWidget {
|
||||
// static const route = '/HomeScreen';
|
||||
|
||||
@@ -38,7 +39,7 @@ class _VerifyPassScreenState extends State<VerifyPassScreen> {
|
||||
title: Text('Error'),
|
||||
content: Text(message),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text('Ok'),
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
@@ -85,108 +86,110 @@ class _VerifyPassScreenState extends State<VerifyPassScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('CSSD'),
|
||||
),
|
||||
body: Selector<ConnectivityProvider, String>(
|
||||
builder: (ctx, value, _) => value != 'offline'
|
||||
? _isLoading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Text(
|
||||
'Send Verification Code',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Code is required.';
|
||||
}
|
||||
if (value.length != 6) {
|
||||
return 'Code most be 6 characters';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: codeCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Code',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
horizontal: 3,
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
onSaved: (value) {
|
||||
codeCTRL.text = value;
|
||||
},
|
||||
maxLength: 6,
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _sendCode(),
|
||||
child: Container(
|
||||
width: 40 * _deviceBlockSize,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Text(
|
||||
'Send Code',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('CSSD'),
|
||||
),
|
||||
body: Selector<ConnectivityProvider, String>(
|
||||
builder: (ctx, value, _) => value != 'offline'
|
||||
? _isLoading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Text(
|
||||
'Send Verification Code',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox(),
|
||||
selector: (_, connectivity) => connectivity.conStatus,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Code is required.';
|
||||
}
|
||||
if (value.length != 6) {
|
||||
return 'Code most be 6 characters';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: codeCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Code',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
horizontal: 3,
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
onSaved: (value) {
|
||||
codeCTRL.text = value;
|
||||
},
|
||||
maxLength: 6,
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _sendCode(),
|
||||
child: Container(
|
||||
width: 40 * _deviceBlockSize,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Text(
|
||||
'Send Code',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox(),
|
||||
selector: (_, connectivity) => connectivity.conStatus,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:cssd/config/user.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cssd/config/urls.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../config/urls.dart';
|
||||
import '../config/user.dart';
|
||||
|
||||
class Auth with ChangeNotifier {
|
||||
String _token;
|
||||
DateTime _expiaryDate;
|
||||
@@ -32,7 +33,7 @@ class Auth with ChangeNotifier {
|
||||
|
||||
Future<String> requestCode(String cellNumber) async {
|
||||
final response = await http.post(
|
||||
Url.requestResetPass,
|
||||
Uri.parse(Url.requestResetPass),
|
||||
body: {
|
||||
'cell_number': cellNumber,
|
||||
},
|
||||
@@ -49,7 +50,7 @@ class Auth with ChangeNotifier {
|
||||
|
||||
Future<String> sendCode(String code) async {
|
||||
final response = await http.post(
|
||||
Url.verifyResetPass,
|
||||
Uri.parse(Url.verifyResetPass),
|
||||
body: {
|
||||
'code': code,
|
||||
},
|
||||
@@ -74,7 +75,7 @@ class Auth with ChangeNotifier {
|
||||
print(token);
|
||||
|
||||
final response = await http.post(
|
||||
Url.sendResetPass,
|
||||
Uri.parse(Url.sendResetPass),
|
||||
body: {
|
||||
'password': password,
|
||||
'password_confirmation': password,
|
||||
@@ -98,7 +99,7 @@ class Auth with ChangeNotifier {
|
||||
|
||||
Future<String> login(String cellNumber, String password) async {
|
||||
final response = await http.post(
|
||||
Url.login,
|
||||
Uri.parse(Url.login),
|
||||
body: {
|
||||
'cell_number': cellNumber,
|
||||
'password': password,
|
||||
@@ -160,7 +161,7 @@ class Auth with ChangeNotifier {
|
||||
|
||||
Future<Map<String, dynamic>> getUserData() async {
|
||||
final response = await http.get(
|
||||
Url.getUserInfo,
|
||||
Uri.parse(Url.getUserInfo),
|
||||
headers: {'Authorization': 'Bearer ' + token},
|
||||
);
|
||||
// print(response.body);
|
||||
@@ -188,7 +189,7 @@ class Auth with ChangeNotifier {
|
||||
|
||||
Future<void> setUserData(id, name, email) async {
|
||||
var response = await http.post(
|
||||
'https://cssd-doc.com/api/UpdateInfo',
|
||||
Uri.parse('https://cssd-doc.com/api/UpdateInfo'),
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + token,
|
||||
HttpHeaders.contentTypeHeader: 'application/json',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:cssd/config/urls.dart';
|
||||
import 'package:cssd/config/user.dart';
|
||||
import 'package:cssd/models/cycles_models.dart';
|
||||
import '../config/urls.dart';
|
||||
import '../config/user.dart';
|
||||
import '../models/cycles_models.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
@@ -61,7 +61,7 @@ class CyclesProvider extends ChangeNotifier {
|
||||
|
||||
Future<List<Map<String, String>>> getHospitalsFilters() async {
|
||||
var response = await http.get(
|
||||
Url.filterItems,
|
||||
Uri.parse(Url.filterItems),
|
||||
headers: {
|
||||
'Authorization': User.token,
|
||||
},
|
||||
@@ -80,7 +80,7 @@ class CyclesProvider extends ChangeNotifier {
|
||||
|
||||
Future<List<String>> getLabelFilters() async {
|
||||
var response = await http.get(
|
||||
Url.labelItems,
|
||||
Uri.parse(Url.labelItems),
|
||||
headers: {
|
||||
'Authorization': User.token,
|
||||
},
|
||||
@@ -107,7 +107,7 @@ class CyclesProvider extends ChangeNotifier {
|
||||
labs.add({'name': '', 'id': label});
|
||||
}
|
||||
// print(labs);
|
||||
var response = await http.post(Url.createCycleResult,
|
||||
var response = await http.post(Uri.parse(Url.createCycleResult),
|
||||
body: json.encode(
|
||||
{
|
||||
'note': note,
|
||||
@@ -181,7 +181,7 @@ class CyclesProvider extends ChangeNotifier {
|
||||
}
|
||||
// print(url);
|
||||
var response = await http.get(
|
||||
url,
|
||||
Uri.parse(url),
|
||||
headers: {
|
||||
'Authorization': User.token,
|
||||
},
|
||||
@@ -214,7 +214,7 @@ class CyclesProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<CycleDetailObject> showCycleResult(String id) async {
|
||||
var response = await http.get(Url.getCycleResult(id), headers: {
|
||||
var response = await http.get(Uri.parse(Url.getCycleResult(id)), headers: {
|
||||
'Authorization': User.token,
|
||||
});
|
||||
if (response.statusCode != 200) {
|
||||
|
||||
@@ -2,8 +2,9 @@ import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:cssd/config/urls.dart';
|
||||
import 'package:cssd/config/user.dart';
|
||||
|
||||
import '../config/urls.dart';
|
||||
import '../config/user.dart';
|
||||
|
||||
class Inputs with ChangeNotifier {
|
||||
List<Map<String, dynamic>> inputItems = [];
|
||||
@@ -22,7 +23,7 @@ class Inputs with ChangeNotifier {
|
||||
// },
|
||||
// );
|
||||
var response = await http.post(
|
||||
Url.getInputs,
|
||||
Uri.parse(Url.getInputs),
|
||||
body: {
|
||||
'test_type_id': testTypeId,
|
||||
'test_result_id': testResultId,
|
||||
@@ -47,7 +48,7 @@ class Inputs with ChangeNotifier {
|
||||
// }
|
||||
Map<String, dynamic> values;
|
||||
if (testResultId.isNotEmpty) {
|
||||
response = await http.get(Url.testResultFormValues(testResultId),
|
||||
response = await http.get(Uri.parse(Url.testResultFormValues(testResultId)),
|
||||
headers: {'Authorization': User.token});
|
||||
values = json.decode(response.body)['data'];
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:cssd/config/urls.dart';
|
||||
import 'package:cssd/config/user.dart';
|
||||
import 'package:cssd/models/label_models.dart';
|
||||
import '../config/urls.dart';
|
||||
import '../config/user.dart';
|
||||
import '../models/label_models.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
@@ -34,7 +34,7 @@ class LabelsProvider extends ChangeNotifier {
|
||||
|
||||
Future<List<Map<String, String>>> getHospitalsFilters() async {
|
||||
var response = await http.get(
|
||||
Url.filterItems,
|
||||
Uri.parse(Url.filterItems),
|
||||
headers: {
|
||||
'Authorization': User.token,
|
||||
},
|
||||
@@ -53,7 +53,7 @@ class LabelsProvider extends ChangeNotifier {
|
||||
|
||||
Future<List<Map<String, String>>> getPackageFilters() async {
|
||||
var response = await http.get(
|
||||
Url.packageItems,
|
||||
Uri.parse(Url.packageItems),
|
||||
headers: {
|
||||
'Authorization': User.token,
|
||||
},
|
||||
@@ -77,7 +77,7 @@ class LabelsProvider extends ChangeNotifier {
|
||||
Future<void> createLabelResult(lotNumber, cycleNumber, sterileDate, package,
|
||||
expireDate, sterilizerId) async {
|
||||
// print(labs);
|
||||
var response = await http.post(Url.createLabelResult,
|
||||
var response = await http.post(Uri.parse(Url.createLabelResult),
|
||||
body: json.encode(
|
||||
{
|
||||
'sterile_date': sterileDate,
|
||||
@@ -112,7 +112,7 @@ class LabelsProvider extends ChangeNotifier {
|
||||
sterilizerId,
|
||||
) async {
|
||||
// print(labs);
|
||||
var response = await http.put(Url.updateLabelResult(id),
|
||||
var response = await http.put(Uri.parse(Url.updateLabelResult(id)),
|
||||
body: json.encode(
|
||||
{
|
||||
'sterile_date': sterileDate,
|
||||
@@ -187,7 +187,7 @@ class LabelsProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
var response = await http.get(
|
||||
url,
|
||||
Uri.parse(url),
|
||||
headers: {
|
||||
'Authorization': User.token,
|
||||
},
|
||||
@@ -216,7 +216,7 @@ class LabelsProvider extends ChangeNotifier {
|
||||
|
||||
Future<LabelDetailsObject> showLabelResult(String id) async {
|
||||
var response = await http.get(
|
||||
Url.getLabelResult(id),
|
||||
Uri.parse(Url.getLabelResult(id)),
|
||||
headers: {
|
||||
'Authorization': User.token,
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:cssd/config/urls.dart';
|
||||
import '../config/urls.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
@@ -28,7 +28,7 @@ class MyInfoProvider extends ChangeNotifier {
|
||||
final auth = json.decode(prefs.getString('auth')) as Map<String, Object>;
|
||||
_token = auth['token'];
|
||||
final response = await http.get(
|
||||
Url.getUserInfo,
|
||||
Uri.parse(Url.getUserInfo),
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + _token,
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:cssd/config/urls.dart';
|
||||
import 'package:cssd/config/user.dart';
|
||||
import '../config/urls.dart';
|
||||
import '../config/user.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
@@ -24,7 +24,7 @@ class TestResult with ChangeNotifier{
|
||||
|
||||
Future<void> toggleVerify() async {
|
||||
final response = await http.post(
|
||||
Url.verifyTest(id), headers: {
|
||||
Uri.parse(Url.verifyTest(id)), headers: {
|
||||
'Authorization': User.token
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
// import 'dart:typed_data';
|
||||
import 'package:dio/dio.dart' as di;
|
||||
@@ -7,6 +6,7 @@ import 'package:dio/dio.dart' as di;
|
||||
import 'package:cssd/config/urls.dart';
|
||||
import 'package:cssd/config/user.dart';
|
||||
import 'package:cssd/models/test_result_models.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
// import 'package:cssd/providers/test_result.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
@@ -14,13 +14,13 @@ import 'package:random_string/random_string.dart';
|
||||
// import 'package:multi_image_picker/multi_image_picker.dart';
|
||||
|
||||
class TestResultsProvider with ChangeNotifier {
|
||||
List<File> catchImages = [];
|
||||
List<PlatformFile> catchImages = [];
|
||||
List<Uint8List> images = [];
|
||||
|
||||
setImages() async {
|
||||
images = [];
|
||||
for (var image in catchImages) {
|
||||
var result = image.readAsBytesSync();
|
||||
var result = image.bytes;
|
||||
// final batchId = randomString(10);
|
||||
// addImage(batchId, result, image.path);
|
||||
images.add(result.buffer
|
||||
@@ -29,7 +29,7 @@ class TestResultsProvider with ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
setCatchImages(List<File> images) {
|
||||
setCatchImages(List<PlatformFile> images) {
|
||||
catchImages = images;
|
||||
notifyListeners();
|
||||
}
|
||||
@@ -136,7 +136,7 @@ class TestResultsProvider with ChangeNotifier {
|
||||
|
||||
Future<List<Map<String, String>>> getFilterItems() async {
|
||||
var response = await http.get(
|
||||
Url.filterItems,
|
||||
Uri.parse(Url.filterItems),
|
||||
headers: {
|
||||
'Authorization': User.token,
|
||||
},
|
||||
@@ -187,7 +187,7 @@ class TestResultsProvider with ChangeNotifier {
|
||||
}
|
||||
//'device_id=3526&testType_id=107&medicalCenter_id=2&user_name=erfan&fromPicker=2020-05-12&upToPicker=2020-05-19&device_label=Instrument%20ID&page=1'
|
||||
var response = await http.get(
|
||||
url,
|
||||
Uri.parse(url),
|
||||
headers: {
|
||||
'Authorization': User.token,
|
||||
// 'X-Requested-With': 'XMLHttpRequest',
|
||||
@@ -221,7 +221,7 @@ class TestResultsProvider with ChangeNotifier {
|
||||
|
||||
static Future<void> updateTestResult(String id, values) async {
|
||||
var response = await http.post(
|
||||
Url.updateTestResult(id),
|
||||
Uri.parse(Url.updateTestResult(id)),
|
||||
body: json.encode(values),
|
||||
headers: {
|
||||
'Authorization': User.token,
|
||||
@@ -262,7 +262,7 @@ class TestResultsProvider with ChangeNotifier {
|
||||
final batchId = randomString(10);
|
||||
|
||||
for (var image in catchImages) {
|
||||
await addImage(batchId, image.readAsBytesSync(), image.path);
|
||||
await addImage(batchId, image.bytes, image.path);
|
||||
}
|
||||
dynamic vals = values;
|
||||
vals['file_batch_id'] = batchId;
|
||||
@@ -305,7 +305,7 @@ class TestResultsProvider with ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> showTestResult(String id) async {
|
||||
var response = await http.get(Url.getTestResult(id), headers: {
|
||||
var response = await http.get(Uri.parse(Url.getTestResult(id)), headers: {
|
||||
'Authorization': User.token,
|
||||
});
|
||||
|
||||
@@ -333,7 +333,7 @@ class TestResultsProvider with ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<bool> removeTestResult(String id) async {
|
||||
var response = await http.post(Url.removeTestResult(id), body: {
|
||||
var response = await http.post(Uri.parse(Url.removeTestResult(id)), body: {
|
||||
'_method': 'delete'
|
||||
}, headers: {
|
||||
'Authorization': User.token,
|
||||
@@ -353,7 +353,7 @@ class TestResultsProvider with ChangeNotifier {
|
||||
print(id);
|
||||
print(value);
|
||||
var response = await http.post(
|
||||
Url.testResultVerification(id, value),
|
||||
Uri.parse(Url.testResultVerification(id, value)),
|
||||
headers: {
|
||||
'Authorization': User.token,
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import 'package:barcode_scan/barcode_scan.dart';
|
||||
import 'package:barcode_scan2/barcode_scan2.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cssd/providers/cycles.dart';
|
||||
|
||||
import '../../../providers/cycles.dart';
|
||||
|
||||
class CycleAddLabelBox extends StatelessWidget {
|
||||
const CycleAddLabelBox({
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cssd/providers/cycles.dart';
|
||||
|
||||
import '../../../config/routes.dart';
|
||||
import '../../../providers/cycles.dart';
|
||||
|
||||
class CycleAddSaveButton extends StatelessWidget {
|
||||
const CycleAddSaveButton({
|
||||
@@ -49,7 +50,7 @@ class CycleAddSaveButton extends StatelessWidget {
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text('Cycle added.'),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cssd/providers/cycles.dart';
|
||||
|
||||
import '../../../config/routes.dart';
|
||||
import '../../../providers/cycles.dart';
|
||||
|
||||
class CycleFilterSaveButton extends StatelessWidget {
|
||||
const CycleFilterSaveButton({
|
||||
@@ -48,7 +49,7 @@ class CycleFilterSaveButton extends StatelessWidget {
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text('Filters changed.'),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import '../../../config/routes.dart';
|
||||
|
||||
class CycleResultBanner extends StatelessWidget {
|
||||
const CycleResultBanner({
|
||||
Key key,
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
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';
|
||||
|
||||
import '../../../config/routes.dart';
|
||||
import '../../../models/cycles_models.dart';
|
||||
|
||||
class CycleItemBox extends StatelessWidget {
|
||||
final CycleResultObject item;
|
||||
final String labels;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
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';
|
||||
|
||||
import '../../../config/routes.dart';
|
||||
import '../../../providers/cycles.dart';
|
||||
|
||||
class CycleFilterBaner extends StatelessWidget {
|
||||
const CycleFilterBaner({
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
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';
|
||||
|
||||
import '../../../providers/cycles.dart';
|
||||
class CycleResultSearchBox extends StatelessWidget {
|
||||
const CycleResultSearchBox({
|
||||
Key key,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
// import 'package:cssd/pages/test_result_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import '../../config/routes.dart';
|
||||
|
||||
class AppDrawer extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cssd/providers/labels.dart';
|
||||
|
||||
import '../../../config/routes.dart';
|
||||
import '../../../providers/labels.dart';
|
||||
|
||||
class LabelAddSaveButton extends StatelessWidget {
|
||||
const LabelAddSaveButton({
|
||||
@@ -49,7 +50,7 @@ class LabelAddSaveButton extends StatelessWidget {
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text('Label added.'),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import '../../../config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cssd/providers/labels.dart';
|
||||
import '../../../providers/labels.dart';
|
||||
|
||||
class LabelUpdateButton extends StatelessWidget {
|
||||
const LabelUpdateButton({
|
||||
@@ -52,7 +52,7 @@ class LabelUpdateButton extends StatelessWidget {
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text('Label updated.'),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cssd/providers/labels.dart';
|
||||
|
||||
import '../../../config/routes.dart';
|
||||
import '../../../providers/labels.dart';
|
||||
|
||||
class LabelFilterSaveButton extends StatelessWidget {
|
||||
const LabelFilterSaveButton({
|
||||
@@ -45,7 +46,7 @@ class LabelFilterSaveButton extends StatelessWidget {
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text('Filters changed.'),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:cssd/models/label_models.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import '../../../config/routes.dart';
|
||||
import '../../../models/label_models.dart';
|
||||
|
||||
class LabelItemBox extends StatelessWidget {
|
||||
final LabelResultObject item;
|
||||
const LabelItemBox({
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../providers/labels.dart';
|
||||
class LabelFilterChip extends StatelessWidget {
|
||||
const LabelFilterChip({
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import '../../../config/routes.dart';
|
||||
|
||||
class LabelFloatingButtons extends StatelessWidget {
|
||||
const LabelFloatingButtons({
|
||||
Key key,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../providers/labels.dart';
|
||||
|
||||
class LabelSearchBox extends StatelessWidget {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:barcode_scan/barcode_scan.dart';
|
||||
import 'package:barcode_scan2/barcode_scan2.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
@@ -2,11 +2,13 @@ import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:camera/camera.dart';
|
||||
import 'package:cssd/providers/test_results.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../providers/test_results.dart';
|
||||
|
||||
class CaptureImage extends StatefulWidget {
|
||||
@override
|
||||
_CaptureImageState createState() {
|
||||
@@ -201,7 +203,7 @@ class _CaptureImageState extends State<CaptureImage>
|
||||
// }
|
||||
// }
|
||||
|
||||
// return Row(children: toggles);
|
||||
// return Row(children: toggles);
|
||||
// }
|
||||
|
||||
String timestamp() => DateTime.now().millisecondsSinceEpoch.toString();
|
||||
@@ -247,8 +249,13 @@ class _CaptureImageState extends State<CaptureImage>
|
||||
imagePath = filePath;
|
||||
var profileProviderObject =
|
||||
Provider.of<TestResultsProvider>(context, listen: false);
|
||||
List<File> files = profileProviderObject.catchImages;
|
||||
files.add(File(imagePath));
|
||||
List<PlatformFile> files = profileProviderObject.catchImages;
|
||||
print(imagePath);
|
||||
files.add(PlatformFile(
|
||||
name: 'test',
|
||||
size: 0,
|
||||
path: imagePath,
|
||||
bytes: File(imagePath).readAsBytesSync()));
|
||||
profileProviderObject.setCatchImages(files);
|
||||
profileProviderObject.setImages();
|
||||
print(imagePath);
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:barcode_scan/barcode_scan.dart';
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:barcode_scan2/barcode_scan2.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
@@ -12,6 +9,7 @@ import 'package:meta/meta.dart';
|
||||
import 'package:multiselect_formfield/multiselect_formfield.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../config/routes.dart';
|
||||
import '../../../providers/test_results.dart';
|
||||
|
||||
class FormCreator extends StatefulWidget {
|
||||
@@ -528,7 +526,7 @@ class _FormCreatorState extends State<FormCreator> {
|
||||
Future captureImage(BuildContext context) async {
|
||||
var profileProviderObject =
|
||||
Provider.of<TestResultsProvider>(context, listen: false);
|
||||
List<File> files = profileProviderObject.catchImages;
|
||||
List<PlatformFile> files = profileProviderObject.catchImages;
|
||||
try {
|
||||
files.add(
|
||||
await ImagePickerGC.pickImage(
|
||||
@@ -552,12 +550,17 @@ class _FormCreatorState extends State<FormCreator> {
|
||||
Future<void> loadAssets(BuildContext context) async {
|
||||
var profileProviderObject =
|
||||
Provider.of<TestResultsProvider>(context, listen: false);
|
||||
List<File> files = profileProviderObject.catchImages;
|
||||
List<PlatformFile> files = profileProviderObject.catchImages;
|
||||
try {
|
||||
files += await FilePicker.getMultiFile(
|
||||
var datas = await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowedExtensions: ['jpg', 'png', 'bmp', 'jpeg', 'pdf', 'docx', 'doc'],
|
||||
withData: true,
|
||||
withReadStream: true,
|
||||
);
|
||||
files += datas.files;
|
||||
// files +=
|
||||
|
||||
// print(files);
|
||||
} catch (_) {}
|
||||
|
||||
@@ -632,8 +635,9 @@ class ImageBox extends StatelessWidget {
|
||||
builder: (_) => Container(
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: Image.file(
|
||||
_testProvider.catchImages[index],
|
||||
child: Image.memory(
|
||||
_testProvider.catchImages[index].bytes,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -653,12 +657,12 @@ class ImageBox extends StatelessWidget {
|
||||
height: 60,
|
||||
fit: BoxFit.fill,
|
||||
)
|
||||
: Image.file(
|
||||
_testProvider.catchImages[index],
|
||||
: Image.memory(
|
||||
_testProvider.catchImages[index].bytes,
|
||||
// asset: _images[index],
|
||||
width: 60,
|
||||
height: 60,
|
||||
fit: BoxFit.fill,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../config/routes.dart';
|
||||
|
||||
class TestResultAddSaveButton extends StatelessWidget {
|
||||
const TestResultAddSaveButton({
|
||||
Key key,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../config/routes.dart';
|
||||
|
||||
class TestResultAddButton extends StatelessWidget {
|
||||
const TestResultAddButton({
|
||||
Key key,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../providers/test_results.dart';
|
||||
|
||||
class TestResultChip extends StatelessWidget {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import '../../../config/routes.dart';
|
||||
|
||||
// class TestResultFloatingButton extends StatelessWidget {
|
||||
// const TestResultFloatingButton({
|
||||
// Key key,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user