mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-12 18:38:55 +03:30
1.7.0
This commit is contained in:
@@ -20,7 +20,6 @@ class _ForgetPassScreenState extends State<ForgetPassScreen> {
|
|||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
final cellNumberController = TextEditingController();
|
final cellNumberController = TextEditingController();
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
cellNumberController.text = '';
|
cellNumberController.text = '';
|
||||||
@@ -59,7 +58,7 @@ class _ForgetPassScreenState extends State<ForgetPassScreen> {
|
|||||||
_isLoading = true;
|
_isLoading = true;
|
||||||
});
|
});
|
||||||
// try {
|
// try {
|
||||||
await Provider.of<Auth>(context)
|
await Provider.of<Auth>(context, listen: false)
|
||||||
.requestCode(
|
.requestCode(
|
||||||
cellNumberController.text,
|
cellNumberController.text,
|
||||||
)
|
)
|
||||||
@@ -72,7 +71,7 @@ class _ForgetPassScreenState extends State<ForgetPassScreen> {
|
|||||||
_isLoading = false;
|
_isLoading = false;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else{
|
} else {
|
||||||
// _showDialog('User or password incorrect!');
|
// _showDialog('User or password incorrect!');
|
||||||
Navigator.of(context).popAndPushNamed(Routes.sendCodeScreen);
|
Navigator.of(context).popAndPushNamed(Routes.sendCodeScreen);
|
||||||
// setState(
|
// setState(
|
||||||
@@ -153,7 +152,6 @@ class _ForgetPassScreenState extends State<ForgetPassScreen> {
|
|||||||
),
|
),
|
||||||
keyboardType: TextInputType.phone,
|
keyboardType: TextInputType.phone,
|
||||||
textInputAction: TextInputAction.next,
|
textInputAction: TextInputAction.next,
|
||||||
|
|
||||||
onSaved: (value) {
|
onSaved: (value) {
|
||||||
cellNumberController.text = value;
|
cellNumberController.text = value;
|
||||||
},
|
},
|
||||||
|
|||||||
+229
-29
@@ -1,7 +1,10 @@
|
|||||||
|
import 'package:barcode_scan/platform_wrapper.dart';
|
||||||
import 'package:double_back_to_close_app/double_back_to_close_app.dart';
|
import 'package:double_back_to_close_app/double_back_to_close_app.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_phoenix/flutter_phoenix.dart';
|
import 'package:flutter_phoenix/flutter_phoenix.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import './my_info_screen.dart';
|
import './my_info_screen.dart';
|
||||||
import '../providers/auth.dart';
|
import '../providers/auth.dart';
|
||||||
@@ -19,7 +22,8 @@ class HomePage extends StatelessWidget {
|
|||||||
// static const route = '/HomeScreen';
|
// static const route = '/HomeScreen';
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final userData = Provider.of<Auth>(context,listen: false).user;
|
final userData = Provider.of<Auth>(context, listen: false).user;
|
||||||
|
|
||||||
// print(userData['roles']);
|
// print(userData['roles']);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomPadding: false,
|
resizeToAvoidBottomPadding: false,
|
||||||
@@ -53,7 +57,7 @@ class HomePage extends StatelessWidget {
|
|||||||
child: Text('Yes'),
|
child: Text('Yes'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(ctx).pop();
|
Navigator.of(ctx).pop();
|
||||||
Provider.of<Auth>(context).logout();
|
Provider.of<Auth>(context, listen: false).logout();
|
||||||
Phoenix.rebirth(context);
|
Phoenix.rebirth(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -106,35 +110,75 @@ class HomePage extends StatelessWidget {
|
|||||||
endColor: Color(0xFFFFECD2),
|
endColor: Color(0xFFFFECD2),
|
||||||
firstLine: 'My INFO',
|
firstLine: 'My INFO',
|
||||||
secondLine: 'List, Details & Add a one',
|
secondLine: 'List, Details & Add a one',
|
||||||
onTap: Consumer<Auth>(
|
onTap: () => Navigator.push(
|
||||||
builder: (ctx, auth, _) {
|
context,
|
||||||
return MyInfoScreen();
|
MaterialPageRoute(
|
||||||
},
|
builder: (context) {
|
||||||
|
return Consumer<Auth>(
|
||||||
|
builder: (ctx, auth, _) {
|
||||||
|
return MyInfoScreen();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SelectionItem(
|
SelectionItem(
|
||||||
startColor: Color(0xFFD5F5FD),
|
startColor: Color(0xFFD5F5FD),
|
||||||
endColor: Color(0xFFE9FFF7),
|
endColor: Color(0xFFE9FFF7),
|
||||||
firstLine: 'TEST RESULTS',
|
firstLine: 'TEST RESULTS',
|
||||||
secondLine: 'List, Details & Add a one',
|
secondLine: 'List, Details & Add a one',
|
||||||
onTap: TestResultScreen()
|
onTap: () => Navigator.push(
|
||||||
// MyTestResult(
|
context,
|
||||||
// isAdmin: false,
|
MaterialPageRoute(
|
||||||
// ),
|
builder: (context) {
|
||||||
|
return Consumer<Auth>(
|
||||||
|
builder: (ctx, auth, _) {
|
||||||
|
return TestResultScreen();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
// MyTestResult(
|
||||||
|
// isAdmin: false,
|
||||||
|
// ),
|
||||||
|
),
|
||||||
SelectionItem(
|
SelectionItem(
|
||||||
startColor: Color(0xFFE2D2C4),
|
startColor: Color(0xFFE2D2C4),
|
||||||
endColor: Color(0xFFFAF7F5),
|
endColor: Color(0xFFFAF7F5),
|
||||||
firstLine: 'LABELS',
|
firstLine: 'LABELS',
|
||||||
secondLine: 'List, Details & Add a one',
|
secondLine: 'List, Details & Add a one',
|
||||||
onTap: LabelResultScreen(),
|
onTap: () => Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) {
|
||||||
|
return Consumer<Auth>(
|
||||||
|
builder: (ctx, auth, _) {
|
||||||
|
return LabelResultScreen();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
SelectionItem(
|
SelectionItem(
|
||||||
startColor: Color(0xFFA7CCE1),
|
startColor: Color(0xFFA7CCE1),
|
||||||
endColor: Color(0xFFECF7ED),
|
endColor: Color(0xFFECF7ED),
|
||||||
firstLine: 'CYCLES',
|
firstLine: 'CYCLES',
|
||||||
secondLine: 'List, Details & Add a one',
|
secondLine: 'List, Details & Add a one',
|
||||||
onTap: CycleResultScreen(),
|
onTap: () => Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) {
|
||||||
|
return Consumer<Auth>(
|
||||||
|
builder: (ctx, auth, _) {
|
||||||
|
return CycleResultScreen();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
// SelectionItem(
|
// SelectionItem(
|
||||||
// startColor: Color(0xFFA7CCE1),
|
// startColor: Color(0xFFA7CCE1),
|
||||||
@@ -149,9 +193,21 @@ class HomePage extends StatelessWidget {
|
|||||||
startColor: Color(0xFFA7CCE1),
|
startColor: Color(0xFFA7CCE1),
|
||||||
endColor: Color(0xFFECF7ED),
|
endColor: Color(0xFFECF7ED),
|
||||||
firstLine: 'TEST TO VERIFY',
|
firstLine: 'TEST TO VERIFY',
|
||||||
secondLine: 'List, Details & Add a one',
|
secondLine: 'Verify and reject Test Results',
|
||||||
onTap: TestVerifyScreen(),
|
onTap: () => Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) {
|
||||||
|
return Consumer<Auth>(
|
||||||
|
builder: (ctx, auth, _) {
|
||||||
|
return TestVerifyScreen();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
BarcodeSelectionItem(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -163,12 +219,33 @@ class HomePage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<String> scan() async {
|
||||||
|
try {
|
||||||
|
var barcode = await BarcodeScanner.scan();
|
||||||
|
if (barcode.type.name == 'Cancelled') {
|
||||||
|
return 'cancel';
|
||||||
|
} else if (barcode.type.name == 'Failed') {
|
||||||
|
return 'error';
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
var id = barcode.rawContent;
|
||||||
|
return id;
|
||||||
|
} catch (_) {
|
||||||
|
return 'null';
|
||||||
|
}
|
||||||
|
} on PlatformException catch (_) {
|
||||||
|
return 'access';
|
||||||
|
} catch (_) {
|
||||||
|
return 'error';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class SelectionItem extends StatelessWidget {
|
class SelectionItem extends StatelessWidget {
|
||||||
final Color startColor;
|
final Color startColor;
|
||||||
final Color endColor;
|
final Color endColor;
|
||||||
final String firstLine;
|
final String firstLine;
|
||||||
final String secondLine;
|
final String secondLine;
|
||||||
final Widget onTap;
|
final Function onTap;
|
||||||
|
|
||||||
SelectionItem(
|
SelectionItem(
|
||||||
{this.startColor,
|
{this.startColor,
|
||||||
@@ -196,16 +273,7 @@ class SelectionItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
splashColor: Colors.red,
|
splashColor: Colors.red,
|
||||||
onTap: () {
|
onTap: onTap,
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) {
|
|
||||||
return onTap;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Column(
|
title: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@@ -258,3 +326,135 @@ class SelectionItem extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class BarcodeSelectionItem extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final _media = MediaQuery.of(context);
|
||||||
|
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||||
|
final double _devicewidth = _media.size.width;
|
||||||
|
final double _deviceBlockSize = _devicewidth / 100;
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 10),
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 5),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [Colors.black, Colors.black87],
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(3),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: InkWell(
|
||||||
|
splashColor: Colors.red,
|
||||||
|
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);
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
child: AlertDialog(
|
||||||
|
title: Text(
|
||||||
|
'نتیجه ی اسکن',
|
||||||
|
textDirection: TextDirection.rtl,
|
||||||
|
textAlign: TextAlign.right,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 2.75 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
content: Text(
|
||||||
|
result,
|
||||||
|
textDirection: TextDirection.rtl,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 4 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
FlatButton(
|
||||||
|
onPressed: () async {
|
||||||
|
await launch(result);
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
'بازکردن در مرورگر',
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily: 'montserrat',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
child: ListTile(
|
||||||
|
title: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.qr_code_scanner,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 8 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 2 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
'SCANNER',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 5 * _deviceBlockSize,
|
||||||
|
letterSpacing: 3.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Scan a Bar or QR code',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 3.5 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
trailing: Icon(
|
||||||
|
Icons.arrow_forward_ios,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Column(
|
||||||
|
// children: <Widget>[
|
||||||
|
// ListTile(
|
||||||
|
// title: Text(
|
||||||
|
// firstLine,
|
||||||
|
// textAlign: TextAlign.start,
|
||||||
|
// style: TextStyle(color: Colors.black),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ListTile(
|
||||||
|
// title: Text(
|
||||||
|
// secondLine,
|
||||||
|
// style: TextStyle(color: Colors.black, fontSize: 20),
|
||||||
|
// ),
|
||||||
|
// trailing: Icon(
|
||||||
|
// Icons.arrow_forward_ios,
|
||||||
|
// color: Colors.black,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
_isLoading = true;
|
_isLoading = true;
|
||||||
});
|
});
|
||||||
// try {
|
// try {
|
||||||
await Provider.of<Auth>(context)
|
await Provider.of<Auth>(context, listen: false)
|
||||||
.login(
|
.login(
|
||||||
map['cellNumber'],
|
map['cellNumber'],
|
||||||
map['password'],
|
map['password'],
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class _RePassScreenState extends State<RePassScreen> {
|
|||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _showDialog(String message) async{
|
Future<void> _showDialog(String message) async {
|
||||||
await showDialog(
|
await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (ctx) => AlertDialog(
|
builder: (ctx) => AlertDialog(
|
||||||
@@ -62,11 +62,12 @@ class _RePassScreenState extends State<RePassScreen> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_isLoading = true;
|
_isLoading = true;
|
||||||
});
|
});
|
||||||
await Provider.of<Auth>(context)
|
await Provider.of<Auth>(context, listen: false)
|
||||||
.sendRePass(passwordController.text, token)
|
.sendRePass(passwordController.text, token)
|
||||||
.then((value) async{
|
.then((value) async {
|
||||||
if (value == 'done') {
|
if (value == 'done') {
|
||||||
await _showDialog('Password changed successfully.Now login to your account.');
|
await _showDialog(
|
||||||
|
'Password changed successfully.Now login to your account.');
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class _FormPageState extends State<FormPage> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_isLoading = true;
|
_isLoading = true;
|
||||||
});
|
});
|
||||||
Provider.of<Inputs>(context)
|
Provider.of<Inputs>(context, listen: false)
|
||||||
.getInputs(
|
.getInputs(
|
||||||
testResultId: this.widget.testResultId ?? "",
|
testResultId: this.widget.testResultId ?? "",
|
||||||
name: this.widget.name ?? "",
|
name: this.widget.name ?? "",
|
||||||
@@ -186,6 +186,6 @@ class _FormPageState extends State<FormPage> {
|
|||||||
formatData(input['children']);
|
formatData(input['children']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print(values);
|
// print(values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ class _VerifyPassScreenState extends State<VerifyPassScreen> {
|
|||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
final codeCTRL = TextEditingController();
|
final codeCTRL = TextEditingController();
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
codeCTRL.text = '';
|
codeCTRL.text = '';
|
||||||
@@ -59,7 +58,7 @@ class _VerifyPassScreenState extends State<VerifyPassScreen> {
|
|||||||
_isLoading = true;
|
_isLoading = true;
|
||||||
});
|
});
|
||||||
// try {
|
// try {
|
||||||
await Provider.of<Auth>(context)
|
await Provider.of<Auth>(context, listen: false)
|
||||||
.sendCode(
|
.sendCode(
|
||||||
codeCTRL.text,
|
codeCTRL.text,
|
||||||
)
|
)
|
||||||
|
|||||||
+6
-12
@@ -62,12 +62,10 @@ class Auth with ChangeNotifier {
|
|||||||
// return 'Done';
|
// return 'Done';
|
||||||
// }
|
// }
|
||||||
print(responseData);
|
print(responseData);
|
||||||
if (responseData['status']=='Faild') {
|
if (responseData['status'] == 'Faild') {
|
||||||
return 'wrong';
|
return 'wrong';
|
||||||
}
|
} else {
|
||||||
else{
|
return responseData['access_token'];
|
||||||
return responseData['access_token'];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,10 +79,7 @@ class Auth with ChangeNotifier {
|
|||||||
'password': password,
|
'password': password,
|
||||||
'password_confirmation': password,
|
'password_confirmation': password,
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {'Authorization': token, 'X-Requested-With': 'XMLHttpRequest'},
|
||||||
'Authorization': token,
|
|
||||||
'X-Requested-With': 'XMLHttpRequest'
|
|
||||||
},
|
|
||||||
// headers: {'X-Requested-With': 'XMLHttpRequest'},
|
// headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||||
);
|
);
|
||||||
final responseData = json.decode(response.body);
|
final responseData = json.decode(response.body);
|
||||||
@@ -94,10 +89,9 @@ class Auth with ChangeNotifier {
|
|||||||
// return 'Done';
|
// return 'Done';
|
||||||
// }
|
// }
|
||||||
print(responseData);
|
print(responseData);
|
||||||
if (responseData['status']=='Success') {
|
if (responseData['status'] == 'Success') {
|
||||||
return 'done';
|
return 'done';
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return 'error';
|
return 'error';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-11
@@ -13,14 +13,14 @@ class Inputs with ChangeNotifier {
|
|||||||
String name = "",
|
String name = "",
|
||||||
String uniqueCode = "",
|
String uniqueCode = "",
|
||||||
String testTypeId = ""}) async {
|
String testTypeId = ""}) async {
|
||||||
print(
|
// print(
|
||||||
{
|
// {
|
||||||
'test_type_id': testTypeId,
|
// 'test_type_id': testTypeId,
|
||||||
'test_result_id': testResultId,
|
// 'test_result_id': testResultId,
|
||||||
'name': name,
|
// 'name': name,
|
||||||
'unique_code': uniqueCode,
|
// 'unique_code': uniqueCode,
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
var response = await http.post(
|
var response = await http.post(
|
||||||
Url.getInputs,
|
Url.getInputs,
|
||||||
body: {
|
body: {
|
||||||
@@ -41,8 +41,10 @@ class Inputs with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
final responseData = json.decode(response.body);
|
final responseData = json.decode(response.body);
|
||||||
|
|
||||||
// print(responseData);
|
// print(responseData['data']['inputs']);
|
||||||
|
// for (var item in responseData['data']['testType'].keys) {
|
||||||
|
// print(item);
|
||||||
|
// }
|
||||||
Map<String, dynamic> values;
|
Map<String, dynamic> values;
|
||||||
if (testResultId.isNotEmpty) {
|
if (testResultId.isNotEmpty) {
|
||||||
response = await http.get(Url.testResultFormValues(testResultId),
|
response = await http.get(Url.testResultFormValues(testResultId),
|
||||||
@@ -72,11 +74,12 @@ class Inputs with ChangeNotifier {
|
|||||||
'value': general['id']
|
'value': general['id']
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// print(responseData['data']['inputs']);
|
||||||
inputItems.add({
|
inputItems.add({
|
||||||
'type': 'Text',
|
'type': 'Text',
|
||||||
'key': 'device_id',
|
'key': 'device_id',
|
||||||
'name': general['device_label'],
|
'name': general['device_label'],
|
||||||
'value': deviceLabel
|
'value': deviceLabel,
|
||||||
});
|
});
|
||||||
inputItems.add(
|
inputItems.add(
|
||||||
{'type': 'Date', 'key': 'date', 'name': 'date', 'value': dateTime});
|
{'type': 'Date', 'key': 'date', 'name': 'date', 'value': dateTime});
|
||||||
@@ -86,6 +89,7 @@ class Inputs with ChangeNotifier {
|
|||||||
setValues(inputs, values);
|
setValues(inputs, values);
|
||||||
for (var input in inputs) {
|
for (var input in inputs) {
|
||||||
inputItems.add(input as Map<String, dynamic>);
|
inputItems.add(input as Map<String, dynamic>);
|
||||||
|
// print(input);
|
||||||
}
|
}
|
||||||
inputItems.add({
|
inputItems.add({
|
||||||
'type': 'Image',
|
'type': 'Image',
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ class TestResultsProvider with ChangeNotifier {
|
|||||||
url,
|
url,
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': User.token,
|
'Authorization': User.token,
|
||||||
|
// 'X-Requested-With': 'XMLHttpRequest',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -200,11 +201,11 @@ class TestResultsProvider with ChangeNotifier {
|
|||||||
items = [];
|
items = [];
|
||||||
}
|
}
|
||||||
for (var item in testResultData['data']['data']) {
|
for (var item in testResultData['data']['data']) {
|
||||||
// print(item);
|
print(item);
|
||||||
originalItems.add(
|
originalItems.add(
|
||||||
TestResultObject(
|
TestResultObject(
|
||||||
id: item['id'].toString(),
|
id: item['id'].toString(),
|
||||||
name: item['test_type']['name'],
|
name: item['test_type'] != null ? item['test_type']['name'] : '',
|
||||||
deviceId: item['device_id'].toString(),
|
deviceId: item['device_id'].toString(),
|
||||||
result: item['result'] == 'Accept' ? 'Accepted' : 'Not Accepted',
|
result: item['result'] == 'Accept' ? 'Accepted' : 'Not Accepted',
|
||||||
date: item['created_at'].toString().substring(0, 10),
|
date: item['created_at'].toString().substring(0, 10),
|
||||||
@@ -246,7 +247,7 @@ class TestResultsProvider with ChangeNotifier {
|
|||||||
"file": di.MultipartFile.fromBytes(imageListInt, filename: fileName)
|
"file": di.MultipartFile.fromBytes(imageListInt, filename: fileName)
|
||||||
});
|
});
|
||||||
|
|
||||||
var response = await dio.post(
|
await dio.post(
|
||||||
Url.addImage,
|
Url.addImage,
|
||||||
data: formData,
|
data: formData,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ class _FormCreatorState extends State<FormCreator> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (item['type'] == "Text") {
|
if (item['type'] == "Text") {
|
||||||
print(item['name']);
|
// print(item['require_scanner'].toString());
|
||||||
TextEditingController idCTRL = new TextEditingController();
|
TextEditingController idCTRL = new TextEditingController();
|
||||||
final _media = MediaQuery.of(context);
|
final _media = MediaQuery.of(context);
|
||||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||||
@@ -176,7 +176,7 @@ class _FormCreatorState extends State<FormCreator> {
|
|||||||
listWidgets.add(
|
listWidgets.add(
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: item['name'] != 'Autoclave ID'
|
child: item['require_scanner'].toString() != '1'
|
||||||
? TextFormField(
|
? TextFormField(
|
||||||
controller: idCTRL,
|
controller: idCTRL,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@@ -184,7 +184,7 @@ class _FormCreatorState extends State<FormCreator> {
|
|||||||
border: UnderlineInputBorder(),
|
border: UnderlineInputBorder(),
|
||||||
contentPadding: EdgeInsets.all(0),
|
contentPadding: EdgeInsets.all(0),
|
||||||
),
|
),
|
||||||
initialValue: item['value'] ?? '',
|
// initialValue: item['value'] ?? '',
|
||||||
onChanged: (String value) {
|
onChanged: (String value) {
|
||||||
formItems[count]['value'] = value;
|
formItems[count]['value'] = value;
|
||||||
_handleChanged();
|
_handleChanged();
|
||||||
@@ -202,7 +202,7 @@ class _FormCreatorState extends State<FormCreator> {
|
|||||||
border: UnderlineInputBorder(),
|
border: UnderlineInputBorder(),
|
||||||
contentPadding: EdgeInsets.all(0),
|
contentPadding: EdgeInsets.all(0),
|
||||||
),
|
),
|
||||||
initialValue: item['value'] ?? '',
|
// initialValue: item['value'] ?? '',
|
||||||
onChanged: (String value) {
|
onChanged: (String value) {
|
||||||
formItems[count]['value'] = value;
|
formItems[count]['value'] = value;
|
||||||
_handleChanged();
|
_handleChanged();
|
||||||
@@ -340,7 +340,7 @@ class _FormCreatorState extends State<FormCreator> {
|
|||||||
border: UnderlineInputBorder(),
|
border: UnderlineInputBorder(),
|
||||||
contentPadding: EdgeInsets.all(0),
|
contentPadding: EdgeInsets.all(0),
|
||||||
),
|
),
|
||||||
initialValue: item['value'] ?? '',
|
// initialValue: item['value'] ?? '',
|
||||||
onChanged: (String value) {
|
onChanged: (String value) {
|
||||||
formItems[count]['value'] = value;
|
formItems[count]['value'] = value;
|
||||||
_handleChanged();
|
_handleChanged();
|
||||||
|
|||||||
+19
-19
@@ -21,7 +21,7 @@ packages:
|
|||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.2"
|
version: "2.5.0-nullsafety.1"
|
||||||
barcode_scan:
|
barcode_scan:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -35,7 +35,7 @@ packages:
|
|||||||
name: boolean_selector
|
name: boolean_selector
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.1.0-nullsafety.1"
|
||||||
camera:
|
camera:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -49,28 +49,28 @@ packages:
|
|||||||
name: characters
|
name: characters
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.1.0-nullsafety.3"
|
||||||
charcode:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: charcode
|
name: charcode
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.3"
|
version: "1.2.0-nullsafety.1"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: clock
|
name: clock
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.1"
|
version: "1.1.0-nullsafety.1"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.14.13"
|
version: "1.15.0-nullsafety.3"
|
||||||
connectivity:
|
connectivity:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -133,7 +133,7 @@ packages:
|
|||||||
name: fake_async
|
name: fake_async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.2.0-nullsafety.1"
|
||||||
file:
|
file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -253,14 +253,14 @@ packages:
|
|||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.8"
|
version: "0.12.10-nullsafety.1"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.8"
|
version: "1.3.0-nullsafety.3"
|
||||||
multiselect_formfield:
|
multiselect_formfield:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -274,7 +274,7 @@ packages:
|
|||||||
name: path
|
name: path
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.0"
|
version: "1.8.0-nullsafety.1"
|
||||||
path_provider:
|
path_provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -412,49 +412,49 @@ packages:
|
|||||||
name: source_span
|
name: source_span
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.0"
|
version: "1.8.0-nullsafety.2"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stack_trace
|
name: stack_trace
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.5"
|
version: "1.10.0-nullsafety.1"
|
||||||
stream_channel:
|
stream_channel:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stream_channel
|
name: stream_channel
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.1.0-nullsafety.1"
|
||||||
string_scanner:
|
string_scanner:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: string_scanner
|
name: string_scanner
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.5"
|
version: "1.1.0-nullsafety.1"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: term_glyph
|
name: term_glyph
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.2.0-nullsafety.1"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.17"
|
version: "0.2.19-nullsafety.2"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: typed_data
|
name: typed_data
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.3.0-nullsafety.3"
|
||||||
url_launcher:
|
url_launcher:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -489,7 +489,7 @@ packages:
|
|||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.8"
|
version: "2.1.0-nullsafety.3"
|
||||||
video_player:
|
video_player:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -533,5 +533,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.1"
|
version: "2.2.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.9.0-14.0.dev <3.0.0"
|
dart: ">=2.10.0-110 <2.11.0"
|
||||||
flutter: ">=1.12.13+hotfix.5 <2.0.0"
|
flutter: ">=1.12.13+hotfix.5 <2.0.0"
|
||||||
|
|||||||
+13
-27
@@ -11,7 +11,7 @@ description: A new Flutter project.
|
|||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 1.5.0+2
|
version: 1.7.0+6
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.2.2 <3.0.0"
|
sdk: ">=2.2.2 <3.0.0"
|
||||||
@@ -19,39 +19,26 @@ environment:
|
|||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
http: ^0.12.0+3
|
|
||||||
provider: ^3.2.0
|
|
||||||
barcode_scan: ^3.0.0
|
barcode_scan: ^3.0.0
|
||||||
# flutter_barcode_scanner: ^1.0.0
|
camera: ^0.5.8+2
|
||||||
connectivity: ^0.4.8+5
|
connectivity: ^0.4.8+5
|
||||||
|
cupertino_icons: ^0.1.2
|
||||||
shared_preferences: ^0.5.6
|
dio: ^3.0.9
|
||||||
multiselect_formfield: ^0.1.2
|
double_back_to_close_app: ^1.2.0
|
||||||
|
file_picker: ^1.9.0+1
|
||||||
flutter_phoenix: ^0.1.0
|
flutter_phoenix: ^0.1.0
|
||||||
font_awesome_flutter: ^8.8.1
|
font_awesome_flutter: ^8.8.1
|
||||||
intl: ^0.16.1
|
http: ^0.12.0+3
|
||||||
double_back_to_close_app: ^1.2.0
|
|
||||||
# hive: ^1.4.1+1
|
|
||||||
url_launcher: ^5.4.10
|
|
||||||
# multi_image_picker: ^4.6.7
|
|
||||||
# image_picker: ^0.6.7
|
|
||||||
file_picker: ^1.9.0+1
|
|
||||||
dio: ^3.0.9
|
|
||||||
# camera : any
|
|
||||||
# loadmore: ^1.0.4
|
|
||||||
# incrementally_loading_listview: ^0.3.0
|
|
||||||
# dropdown_formfield: ^0.1.2
|
|
||||||
path_provider: ^1.6.11
|
|
||||||
# video_player: ^0.10.11+2
|
|
||||||
image_picker_gallery_camera: ^0.1.6
|
image_picker_gallery_camera: ^0.1.6
|
||||||
|
intl: ^0.16.1
|
||||||
|
multiselect_formfield: ^0.1.2
|
||||||
|
path_provider: ^1.6.11
|
||||||
|
provider: ^3.2.0
|
||||||
random_string: ^2.0.1
|
random_string: ^2.0.1
|
||||||
camera: ^0.5.8+2
|
shared_preferences: ^0.5.6
|
||||||
|
url_launcher: ^5.4.10
|
||||||
video_player: ^0.10.11+2
|
video_player: ^0.10.11+2
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
|
||||||
cupertino_icons: ^0.1.2
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
@@ -104,4 +91,3 @@ flutter:
|
|||||||
# - asset: assets/Fonts/Montserrat-Italic.ttf
|
# - asset: assets/Fonts/Montserrat-Italic.ttf
|
||||||
# For details regarding fonts from package dependencies,
|
# For details regarding fonts from package dependencies,
|
||||||
# see https://flutter.dev/custom-fonts/#from-packages
|
# see https://flutter.dev/custom-fonts/#from-packages
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user