Updated pages
This commit is contained in:
parent
cb69b25b98
commit
9ef7e5ffe3
2 changed files with 117 additions and 30 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:ocbo_esign_mobile/blocs/application/functions/bloc_getapplication.dart';
|
import 'package:ocbo_esign_mobile/blocs/application/functions/bloc_getapplication.dart';
|
||||||
|
import 'package:ocbo_esign_mobile/blocs/qr/functions/bloc_getqr.dart';
|
||||||
|
import 'package:ocbo_esign_mobile/functions/get_api.dart';
|
||||||
import 'package:ocbo_esign_mobile/widgets/box_widget.dart';
|
import 'package:ocbo_esign_mobile/widgets/box_widget.dart';
|
||||||
import 'package:ocbo_esign_mobile/widgets/text_widget.dart';
|
import 'package:ocbo_esign_mobile/widgets/text_widget.dart';
|
||||||
|
|
||||||
|
|
@ -13,12 +17,30 @@ class ApplicationInfoPage extends StatefulWidget {
|
||||||
|
|
||||||
class _ApplicationInfoPageState extends State<ApplicationInfoPage> {
|
class _ApplicationInfoPageState extends State<ApplicationInfoPage> {
|
||||||
late String _applicationNo = '';
|
late String _applicationNo = '';
|
||||||
|
late String _name = '';
|
||||||
|
late String _month = '';
|
||||||
|
late String _day = '';
|
||||||
|
late String _year = '';
|
||||||
|
|
||||||
void _getInfo() async {
|
void _getInfo() async {
|
||||||
final applicationBloc = await blocGetApplication(context);
|
late String applicationBloc = '';
|
||||||
|
late String qrBloc = '';
|
||||||
|
|
||||||
|
if (context.mounted) {
|
||||||
|
applicationBloc = await blocGetApplication(context);
|
||||||
|
// ignore: use_build_context_synchronously
|
||||||
|
qrBloc = await blocGetQr(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
final id = await getApi('get-esignid-byname', qrBloc, null);
|
||||||
|
final response = await getApi('get-infoapproval-electrical', applicationBloc, id["result"].toString());
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_applicationNo = applicationBloc;
|
_applicationNo = applicationBloc;
|
||||||
|
_name = response["result"].toString();
|
||||||
|
_month = response["result2"].toString();
|
||||||
|
_day = response["result3"].toString();
|
||||||
|
_year = response["result4"].toString();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -30,36 +52,88 @@ class _ApplicationInfoPageState extends State<ApplicationInfoPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Scaffold(
|
||||||
alignment: Alignment.center,
|
resizeToAvoidBottomInset: false,
|
||||||
height: MediaQuery.of(context).size.height,
|
body: Container(
|
||||||
decoration: const BoxDecoration(
|
padding: EdgeInsets.only(left: 16, right: 16),
|
||||||
gradient: LinearGradient(
|
alignment: Alignment.center,
|
||||||
begin: Alignment.topCenter,
|
height: MediaQuery.of(context).size.height,
|
||||||
end: Alignment.bottomCenter,
|
decoration: const BoxDecoration(
|
||||||
colors: [
|
gradient: LinearGradient(
|
||||||
Color.fromRGBO(37, 25, 44, 1),
|
begin: Alignment.topCenter,
|
||||||
Color.fromRGBO(22, 33, 44, 1),
|
end: Alignment.bottomCenter,
|
||||||
Color.fromRGBO(22, 33, 44, 1),
|
colors: [
|
||||||
Color.fromRGBO(22, 33, 44, 1),
|
Color.fromRGBO(37, 25, 44, 1),
|
||||||
Color.fromRGBO(25, 46, 41, 1),
|
Color.fromRGBO(22, 33, 44, 1),
|
||||||
|
Color.fromRGBO(22, 33, 44, 1),
|
||||||
|
Color.fromRGBO(22, 33, 44, 1),
|
||||||
|
Color.fromRGBO(25, 46, 41, 1),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
const Gap(88),
|
||||||
|
BoxWidget(
|
||||||
|
circular: 16,
|
||||||
|
content: Center(child: TextWidget(text: _applicationNo, bold: true)),
|
||||||
|
),
|
||||||
|
const Gap(16),
|
||||||
|
BoxWidget(
|
||||||
|
circular: 16,
|
||||||
|
content: Center(child: TextWidget(text: _name, bold: false, size: 16)),
|
||||||
|
),
|
||||||
|
const Gap(8),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
BoxWidget(
|
||||||
|
circular: 16,
|
||||||
|
width: 180,
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
content: Center(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
const TextWidget(
|
||||||
|
text: 'Approved Date',
|
||||||
|
bold: false,
|
||||||
|
size: 8,
|
||||||
|
color: Color.fromRGBO(255, 255, 255, 0.8),
|
||||||
|
),
|
||||||
|
const Gap(4),
|
||||||
|
TextWidget(text: _month, bold: false, size: 16),
|
||||||
|
TextWidget(text: _day, bold: true, size: 48),
|
||||||
|
TextWidget(text: _year, bold: false, size: 16),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
BoxWidget(
|
||||||
|
circular: 16,
|
||||||
|
width: 180,
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
content: Center(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
const TextWidget(
|
||||||
|
text: 'Printed Date',
|
||||||
|
bold: false,
|
||||||
|
size: 8,
|
||||||
|
color: Color.fromRGBO(255, 255, 255, 0.8),
|
||||||
|
),
|
||||||
|
const Gap(4),
|
||||||
|
TextWidget(text: _month, bold: false, size: 16),
|
||||||
|
TextWidget(text: _day, bold: true, size: 48),
|
||||||
|
TextWidget(text: _year, bold: false, size: 16),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
const Gap(88),
|
|
||||||
BoxWidget(
|
|
||||||
circular: 16,
|
|
||||||
content: Center(child: TextWidget(text: _applicationNo, bold: true)),
|
|
||||||
),
|
|
||||||
const Gap(16),
|
|
||||||
BoxWidget(
|
|
||||||
circular: 16,
|
|
||||||
content: Center(child: TextWidget(text: _applicationNo, bold: true)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Gap(24),
|
const Gap(24),
|
||||||
// ButtonWidget(text: 'Try API', disabled: false, onPressed: tryQR),
|
ButtonWidget(text: 'Try API', disabled: false, onPressed: tryQR),
|
||||||
if (_qrResult.isNotEmpty)
|
if (_qrResult.isNotEmpty)
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
|
|
@ -214,7 +214,20 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Gap(16),
|
const Gap(16),
|
||||||
TextWidget(text: 'QR Detected is not OCBO e-Sign', bold: true, size: 20, color: _redColor),
|
Container(
|
||||||
|
padding: EdgeInsets.all(16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: _redColor, width: 2),
|
||||||
|
color: _redColorShade,
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
),
|
||||||
|
child: TextWidget(
|
||||||
|
text: 'Not OCBO e-Sign QR detected',
|
||||||
|
bold: true,
|
||||||
|
size: 18,
|
||||||
|
color: _redColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
else if (_qrResult == 'non-exist')
|
else if (_qrResult == 'non-exist')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue