stable version 3.3.9

feature/passo/PASSO-#1-Sync-data-from-device-to-postgre-and-vice-versa
rodolfobacuinjr 2022-12-20 14:26:37 +08:00
parent 8d5f713e52
commit 25e0f0905f
21 changed files with 406 additions and 270 deletions

View File

@ -1,7 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/container.dart';
import 'package:flutter/src/widgets/framework.dart';
import '../../../theme-data.dart/text-styles.dart'; import '../../../theme-data.dart/text-styles.dart';
import '../../../utils/global.dart'; import '../../../utils/global.dart';

View File

@ -1,7 +1,5 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/container.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:fluttericon/entypo_icons.dart'; import 'package:fluttericon/entypo_icons.dart';
import 'package:form_builder_validators/form_builder_validators.dart'; import 'package:form_builder_validators/form_builder_validators.dart';
@ -61,7 +59,7 @@ class _RequetAutoReceiptState extends State<RequetAutoReceipt> {
height: 8, height: 8,
), ),
Text( Text(
"Source Remarks", sourceRemarks,
style: Theme.of(context).textTheme.caption, style: Theme.of(context).textTheme.caption,
), ),
const SizedBox( const SizedBox(
@ -69,15 +67,13 @@ class _RequetAutoReceiptState extends State<RequetAutoReceipt> {
), ),
FormBuilderTextField( FormBuilderTextField(
name: "remarks", name: "remarks",
validator: FormBuilderValidators.compose([ validator: FormBuilderValidators.required(
FormBuilderValidators.required( errorText: remarksRequired),
errorText: "Remarks is required")
]),
autovalidateMode: autovalidateMode:
AutovalidateMode.onUserInteraction, AutovalidateMode.onUserInteraction,
maxLines: 5, maxLines: 5,
decoration: normalTextFieldStyle( decoration: normalTextFieldStyle(
"Enter your remarks", "..."), enterRemarks, "..."),
), ),
const SizedBox( const SizedBox(
height: 8, height: 8,
@ -92,7 +88,7 @@ class _RequetAutoReceiptState extends State<RequetAutoReceipt> {
autofocus: false, autofocus: false,
validator: FormBuilderValidators.compose([ validator: FormBuilderValidators.compose([
FormBuilderValidators.required( FormBuilderValidators.required(
errorText: "Department is required") errorText: departmentRequired)
]), ]),
decoration: decoration:
normalTextFieldStyle("Department", ""), normalTextFieldStyle("Department", ""),
@ -106,11 +102,11 @@ class _RequetAutoReceiptState extends State<RequetAutoReceipt> {
height: 12, height: 12,
), ),
FormBuilderDropdown<String?>( FormBuilderDropdown<String?>(
name: 'purok', name: 'substation',
autofocus: false, autofocus: false,
validator: FormBuilderValidators.compose([ validator: FormBuilderValidators.compose([
FormBuilderValidators.required( FormBuilderValidators.required(
errorText: "Purok is required") errorText: substationRequired)
]), ]),
decoration: decoration:
normalTextFieldStyle("Substation", ""), normalTextFieldStyle("Substation", ""),
@ -130,7 +126,7 @@ class _RequetAutoReceiptState extends State<RequetAutoReceipt> {
style: secondaryBtnStyle( style: secondaryBtnStyle(
second, Colors.transparent, Colors.white54), second, Colors.transparent, Colors.white54),
child: const Text( child: const Text(
"Request Auto Receipt", requestAutoReceipt,
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
onPressed: () { onPressed: () {

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:fluttericon/font_awesome_icons.dart'; import 'package:fluttericon/font_awesome_icons.dart';
import 'package:form_builder_validators/form_builder_validators.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:unit2/theme-data.dart/text-styles.dart'; import 'package:unit2/theme-data.dart/text-styles.dart';
import 'package:unit2/utils/screen_info.dart'; import 'package:unit2/utils/screen_info.dart';
@ -22,111 +23,107 @@ class AddMobile extends StatelessWidget {
onWillPop: () async { onWillPop: () async {
return true; return true;
}, },
child: Scaffold( child: SafeArea(
appBar: AppBar( child: Scaffold(
backgroundColor: Colors.transparent, appBar: AppBar(
elevation: 0, backgroundColor: primary,
leading: IconButton( elevation: 0,
icon: const Icon(
FontAwesome.left_big,
),
onPressed: () {
context.go(context.namedLocation('login'));
},
color: primary,
), ),
), resizeToAvoidBottomInset: true,
resizeToAvoidBottomInset: true, body: SingleChildScrollView(
body: SingleChildScrollView( child: SizedBox(
child: SizedBox( height: screenHeight * .90,
height: screenHeight * .89, child: Stack(
child: Stack( children: [
children: [ Wave(height: blockSizeVertical * 8),
Positioned( Positioned(
bottom: 0, bottom: 0,
right: 0, right: 0,
child: WaveReverse(height: blockSizeVertical * 8)), child: WaveReverse(height: blockSizeVertical * 8)),
Container( Container(
height: screenHeight, height: screenHeight,
padding: isMobile() padding: isMobile()
? const EdgeInsets.symmetric(horizontal: 24) ? const EdgeInsets.symmetric(horizontal: 24)
: const EdgeInsets.symmetric(horizontal: 60), : const EdgeInsets.symmetric(horizontal: 60),
width: double.infinity, width: double.infinity,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox( SizedBox(
height: isMobile()
? screenHeight * .12
: screenHeight * .20),
SvgPicture.asset(
'assets/svgs/add_mobile.svg',
height: isMobile() height: isMobile()
? screenHeight * .12 ? blockSizeVertical * 22
: screenHeight * .20), : blockSizeVertical * 30,
SvgPicture.asset( allowDrawingOutsideViewBox: true,
'assets/svgs/add_mobile.svg', ),
height: isMobile() const SizedBox(
? blockSizeVertical * 22 height: 24,
: blockSizeVertical * 30, ),
allowDrawingOutsideViewBox: true, Text(addMobile, style: titleTextStyle()),
), const SizedBox(
const SizedBox( height: 8,
height: 24, ),
), Text(addMobileCaption,
Text(addMobile, style: titleTextStyle()), textAlign: TextAlign.center,
const SizedBox( style: Theme.of(context).textTheme.caption),
height: 8, const SizedBox(
), height: 24,
Text(addMobileCaption, ),
textAlign: TextAlign.center, FormBuilder(
style: Theme.of(context).textTheme.caption), key: _formKey,
const SizedBox( child: Column(
height: 24, children: [
), // Mobile number 1
FormBuilder( FormBuilderTextField(
key: _formKey, name: 'mobile1',
child: Column( validator: mobileNumberValidator,
children: [ maxLength: 11,
// Mobile number 1 decoration:
FormBuilderTextField( normalTextFieldStyle(mobile1, "+63")),
name: 'mobile1', const SizedBox(
validator: mobileNumberValidator, height: 12,
decoration: normalTextFieldStyle(
"mobile number 1", "+63")),
const SizedBox(
height: 12,
),
FormBuilderTextField(
name: 'mobile2',
decoration: normalTextFieldStyle(
"mobile number 2", "+63")),
SizedBox(
height: isMobile()
? blockSizeVertical * 3
: blockSizeHorizontal * 5),
SizedBox(
width: double.infinity,
height: screenHeight * .06,
child: ElevatedButton(
style: secondaryBtnStyle(second,
Colors.transparent, Colors.white54),
child: const Text(
submit,
style: TextStyle(color: Colors.white),
),
onPressed: () {
if (_formKey.currentState!
.saveAndValidate()) {
context.go(context
.namedLocation('request-sos'));
}
// }
},
), ),
), FormBuilderTextField(
], name: 'mobile2',
)) maxLength: 11,
]), decoration:
), normalTextFieldStyle(mobile2, "+63")),
],
SizedBox(
height: isMobile()
? blockSizeVertical * 3
: blockSizeHorizontal * 5),
SizedBox(
width: double.infinity,
height: screenHeight * .06,
child: ElevatedButton(
style: secondaryBtnStyle(second,
Colors.transparent, Colors.white54),
child: const Text(
submit,
style: TextStyle(color: Colors.white),
),
onPressed: () {
if (_formKey.currentState!
.saveAndValidate()) {
context.go(context
.namedLocation('request-sos'));
}
// }
},
),
),
],
))
]),
),
],
),
), ),
), ),
), ),

View File

@ -70,13 +70,13 @@ class _RequestSOSState extends State<RequestSOS> {
name: "message", name: "message",
validator: FormBuilderValidators.compose([ validator: FormBuilderValidators.compose([
FormBuilderValidators.required( FormBuilderValidators.required(
errorText: "Message is required") errorText: messageRequired)
]), ]),
autovalidateMode: AutovalidateMode.onUserInteraction, autovalidateMode: AutovalidateMode.onUserInteraction,
maxLines: 5, maxLines: 5,
decoration: normalTextFieldStyle("", "SOS message.."), decoration: normalTextFieldStyle("", sosMessage),
), ),
Expanded( const Expanded(
child: SizedBox(), child: SizedBox(),
), ),
SizedBox( SizedBox(

View File

@ -77,7 +77,7 @@ class SOSreceived extends StatelessWidget {
SlideInUp( SlideInUp(
from: 50, from: 50,
child: AutoSizeText( child: AutoSizeText(
"SOS Received!", sosReceived,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: Theme.of(context).textTheme.displayMedium!.copyWith( style: Theme.of(context).textTheme.displayMedium!.copyWith(
fontSize: 40, fontSize: 40,
@ -117,7 +117,7 @@ class SOSreceived extends StatelessWidget {
child: TextButton( child: TextButton(
style: mainBtnStyle(second, Colors.transparent, second), style: mainBtnStyle(second, Colors.transparent, second),
onPressed: () {}, onPressed: () {},
child: const Text("Cancel request", child: const Text(cancelRequest,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
)), )),

View File

@ -1,7 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_zoom_drawer/flutter_zoom_drawer.dart'; import 'package:flutter_zoom_drawer/flutter_zoom_drawer.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:cool_alert/cool_alert.dart';
import 'package:unit2/utils/alerts.dart'; import 'package:unit2/utils/alerts.dart';
import '../../../../theme-data.dart/colors.dart'; import '../../../../theme-data.dart/colors.dart';

View File

@ -89,12 +89,12 @@ class _UniT2LoginState extends State<UniT2Login> {
FormBuilderTextField( FormBuilderTextField(
name: 'username', name: 'username',
validator: FormBuilderValidators.required( validator: FormBuilderValidators.required(
errorText: "Username is required"), errorText: usernameRequired),
autofocus: false, autofocus: false,
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black87), color: Colors.black87),
decoration: loginTextFieldStyle()), decoration: loginTextFieldStyle().copyWith()),
SizedBox( SizedBox(
height: blockSizeVertical * 1.5, height: blockSizeVertical * 1.5,
), ),
@ -102,7 +102,7 @@ class _UniT2LoginState extends State<UniT2Login> {
FormBuilderTextField( FormBuilderTextField(
name: 'password', name: 'password',
validator: FormBuilderValidators.required( validator: FormBuilderValidators.required(
errorText: "Password is required"), errorText: passwordRequired),
// initialValue: state.password, // initialValue: state.password,
onChanged: (value) { onChanged: (value) {
@ -148,9 +148,12 @@ class _UniT2LoginState extends State<UniT2Login> {
.displayLarge .displayLarge
?.color)), ?.color)),
), ),
prefixIcon: const Icon(Icons.lock), prefixIcon: const Icon(
Icons.lock,
color: primary,
),
labelText: "Password", labelText: "Password",
hintText: "Enter Password..."), hintText: enterPassword),
obscureText: _showPassword ? true : false, obscureText: _showPassword ? true : false,
), ),
SizedBox( SizedBox(
@ -173,6 +176,7 @@ class _UniT2LoginState extends State<UniT2Login> {
progress?.showWithText( progress?.showWithText(
'Logging in...', 'Logging in...',
); );
FocusScope.of(context).unfocus();
Future.delayed(const Duration(seconds: 5), Future.delayed(const Duration(seconds: 5),
() { () {
progress!.dismiss(); progress!.dismiss();
@ -215,13 +219,14 @@ class _UniT2LoginState extends State<UniT2Login> {
style: TextStyle(color: second), style: TextStyle(color: second),
), ),
onPressed: () async { onPressed: () async {
ScanResult result = context.goNamed('register');
await QRCodeBarCodeScanner.instance // ScanResult result =
.scanner(); // await QRCodeBarCodeScanner.instance
// .scanner();
debugPrint(result.type.toString()); // debugPrint(result.type.toString());
debugPrint( // debugPrint(
result.rawContent.toString()); // result.rawContent.toString());
// BlocProvider.of<UserBloc>(context) // BlocProvider.of<UserBloc>(context)
// .add(QRCodelogin()); // .add(QRCodelogin());
}, },

View File

@ -5,7 +5,9 @@ import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:fluttericon/font_awesome5_icons.dart'; import 'package:fluttericon/font_awesome5_icons.dart';
import 'package:fluttericon/font_awesome_icons.dart';
import 'package:form_builder_validators/form_builder_validators.dart'; import 'package:form_builder_validators/form_builder_validators.dart';
import 'package:go_router/go_router.dart';
import 'package:unit2/theme-data.dart/btn-style.dart'; import 'package:unit2/theme-data.dart/btn-style.dart';
import 'package:unit2/widgets/wave.dart'; import 'package:unit2/widgets/wave.dart';
@ -31,6 +33,13 @@ class _RegisterState extends State<Register> {
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: AppBar(
backgroundColor: primary,
elevation: 0,
automaticallyImplyLeading: true,
title: const Text("Register password"),
centerTitle: true,
),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Stack( child: Stack(
children: [ children: [
@ -38,7 +47,7 @@ class _RegisterState extends State<Register> {
Positioned( Positioned(
bottom: 0, child: WaveReverse(height: blockSizeVertical * 8)), bottom: 0, child: WaveReverse(height: blockSizeVertical * 8)),
Container( Container(
height: screenHeight * .97, height: screenHeight * .90,
padding: const EdgeInsets.symmetric(horizontal: 15), padding: const EdgeInsets.symmetric(horizontal: 15),
child: FormBuilder( child: FormBuilder(
key: _formKey, key: _formKey,
@ -118,7 +127,7 @@ class _RegisterState extends State<Register> {
), ),
prefixIcon: const Icon(Icons.lock), prefixIcon: const Icon(Icons.lock),
labelText: "Password", labelText: "Password",
hintText: "Enter Password..."), hintText: enterPassword),
obscureText: _showPassword ? true : false, obscureText: _showPassword ? true : false,
), ),
const SizedBox( const SizedBox(
@ -171,8 +180,8 @@ class _RegisterState extends State<Register> {
?.color)), ?.color)),
), ),
prefixIcon: const Icon(Icons.lock), prefixIcon: const Icon(Icons.lock),
labelText: "Confirm Password", labelText: confirmPassword,
hintText: "Confirm Password..."), hintText: enterConfirmPassword),
obscureText: _showPassword ? true : false, obscureText: _showPassword ? true : false,
), ),
const SizedBox( const SizedBox(
@ -185,9 +194,11 @@ class _RegisterState extends State<Register> {
style: secondaryBtnStyle( style: secondaryBtnStyle(
second, Colors.transparent, primary), second, Colors.transparent, primary),
onPressed: () { onPressed: () {
if (_formKey.currentState!.saveAndValidate()) {} if (_formKey.currentState!.saveAndValidate()) {
context.goNamed('home');
}
}, },
child: const Text("Register")), child: const Text(register)),
) )
], ],
), ),

View File

@ -7,6 +7,7 @@ import 'package:qr_flutter/qr_flutter.dart';
import 'package:unit2/test_data.dart'; import 'package:unit2/test_data.dart';
import 'package:unit2/theme-data.dart/btn-style.dart'; import 'package:unit2/theme-data.dart/btn-style.dart';
import 'package:unit2/utils/global.dart'; import 'package:unit2/utils/global.dart';
import 'package:unit2/utils/text_container.dart';
import '../../../theme-data.dart/colors.dart'; import '../../../theme-data.dart/colors.dart';
import './components/cover-image.dart'; import './components/cover-image.dart';
@ -23,36 +24,62 @@ class Profile extends StatelessWidget {
child: Scaffold( child: Scaffold(
body: SizedBox( body: SizedBox(
width: screenWidth, width: screenWidth,
child: Stack( child: Column(
clipBehavior: Clip.none,
alignment: Alignment.center,
children: [ children: [
const CoverImage(), Stack(
const Positioned(top: 125, child: BuildProfileImage()), clipBehavior: Clip.none,
Positioned( alignment: Alignment.center,
top: 10, children: [
left: 20, const CoverImage(),
child: IconButton( Positioned(
onPressed: () { top: blockSizeVertical * 17.5,
context.go(context.namedLocation('home')); child: Stack(
}, alignment: Alignment.center,
icon: const Icon( children: [
FontAwesome5.arrow_left, const CircleAvatar(
size: 24, radius: 72,
color: Colors.white, backgroundColor: Colors.white,
),
CircleAvatar(
radius: 69,
backgroundColor: Colors.grey.shade800,
child: SvgPicture.asset(
'assets/svgs/male.svg',
),
),
],
), ),
)), ),
Positioned( Positioned(
top: 10, top: 10,
right: 20, left: 20,
child: IconButton( child: IconButton(
onPressed: () {}, onPressed: () {
icon: const Icon( context.go(context.namedLocation('home'));
Icons.edit, },
size: 24, icon: const Icon(
color: Colors.white, FontAwesome5.arrow_left,
), size: 24,
)), color: Colors.white,
),
)),
Positioned(
top: 10,
right: 20,
child: IconButton(
onPressed: () {},
icon: const Icon(
Icons.edit,
size: 24,
color: Colors.white,
),
)),
],
),
SizedBox(
height: blockSizeVertical * 5,
),
const BuildInformation(),
], ],
), ),
), ),
@ -95,19 +122,24 @@ class BuildInformation extends StatelessWidget {
data: uuid, data: uuid,
size: blockSizeVertical * 30, size: blockSizeVertical * 30,
), ),
SizedBox( const SizedBox(
height: 25, height: 25,
), ),
SizedBox( SizedBox(
height: blockSizeVertical * 6,
width: screenWidth * .60, width: screenWidth * .60,
child: ElevatedButton.icon( height: blockSizeVertical * 6,
label: const Text("Signature pad"), child: SizedBox(
icon: const Icon( child: ElevatedButton.icon(
FontAwesome5.signature, style:
), mainBtnStyle(third, Colors.transparent, Colors.white54),
style: mainBtnStyle(third, Colors.transparent, Colors.white54), onPressed: () {
onPressed: () {}, context.goNamed('signature');
},
icon: const Icon(
FontAwesome5.signature,
size: 15,
),
label: const Text(signature)),
), ),
), ),
const SizedBox( const SizedBox(
@ -118,32 +150,3 @@ class BuildInformation extends StatelessWidget {
); );
} }
} }
class BuildProfileImage extends StatelessWidget {
const BuildProfileImage({super.key});
@override
Widget build(BuildContext context) {
return Column(
children: [
Stack(
alignment: Alignment.center,
children: [
const CircleAvatar(
radius: 72,
backgroundColor: Colors.white,
),
CircleAvatar(
radius: 69,
backgroundColor: Colors.grey.shade800,
child: SvgPicture.asset(
'assets/svgs/male.svg',
),
),
],
),
BuildInformation(),
],
);
}
}

View File

@ -1,6 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/container.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:fluttericon/entypo_icons.dart'; import 'package:fluttericon/entypo_icons.dart';
import 'package:unit2/utils/text_container.dart'; import 'package:unit2/utils/text_container.dart';
@ -40,7 +38,7 @@ class QRCodeScanner extends StatelessWidget {
height: 8, height: 8,
), ),
Text( Text(
"TAP TO SCAN QR CODE", tapToScanQR,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
@ -60,7 +58,7 @@ class QRCodeScanner extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
"INCOMING", incoming,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme

View File

@ -53,7 +53,7 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
), ),
ListTile( ListTile(
title: Text( title: Text(
"Set QR Scanner Settings", setQRScannerSettings,
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.headline6! .headline6!
@ -61,10 +61,10 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
Text("Include other inputs?", Text(includeOtherInputs,
style: Theme.of(context).textTheme.subtitle1), style: Theme.of(context).textTheme.subtitle1),
Text( Text(
"inputs such as body temperature, etc.", includeOtherInputsSubTitle,
style: Theme.of(context).textTheme.caption, style: Theme.of(context).textTheme.caption,
), ),
SizedBox( SizedBox(
@ -86,10 +86,10 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
), ),
), ),
// Incoming or outgoing // Incoming or outgoing
Text("Incoming or Outgoing? ", Text(incomingORoutgoing,
style: Theme.of(context).textTheme.subtitle1), style: Theme.of(context).textTheme.subtitle1),
Text( Text(
"incoming for entrance outgoing for exit.", incomingORoutgoingSubTitle,
style: Theme.of(context).textTheme.caption, style: Theme.of(context).textTheme.caption,
), ),
FittedBox( FittedBox(
@ -117,12 +117,12 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
FormBuilderDropdown<String?>( FormBuilderDropdown<String?>(
name: 'level', name: 'level',
validator: FormBuilderValidators.required( validator: FormBuilderValidators.required(
errorText: "This field is required"), errorText: fieldIsRequired),
decoration: normalTextFieldStyle("Select level", "level"), decoration: normalTextFieldStyle(selectLevel, "level"),
items: levels items: levels
.map((level) => DropdownMenuItem( .map((level) => DropdownMenuItem(
child: Text(level),
value: level, value: level,
child: Text(level),
)) ))
.toList(), .toList(),
// value: selectedLevel, // value: selectedLevel,
@ -138,12 +138,14 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
FormBuilderDropdown<String?>( FormBuilderDropdown<String?>(
name: 'establishment', name: 'establishment',
decoration: normalTextFieldStyle( decoration: normalTextFieldStyle(
"Select establishment", "establishments"), selectedEstablishment, "establishments"),
isExpanded: true, isExpanded: true,
validator: FormBuilderValidators.required(
errorText: fieldIsRequired),
items: establishments items: establishments
.map((est) => DropdownMenuItem( .map((est) => DropdownMenuItem(
child: Text(est),
value: est, value: est,
child: Text(est),
)) ))
.toList(), .toList(),
// value: selectedArea, // value: selectedArea,
@ -155,12 +157,12 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
), ),
DropdownButtonFormField<String?>( DropdownButtonFormField<String?>(
decoration: normalTextFieldStyle( decoration: normalTextFieldStyle(
"Select establishment", "establishments"), selectEstablishment, "establishments"),
isExpanded: true, isExpanded: true,
items: establishments items: establishments
.map((est) => DropdownMenuItem( .map((est) => DropdownMenuItem(
child: Text(est),
value: est, value: est,
child: Text(est),
)) ))
.toList(), .toList(),
// value: selectedArea, // value: selectedArea,

View File

@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/container.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:signature/signature.dart';
import 'package:unit2/theme-data.dart/colors.dart';
class SignaturePad extends StatefulWidget {
const SignaturePad({super.key});
@override
State<SignaturePad> createState() => _SignaturePadState();
}
class _SignaturePadState extends State<SignaturePad> {
SignatureController? _signatureController;
@override
void initState() {
_signatureController = SignatureController(
penStrokeWidth: 3,
penColor: Colors.black87,
);
super.initState();
}
@override
void dispose() {
_signatureController!.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Create Signature"),
centerTitle: true,
backgroundColor: second,
automaticallyImplyLeading: true,
),
body: Signature(
controller: _signatureController!,
backgroundColor: Colors.white,
),
);
}
}

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:unit2/theme-data.dart/colors.dart';
InputDecoration normalTextFieldStyle(String labelText, String hintText) { InputDecoration normalTextFieldStyle(String labelText, String hintText) {
return InputDecoration( return InputDecoration(
@ -53,6 +54,7 @@ InputDecoration loginTextFieldStyle() {
floatingLabelBehavior: FloatingLabelBehavior.never, floatingLabelBehavior: FloatingLabelBehavior.never,
prefixIcon: const Icon( prefixIcon: const Icon(
Icons.person, Icons.person,
color: primary,
), ),
labelText: 'Username', labelText: 'Username',
hintText: 'Enter your username...', hintText: 'Enter your username...',

View File

@ -1,29 +1,51 @@
import 'package:cool_alert/cool_alert.dart'; import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/global.dart';
confirmAlert(context, Function() yes) { confirmAlert(context, Function() yes) {
CoolAlert.show( AwesomeDialog(
loopAnimation: true, context: context,
context: context, dialogType: DialogType.question,
type: CoolAlertType.confirm, borderSide: const BorderSide(
title: 'LOGOUT!', color: Colors.green,
text: 'Are you sure you want to logout?', width: 0,
cancelBtnText: 'No', ),
confirmBtnText: 'Yes', width: blockSizeHorizontal * 90,
confirmBtnColor: second, buttonsBorderRadius: const BorderRadius.all(
showCancelBtn: true, Radius.circular(2),
barrierDismissible: false, ),
onConfirmBtnTap: yes); dismissOnTouchOutside: false,
dismissOnBackKeyPress: false,
// onDismissCallback: (type) {
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(
// content: Text('Dismissed by $type'),
// ),
// );
// },
headerAnimationLoop: false,
animType: AnimType.bottomSlide,
title: 'LOGOUT!',
desc: 'Are you sure you want to logout?',
btnOkText: "Yes",
btnCancelText: "No",
showCloseIcon: false,
btnCancelOnPress: () {},
btnOkOnPress: yes,
).show();
} }
errorAlert(context) { errorAlert(context, title, description) {
CoolAlert.show( AwesomeDialog(
width: blockSizeHorizontal * 90,
context: context, context: context,
type: CoolAlertType.error, dialogType: DialogType.error,
confirmBtnColor: second, animType: AnimType.scale,
title: 'Login Failed!', headerAnimationLoop: false,
text: 'username or password is incorrect.', title: title,
loopAnimation: false, desc: description,
); btnOkOnPress: () {},
btnOkColor: Colors.red,
).show();
} }

View File

@ -1,5 +1,9 @@
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:unit2/screens/unit2/login/register.dart'; import 'package:unit2/screens/unit2/login/register.dart';
import 'package:unit2/screens/unit2/roles/qr_code_scanner.dart/scan.dart';
import 'package:unit2/screens/unit2/roles/qr_code_scanner.dart/settings_screen.dart';
import 'package:unit2/screens/unit2/signature/signature_pad.dart';
import 'package:unit2/utils/scanner.dart';
import '../screens/docsms/components/doc_info_tile.dart'; import '../screens/docsms/components/doc_info_tile.dart';
import '../screens/docsms/request_receipt.dart'; import '../screens/docsms/request_receipt.dart';
import '../screens/sos/add_mobile.dart'; import '../screens/sos/add_mobile.dart';
@ -15,6 +19,10 @@ final GoRouter goRouter = GoRouter(routes: <GoRoute>[
name: 'login', name: 'login',
builder: (context, state) => UniT2Login(), builder: (context, state) => UniT2Login(),
routes: [ routes: [
GoRoute(
name: 'register',
path: 'register',
builder: ((context, state) => const Register())),
GoRoute( GoRoute(
name: 'home', name: 'home',
path: 'home', path: 'home',
@ -23,7 +31,14 @@ final GoRouter goRouter = GoRouter(routes: <GoRoute>[
GoRoute( GoRoute(
name: 'profile', name: 'profile',
path: 'profile', path: 'profile',
builder: (context, state) => const Profile()) builder: (context, state) => const Profile(),
routes: [
GoRoute(
name: 'signature',
path: 'signature',
builder: (context, state) => const SignaturePad(),
)
])
]), ]),
GoRoute( GoRoute(
name: 'add-mobile', name: 'add-mobile',

View File

@ -36,7 +36,34 @@ const String documentTitle = "Document Title";
const String documentSubject = "Document Subject"; const String documentSubject = "Document Subject";
const String documentType = "Document Type"; const String documentType = "Document Type";
const String registerToContinue = "Create your password to register"; const String registerToContinue = "Create your password to register";
const String sourceRemarks = "Source Remarks";
const String remarksRequired = "Remarks is required";
const String enterRemarks = "Enter your remarks";
const String departmentRequired = "Department is required";
const String substationRequired = "Substation is required";
const String requestAutoReceipt = "Request Auto Receipt";
const String messageRequired = "Message is required";
const String sosMessage = "SOS message ...";
const String sosReceived = "SOS Received!";
const String cancelRequest = "Cancel Request";
const String usernameRequired = "Username is required";
const String passwordRequired = "Password is required";
const String enterPassword = "Enter Password ...";
const String confirmPassword = "Confirm Password";
const String enterConfirmPassword = "Enter Confirm Password ...";
const String register = "Register";
const String signature = "Signature pad";
const String tapToScanQR = "TAP TO SCAN QR CODE";
const String incoming = "INCOMING";
const String setQRScannerSettings = "Set QR Scanner Settings";
const String includeOtherInputs = "Include other inputs?";
const String includeOtherInputsSubTitle = "Inputs such as body temperature, etc.";
const String incomingORoutgoing = "Incoming or Outgoing?";
const String incomingORoutgoingSubTitle = "incoming for entrance outgoing for exit.";
const String fieldIsRequired = "This field is required";
const String selectLevel = "Select level";
const String selectEstablishment = "Select Establishment";
// //
// //
// //
//

View File

@ -2,7 +2,7 @@ import 'package:form_builder_validators/form_builder_validators.dart';
import '../utils/text_container.dart'; import '../utils/text_container.dart';
final mobileNumberValidator = FormBuilderValidators.compose([ final mobileNumberValidator = FormBuilderValidators.compose([
FormBuilderValidators.minLength(11), FormBuilderValidators.equalLength(11),
FormBuilderValidators.required(errorText: mobileNumberRequired), FormBuilderValidators.required(errorText: mobileNumberRequired),
FormBuilderValidators.numeric(errorText: numericValidator) FormBuilderValidators.numeric(errorText: numericValidator)
]); ]);

View File

@ -29,6 +29,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0" version: "3.0.0"
awesome_dialog:
dependency: "direct main"
description:
name: awesome_dialog
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
azlistview: azlistview:
dependency: "direct main" dependency: "direct main"
description: description:
@ -106,13 +113,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.0+1" version: "3.1.0+1"
cool_alert:
dependency: "direct main"
description:
name: cool_alert
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
@ -176,13 +176,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.0.1"
flare_flutter:
dependency: transitive
description:
name: flare_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -301,6 +294,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.1" version: "3.1.1"
graphs:
dependency: transitive
description:
name: graphs
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
http: http:
dependency: transitive dependency: transitive
description: description:
@ -315,6 +315,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.2" version: "4.0.2"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.2"
intl: intl:
dependency: "direct main" dependency: "direct main"
description: description:
@ -350,13 +357,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
lottie:
dependency: transitive
description:
name: lottie
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.3"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
@ -532,6 +532,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.0" version: "4.0.0"
rive:
dependency: transitive
description:
name: rive
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.1"
rxdart: rxdart:
dependency: transitive dependency: transitive
description: description:
@ -602,6 +609,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.1" version: "2.1.1"
signature:
dependency: "direct main"
description:
name: signature
url: "https://pub.dartlang.org"
source: hosted
version: "5.3.0"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter

View File

@ -56,8 +56,9 @@ dependencies:
date_time_picker: ^2.1.0 date_time_picker: ^2.1.0
flutter_progress_hud: ^2.0.2 flutter_progress_hud: ^2.0.2
barcode_scan2: ^4.2.1 barcode_scan2: ^4.2.1
cool_alert: ^1.1.0
qr_flutter: ^4.0.0 qr_flutter: ^4.0.0
signature: ^5.3.0
awesome_dialog: ^3.0.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: