107 lines
3.4 KiB
Dart
107 lines
3.4 KiB
Dart
import 'dart:developer';
|
|
|
|
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';
|
|
import 'package:intl/intl.dart';
|
|
|
|
class ValidateDetailPage extends StatefulWidget {
|
|
const ValidateDetailPage({super.key});
|
|
|
|
@override
|
|
State<ValidateDetailPage> createState() => _ValidateDetailPageState();
|
|
}
|
|
|
|
class _ValidateDetailPageState extends State<ValidateDetailPage> {
|
|
final _searchController = TextEditingController();
|
|
late int _total = 0;
|
|
final NumberFormat formatter = NumberFormat('#,###.##');
|
|
|
|
void _getTotalSigned() async {
|
|
final name = await blocGetQr(context);
|
|
final responseCount = await getApi('get-transactions-count', name, null);
|
|
final total = responseCount['result'];
|
|
|
|
setState(() {
|
|
_total = double.parse(total).toInt();
|
|
});
|
|
|
|
final response = await getApi('get-transactions', name, null);
|
|
final applicationNoList = response['result'];
|
|
final dateList = response['result2'];
|
|
}
|
|
|
|
@override
|
|
void initState() {
|
|
_getTotalSigned();
|
|
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
resizeToAvoidBottomInset: false,
|
|
body: Container(
|
|
alignment: Alignment.center,
|
|
height: MediaQuery.of(context).size.height,
|
|
decoration: const BoxDecoration(
|
|
gradient: LinearGradient(
|
|
begin: Alignment.topCenter,
|
|
end: Alignment.bottomCenter,
|
|
colors: [
|
|
Color.fromRGBO(37, 25, 44, 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: 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: formatter.format(_total), 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),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|