Updated validation
This commit is contained in:
parent
be352aa263
commit
c5e0b439ad
2 changed files with 121 additions and 31 deletions
|
|
@ -1,8 +1,43 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'dart:developer';
|
||||
|
||||
class ValidateDetailPage extends StatelessWidget {
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.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/input_widget.dart';
|
||||
import 'package:ocbo_esign_mobile/widgets/text_widget.dart';
|
||||
|
||||
class ValidateDetailPage extends StatefulWidget {
|
||||
const ValidateDetailPage({super.key});
|
||||
|
||||
@override
|
||||
State<ValidateDetailPage> createState() => _ValidateDetailPageState();
|
||||
}
|
||||
|
||||
class _ValidateDetailPageState extends State<ValidateDetailPage> {
|
||||
final _searchController = TextEditingController();
|
||||
late double _total = 0;
|
||||
|
||||
void _getTotalSigned() async {
|
||||
final name = await blocGetQr(context);
|
||||
final response = await getApi('get-transactions-count', name, null);
|
||||
log(name.toString());
|
||||
log(response.toString());
|
||||
final total = response['result'];
|
||||
|
||||
setState(() {
|
||||
_total = double.parse(total);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_getTotalSigned();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
|
|
@ -23,6 +58,45 @@ class ValidateDetailPage extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width - 90,
|
||||
child: Column(
|
||||
children: [
|
||||
const Gap(88),
|
||||
InputWidget(controller: _searchController, password: false, placeholder: 'Specify Application Number'),
|
||||
const Gap(24),
|
||||
BoxWidget(
|
||||
circular: 16,
|
||||
content: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
TextWidget(text: _total.toString(), size: 64, bold: true),
|
||||
TextWidget(text: 'Total Signed Applications', size: 16),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Gap(16),
|
||||
const BoxWidget(
|
||||
circular: 16,
|
||||
content: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
TextWidget(text: '23-000123', size: 24, bold: true),
|
||||
TextWidget(text: 'Total Signed Applications', size: 20),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue