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'; class ValidateDetailPage extends StatefulWidget { const ValidateDetailPage({super.key}); @override State createState() => _ValidateDetailPageState(); } class _ValidateDetailPageState extends State { 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( 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: _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), ], ), ], ), ), ], ), ), ), ); } }