Updated pages
This commit is contained in:
parent
794edf902a
commit
809cf7aa5f
3 changed files with 17 additions and 11 deletions
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:ocbo_esign_mobile/blocs/qr/qr_bloc.dart';
|
||||
import 'package:ocbo_esign_mobile/blocs/user/user_bloc.dart';
|
||||
import 'package:ocbo_esign_mobile/pages/approval_page.dart';
|
||||
import 'package:ocbo_esign_mobile/pages/index_page.dart';
|
||||
|
|
@ -75,7 +76,10 @@ class MyApp extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MultiBlocProvider(
|
||||
providers: [BlocProvider(create: (context) => UserBloc())],
|
||||
providers: [
|
||||
BlocProvider(create: (context) => UserBloc()),
|
||||
BlocProvider(create: (context) => QrBloc()),
|
||||
],
|
||||
child: MaterialApp.router(
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: ThemeData(useMaterial3: true),
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ 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';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class ValidateDetailPage extends StatefulWidget {
|
||||
const ValidateDetailPage({super.key});
|
||||
|
|
@ -17,18 +18,21 @@ class ValidateDetailPage extends StatefulWidget {
|
|||
|
||||
class _ValidateDetailPageState extends State<ValidateDetailPage> {
|
||||
final _searchController = TextEditingController();
|
||||
late double _total = 0;
|
||||
late int _total = 0;
|
||||
final NumberFormat formatter = NumberFormat('#,###.##');
|
||||
|
||||
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'];
|
||||
final responseCount = await getApi('get-transactions-count', name, null);
|
||||
final total = responseCount['result'];
|
||||
|
||||
setState(() {
|
||||
_total = double.parse(total);
|
||||
_total = double.parse(total).toInt();
|
||||
});
|
||||
|
||||
final response = await getApi('get-transactions', name, null);
|
||||
final applicationNoList = response['result'];
|
||||
final dateList = response['result2'];
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -72,7 +76,7 @@ class _ValidateDetailPageState extends State<ValidateDetailPage> {
|
|||
children: [
|
||||
Column(
|
||||
children: [
|
||||
TextWidget(text: _total.toString(), size: 64, bold: true),
|
||||
TextWidget(text: formatter.format(_total), size: 64, bold: true),
|
||||
TextWidget(text: 'Total Signed Applications', size: 16),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
|
|||
final qr = value.substring(35);
|
||||
final response = await getApi('check-qr', qr, null);
|
||||
final result = response["result"]?.toString();
|
||||
log('result: $result');
|
||||
|
||||
if (result != null) {
|
||||
setState(() {
|
||||
|
|
@ -103,8 +102,7 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
|
|||
await blocSetQr(context, qrResult);
|
||||
}
|
||||
|
||||
void gotoDetails() async {
|
||||
log('qr $qrResult');
|
||||
void gotoDetails() {
|
||||
updateBlockQr();
|
||||
context.push('/details');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue