From f4ab256fa09eae5177c63140604206bcd1bb81ab Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Wed, 4 Feb 2026 18:28:35 +0800 Subject: [PATCH] Updated pages --- lib/pages/index_page.dart | 2 +- lib/pages/login_page.dart | 17 ++- lib/pages/validate_detail_page.dart | 229 ++++++++++++++++++---------- lib/pages/validate_page.dart | 23 +-- 4 files changed, 177 insertions(+), 94 deletions(-) diff --git a/lib/pages/index_page.dart b/lib/pages/index_page.dart index a3e9845..21121e9 100644 --- a/lib/pages/index_page.dart +++ b/lib/pages/index_page.dart @@ -44,7 +44,7 @@ class IndexPage extends StatelessWidget { child: Column( children: [ const Gap(88), - const ImageWidget(imagePath: 'assets/logo.webp', size: 160, measureByHeight: false), + const ImageWidget(imagePath: 'assets/esign-mobile.webp', size: 160, measureByHeight: false), const Gap(20), const TextWidget( text: "OCBO e-Sign", diff --git a/lib/pages/login_page.dart b/lib/pages/login_page.dart index 0f58031..5adcbd7 100644 --- a/lib/pages/login_page.dart +++ b/lib/pages/login_page.dart @@ -120,8 +120,8 @@ class _LoginPageState extends State { child: Column( children: [ const Gap(88), - const ImageWidget(imagePath: 'assets/logo.webp', size: 100, measureByHeight: true), - const Gap(58), + const ImageWidget(imagePath: 'assets/esign-mobile.webp', size: 148, measureByHeight: true), + const Gap(32), LoginBoxWidget( title: 'Login', content: Column( @@ -135,6 +135,7 @@ class _LoginPageState extends State { const Gap(8), InputWidget(controller: _passwordController, password: true), const Gap(24), + // ValueListenableBuilder( // valueListenable: passwordNotifier, // builder: (context, password, child) { @@ -145,6 +146,18 @@ class _LoginPageState extends State { // ); // }, // ), + ValueListenableBuilder( + valueListenable: passwordNotifier, + builder: (context, password, child) { + return ButtonWidget( + text: _passwordController.text.isNotEmpty + ? "Stop typing, login not ready" + : 'Not yet functional', + onPressed: _ignoreButton, + disabled: true, + ); + }, + ), ], ), ), diff --git a/lib/pages/validate_detail_page.dart b/lib/pages/validate_detail_page.dart index ddd2cf8..7bfafce 100644 --- a/lib/pages/validate_detail_page.dart +++ b/lib/pages/validate_detail_page.dart @@ -19,21 +19,27 @@ class ValidateDetailPage extends StatefulWidget { class _ValidateDetailPageState extends State { final _searchController = TextEditingController(); - late int _total = 0; final NumberFormat formatter = NumberFormat('#,###.##'); + final dateFormatter = DateFormat('yyyy-MM-dd'); + // final Color greenColor = const Color(0xFF4CCE51); + late int _total = 0; + late List _applicationList = []; + late List _dateList = []; void _getTotalSigned() async { final name = await blocGetQr(context); final responseCount = await getApi('get-transactions-count', name, null); final total = responseCount['result']; + final response = await getApi('get-transactions', name, null); + final applicationNoList = response['result']; + final dateList = response['result2']; + setState(() { _total = double.parse(total).toInt(); + _applicationList = applicationNoList; + _dateList = dateList; }); - - // final response = await getApi('get-transactions', name, null); - // final applicationNoList = response['result']; - // final dateList = response['result2']; } @override @@ -64,19 +70,10 @@ class _ValidateDetailPageState extends State { ), ), child: SizedBox( - width: MediaQuery.of(context).size.width - 104, + width: MediaQuery.of(context).size.width - 112, child: Column( children: [ const Gap(88), - ClipRRect( - borderRadius: BorderRadius.circular(36), - child: InputWidget( - controller: _searchController, - password: false, - placeholder: 'Search Application Number', - ), - ), - const Gap(24), BoxWidget( circular: 16, content: Row( @@ -85,81 +82,153 @@ class _ValidateDetailPageState extends State { Column( children: [ TextWidget(text: formatter.format(_total), size: 50, bold: true), - TextWidget(text: 'Total Signed Applications', size: 16), + const TextWidget(text: 'Total Signed Applications', size: 16), ], ), ], ), ), const Gap(16), - (Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - BoxWidget( - alignment: CrossAxisAlignment.center, - circular: 16, - content: Row( + ClipRRect( + // borderRadius: BorderRadius.circular(36), + child: InputWidget( + controller: _searchController, + password: false, + placeholder: 'Search Application Number', + ), + ), + const Gap(24), + + // ListView( + // scrollDirection: Axis.horizontal, + // padding: EdgeInsets.symmetric(horizontal: 16), + // children: [ + // // BoxWidget( + // // alignment: CrossAxisAlignment.center, + // // circular: 16, + // // content: Row( + // // children: [ + // // const ImageWidget(imagePath: 'assets/esign.webp', size: 48, measureByHeight: true), + // // const Gap(16), + // // Column( + // // crossAxisAlignment: CrossAxisAlignment.start, + // // children: [ + // // TextWidget(text: '23-000123', size: 18, bold: true), + // // const Gap(4), + // // TextWidget(text: 'Total Signed Applications', size: 12), + // // ], + // // ), + // // ], + // // ), + // // ), + // ], + // ), + Expanded( + child: ListView.builder( + itemCount: _total, + itemBuilder: (BuildContext context, int index) { + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisAlignment: MainAxisAlignment.start, children: [ - const ImageWidget(imagePath: 'assets/esign.webp', size: 48, measureByHeight: true), - const Gap(16), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - TextWidget(text: '23-000123', size: 18, bold: true), - const Gap(4), - TextWidget(text: 'Total Signed Applications', size: 12), - ], - ), - ], - ), - ), - const Gap(8), - BoxWidget( - alignment: CrossAxisAlignment.center, - circular: 16, - content: Row( - children: [ - const ImageWidget(imagePath: 'assets/esign.webp', size: 48, measureByHeight: true), - const Gap(16), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - TextWidget(text: '23-000123', size: 18, bold: true), - const Gap(4), - TextWidget(text: 'Total Signed Applications', size: 12), - const Gap(4), - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [TextWidget(text: 'Dates', size: 8)], + BoxWidget( + alignment: CrossAxisAlignment.center, + circular: 16, + content: Row( + children: [ + const ImageWidget(imagePath: 'assets/esign-check.webp', size: 40, measureByHeight: true), + const Gap(16), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + TextWidget(text: _applicationList[index], size: 18, bold: true), + const Gap(4), + SizedBox( + width: 190, + child: TextWidget(text: '8990 Housing Development Corporation', size: 10), + ), + const Gap(4), + TextWidget(text: _dateList[index], size: 10, opacity: 0.8), + ], ), - ), - ], + ], + ), ), + const Gap(8), ], - ), - ), - const Gap(8), - BoxWidget( - alignment: CrossAxisAlignment.center, - circular: 16, - content: Row( - children: [ - const ImageWidget(imagePath: 'assets/esign.webp', size: 48, measureByHeight: true), - const Gap(16), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - TextWidget(text: '23-000123', size: 18, bold: true), - const Gap(4), - TextWidget(text: 'Total Signed Applications', size: 12), - ], - ), - ], - ), - ), - ], - )), + ); + }, + ), + ), + + // Column( + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // BoxWidget( + // alignment: CrossAxisAlignment.center, + // circular: 16, + // content: Row( + // children: [ + // const ImageWidget(imagePath: 'assets/esign.webp', size: 48, measureByHeight: true), + // const Gap(16), + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // TextWidget(text: '23-000123', size: 18, bold: true), + // const Gap(4), + // TextWidget(text: 'Total Signed Applications', size: 12), + // ], + // ), + // ], + // ), + // ), + // // const Gap(8), + // // BoxWidget( + // // alignment: CrossAxisAlignment.center, + // // circular: 16, + // // content: Row( + // // children: [ + // // const ImageWidget(imagePath: 'assets/esign.webp', size: 48, measureByHeight: true), + // // const Gap(16), + // // Column( + // // crossAxisAlignment: CrossAxisAlignment.start, + // // children: [ + // // TextWidget(text: '23-000123', size: 18, bold: true), + // // const Gap(4), + // // TextWidget(text: 'Total Signed Applications', size: 12), + // // const Gap(4), + // // Expanded( + // // child: Row( + // // mainAxisAlignment: MainAxisAlignment.end, + // // children: [TextWidget(text: 'Dates', size: 8)], + // // ), + // // ), + // // ], + // // ), + // // ], + // // ), + // // ), + // // const Gap(8), + // // BoxWidget( + // // alignment: CrossAxisAlignment.center, + // // circular: 16, + // // content: Row( + // // children: [ + // // const ImageWidget(imagePath: 'assets/esign.webp', size: 48, measureByHeight: true), + // // const Gap(16), + // // Column( + // // crossAxisAlignment: CrossAxisAlignment.start, + // // children: [ + // // TextWidget(text: '23-000123', size: 18, bold: true), + // // const Gap(4), + // // TextWidget(text: 'Total Signed Applications', size: 12), + // // ], + // // ), + // // ], + // // ), + // // ), + // ], + // ), ], ), ), diff --git a/lib/pages/validate_page.dart b/lib/pages/validate_page.dart index a704202..225d635 100644 --- a/lib/pages/validate_page.dart +++ b/lib/pages/validate_page.dart @@ -113,7 +113,7 @@ class _BarcodeScannerScreenState extends State { resizeToAvoidBottomInset: false, body: Container( alignment: Alignment.center, - height: MediaQuery.of(context).size.height, + height: MediaQuery.of(context).size.height * 1.2, decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, @@ -187,12 +187,12 @@ class _BarcodeScannerScreenState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: MediaQuery.of(context).size.width - 160, - padding: const EdgeInsets.fromLTRB(8, 16, 8, 26), + width: 220, + padding: const EdgeInsets.fromLTRB(0, 16, 0, 32), decoration: BoxDecoration( border: BoxBorder.all(color: redColor), color: redColorShade, - borderRadius: BorderRadius.circular(12), + borderRadius: BorderRadius.circular(32), ), child: Column( children: [ @@ -220,12 +220,12 @@ class _BarcodeScannerScreenState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: MediaQuery.of(context).size.width - 160, - padding: const EdgeInsets.fromLTRB(8, 16, 8, 26), + width: 220, + padding: const EdgeInsets.fromLTRB(0, 16, 0, 32), decoration: BoxDecoration( border: BoxBorder.all(color: redColor), color: redColorShade, - borderRadius: BorderRadius.circular(12), + borderRadius: BorderRadius.circular(32), ), child: Column( children: [ @@ -252,12 +252,13 @@ class _BarcodeScannerScreenState extends State { Column( children: [ Container( - width: MediaQuery.of(context).size.width - 160, - padding: const EdgeInsets.fromLTRB(8, 16, 8, 26), + // width: MediaQuery.of(context).size.width - 160, + width: 220, + padding: const EdgeInsets.fromLTRB(0, 16, 0, 32), decoration: BoxDecoration( border: BoxBorder.all(color: greenColor), color: greenColorShade, - borderRadius: BorderRadius.circular(12), + borderRadius: BorderRadius.circular(32), ), child: Column( children: [ @@ -280,7 +281,7 @@ class _BarcodeScannerScreenState extends State { const Gap(24), TextWidget(text: qrResult, bold: true, size: 20, color: greenColor), const Gap(24), - ButtonWidget(text: "Show Details", disabled: false, onPressed: gotoDetails), + ButtonWidget(text: "Check Signed Applications", disabled: false, onPressed: gotoDetails), ], ), ],