stable version 3.3.9
parent
8d5f713e52
commit
25e0f0905f
|
@ -40,7 +40,7 @@ class MyApp extends StatelessWidget {
|
|||
// locale: DevicePreview.locale(context),
|
||||
// builder: DevicePreview.appBuilder,
|
||||
routeInformationParser: goRouter.routeInformationParser,
|
||||
routerDelegate: goRouter.routerDelegate,
|
||||
routerDelegate: goRouter.routerDelegate,
|
||||
// routeInformationProvider: goRouter.routeInformationProvider,
|
||||
title: 'uniT2 - Universal Tracker and Tracer',
|
||||
theme: ThemeData(
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
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 '../../../utils/global.dart';
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import 'package:flutter/cupertino.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:fluttericon/entypo_icons.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
|
@ -61,7 +59,7 @@ class _RequetAutoReceiptState extends State<RequetAutoReceipt> {
|
|||
height: 8,
|
||||
),
|
||||
Text(
|
||||
"Source Remarks",
|
||||
sourceRemarks,
|
||||
style: Theme.of(context).textTheme.caption,
|
||||
),
|
||||
const SizedBox(
|
||||
|
@ -69,15 +67,13 @@ class _RequetAutoReceiptState extends State<RequetAutoReceipt> {
|
|||
),
|
||||
FormBuilderTextField(
|
||||
name: "remarks",
|
||||
validator: FormBuilderValidators.compose([
|
||||
FormBuilderValidators.required(
|
||||
errorText: "Remarks is required")
|
||||
]),
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: remarksRequired),
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
maxLines: 5,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Enter your remarks", "..."),
|
||||
enterRemarks, "..."),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
|
@ -92,7 +88,7 @@ class _RequetAutoReceiptState extends State<RequetAutoReceipt> {
|
|||
autofocus: false,
|
||||
validator: FormBuilderValidators.compose([
|
||||
FormBuilderValidators.required(
|
||||
errorText: "Department is required")
|
||||
errorText: departmentRequired)
|
||||
]),
|
||||
decoration:
|
||||
normalTextFieldStyle("Department", ""),
|
||||
|
@ -106,11 +102,11 @@ class _RequetAutoReceiptState extends State<RequetAutoReceipt> {
|
|||
height: 12,
|
||||
),
|
||||
FormBuilderDropdown<String?>(
|
||||
name: 'purok',
|
||||
name: 'substation',
|
||||
autofocus: false,
|
||||
validator: FormBuilderValidators.compose([
|
||||
FormBuilderValidators.required(
|
||||
errorText: "Purok is required")
|
||||
errorText: substationRequired)
|
||||
]),
|
||||
decoration:
|
||||
normalTextFieldStyle("Substation", ""),
|
||||
|
@ -130,7 +126,7 @@ class _RequetAutoReceiptState extends State<RequetAutoReceipt> {
|
|||
style: secondaryBtnStyle(
|
||||
second, Colors.transparent, Colors.white54),
|
||||
child: const Text(
|
||||
"Request Auto Receipt",
|
||||
requestAutoReceipt,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
onPressed: () {
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_svg/svg.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:unit2/theme-data.dart/text-styles.dart';
|
||||
import 'package:unit2/utils/screen_info.dart';
|
||||
|
@ -22,111 +23,107 @@ class AddMobile extends StatelessWidget {
|
|||
onWillPop: () async {
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(
|
||||
FontAwesome.left_big,
|
||||
),
|
||||
onPressed: () {
|
||||
context.go(context.namedLocation('login'));
|
||||
},
|
||||
color: primary,
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: primary,
|
||||
elevation: 0,
|
||||
),
|
||||
),
|
||||
resizeToAvoidBottomInset: true,
|
||||
body: SingleChildScrollView(
|
||||
child: SizedBox(
|
||||
height: screenHeight * .89,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: WaveReverse(height: blockSizeVertical * 8)),
|
||||
Container(
|
||||
height: screenHeight,
|
||||
padding: isMobile()
|
||||
? const EdgeInsets.symmetric(horizontal: 24)
|
||||
: const EdgeInsets.symmetric(horizontal: 60),
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
resizeToAvoidBottomInset: true,
|
||||
body: SingleChildScrollView(
|
||||
child: SizedBox(
|
||||
height: screenHeight * .90,
|
||||
child: Stack(
|
||||
children: [
|
||||
Wave(height: blockSizeVertical * 8),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: WaveReverse(height: blockSizeVertical * 8)),
|
||||
Container(
|
||||
height: screenHeight,
|
||||
padding: isMobile()
|
||||
? const EdgeInsets.symmetric(horizontal: 24)
|
||||
: const EdgeInsets.symmetric(horizontal: 60),
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: isMobile()
|
||||
? screenHeight * .12
|
||||
: screenHeight * .20),
|
||||
SvgPicture.asset(
|
||||
'assets/svgs/add_mobile.svg',
|
||||
height: isMobile()
|
||||
? screenHeight * .12
|
||||
: screenHeight * .20),
|
||||
SvgPicture.asset(
|
||||
'assets/svgs/add_mobile.svg',
|
||||
height: isMobile()
|
||||
? blockSizeVertical * 22
|
||||
: blockSizeVertical * 30,
|
||||
allowDrawingOutsideViewBox: true,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
Text(addMobile, style: titleTextStyle()),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Text(addMobileCaption,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.caption),
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
FormBuilder(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
// Mobile number 1
|
||||
FormBuilderTextField(
|
||||
name: 'mobile1',
|
||||
validator: mobileNumberValidator,
|
||||
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'));
|
||||
}
|
||||
|
||||
// }
|
||||
},
|
||||
? blockSizeVertical * 22
|
||||
: blockSizeVertical * 30,
|
||||
allowDrawingOutsideViewBox: true,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
Text(addMobile, style: titleTextStyle()),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Text(addMobileCaption,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.caption),
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
FormBuilder(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
// Mobile number 1
|
||||
FormBuilderTextField(
|
||||
name: 'mobile1',
|
||||
validator: mobileNumberValidator,
|
||||
maxLength: 11,
|
||||
decoration:
|
||||
normalTextFieldStyle(mobile1, "+63")),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
))
|
||||
]),
|
||||
),
|
||||
],
|
||||
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'));
|
||||
}
|
||||
|
||||
// }
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
))
|
||||
]),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -70,13 +70,13 @@ class _RequestSOSState extends State<RequestSOS> {
|
|||
name: "message",
|
||||
validator: FormBuilderValidators.compose([
|
||||
FormBuilderValidators.required(
|
||||
errorText: "Message is required")
|
||||
errorText: messageRequired)
|
||||
]),
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
maxLines: 5,
|
||||
decoration: normalTextFieldStyle("", "SOS message.."),
|
||||
decoration: normalTextFieldStyle("", sosMessage),
|
||||
),
|
||||
Expanded(
|
||||
const Expanded(
|
||||
child: SizedBox(),
|
||||
),
|
||||
SizedBox(
|
||||
|
|
|
@ -77,7 +77,7 @@ class SOSreceived extends StatelessWidget {
|
|||
SlideInUp(
|
||||
from: 50,
|
||||
child: AutoSizeText(
|
||||
"SOS Received!",
|
||||
sosReceived,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.displayMedium!.copyWith(
|
||||
fontSize: 40,
|
||||
|
@ -117,7 +117,7 @@ class SOSreceived extends StatelessWidget {
|
|||
child: TextButton(
|
||||
style: mainBtnStyle(second, Colors.transparent, second),
|
||||
onPressed: () {},
|
||||
child: const Text("Cancel request",
|
||||
child: const Text(cancelRequest,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
)),
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_zoom_drawer/flutter_zoom_drawer.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:cool_alert/cool_alert.dart';
|
||||
import 'package:unit2/utils/alerts.dart';
|
||||
import '../../../../theme-data.dart/colors.dart';
|
||||
|
||||
|
|
|
@ -89,12 +89,12 @@ class _UniT2LoginState extends State<UniT2Login> {
|
|||
FormBuilderTextField(
|
||||
name: 'username',
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "Username is required"),
|
||||
errorText: usernameRequired),
|
||||
autofocus: false,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black87),
|
||||
decoration: loginTextFieldStyle()),
|
||||
decoration: loginTextFieldStyle().copyWith()),
|
||||
SizedBox(
|
||||
height: blockSizeVertical * 1.5,
|
||||
),
|
||||
|
@ -102,7 +102,7 @@ class _UniT2LoginState extends State<UniT2Login> {
|
|||
FormBuilderTextField(
|
||||
name: 'password',
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "Password is required"),
|
||||
errorText: passwordRequired),
|
||||
|
||||
// initialValue: state.password,
|
||||
onChanged: (value) {
|
||||
|
@ -148,9 +148,12 @@ class _UniT2LoginState extends State<UniT2Login> {
|
|||
.displayLarge
|
||||
?.color)),
|
||||
),
|
||||
prefixIcon: const Icon(Icons.lock),
|
||||
prefixIcon: const Icon(
|
||||
Icons.lock,
|
||||
color: primary,
|
||||
),
|
||||
labelText: "Password",
|
||||
hintText: "Enter Password..."),
|
||||
hintText: enterPassword),
|
||||
obscureText: _showPassword ? true : false,
|
||||
),
|
||||
SizedBox(
|
||||
|
@ -173,6 +176,7 @@ class _UniT2LoginState extends State<UniT2Login> {
|
|||
progress?.showWithText(
|
||||
'Logging in...',
|
||||
);
|
||||
FocusScope.of(context).unfocus();
|
||||
Future.delayed(const Duration(seconds: 5),
|
||||
() {
|
||||
progress!.dismiss();
|
||||
|
@ -215,13 +219,14 @@ class _UniT2LoginState extends State<UniT2Login> {
|
|||
style: TextStyle(color: second),
|
||||
),
|
||||
onPressed: () async {
|
||||
ScanResult result =
|
||||
await QRCodeBarCodeScanner.instance
|
||||
.scanner();
|
||||
context.goNamed('register');
|
||||
// ScanResult result =
|
||||
// await QRCodeBarCodeScanner.instance
|
||||
// .scanner();
|
||||
|
||||
debugPrint(result.type.toString());
|
||||
debugPrint(
|
||||
result.rawContent.toString());
|
||||
// debugPrint(result.type.toString());
|
||||
// debugPrint(
|
||||
// result.rawContent.toString());
|
||||
// BlocProvider.of<UserBloc>(context)
|
||||
// .add(QRCodelogin());
|
||||
},
|
||||
|
|
|
@ -5,7 +5,9 @@ import 'package:flutter/src/widgets/framework.dart';
|
|||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_svg/svg.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:go_router/go_router.dart';
|
||||
import 'package:unit2/theme-data.dart/btn-style.dart';
|
||||
import 'package:unit2/widgets/wave.dart';
|
||||
|
||||
|
@ -31,6 +33,13 @@ class _RegisterState extends State<Register> {
|
|||
return SafeArea(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: AppBar(
|
||||
backgroundColor: primary,
|
||||
elevation: 0,
|
||||
automaticallyImplyLeading: true,
|
||||
title: const Text("Register password"),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Stack(
|
||||
children: [
|
||||
|
@ -38,7 +47,7 @@ class _RegisterState extends State<Register> {
|
|||
Positioned(
|
||||
bottom: 0, child: WaveReverse(height: blockSizeVertical * 8)),
|
||||
Container(
|
||||
height: screenHeight * .97,
|
||||
height: screenHeight * .90,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||
child: FormBuilder(
|
||||
key: _formKey,
|
||||
|
@ -118,7 +127,7 @@ class _RegisterState extends State<Register> {
|
|||
),
|
||||
prefixIcon: const Icon(Icons.lock),
|
||||
labelText: "Password",
|
||||
hintText: "Enter Password..."),
|
||||
hintText: enterPassword),
|
||||
obscureText: _showPassword ? true : false,
|
||||
),
|
||||
const SizedBox(
|
||||
|
@ -171,8 +180,8 @@ class _RegisterState extends State<Register> {
|
|||
?.color)),
|
||||
),
|
||||
prefixIcon: const Icon(Icons.lock),
|
||||
labelText: "Confirm Password",
|
||||
hintText: "Confirm Password..."),
|
||||
labelText: confirmPassword,
|
||||
hintText: enterConfirmPassword),
|
||||
obscureText: _showPassword ? true : false,
|
||||
),
|
||||
const SizedBox(
|
||||
|
@ -185,9 +194,11 @@ class _RegisterState extends State<Register> {
|
|||
style: secondaryBtnStyle(
|
||||
second, Colors.transparent, primary),
|
||||
onPressed: () {
|
||||
if (_formKey.currentState!.saveAndValidate()) {}
|
||||
if (_formKey.currentState!.saveAndValidate()) {
|
||||
context.goNamed('home');
|
||||
}
|
||||
},
|
||||
child: const Text("Register")),
|
||||
child: const Text(register)),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
@ -7,6 +7,7 @@ import 'package:qr_flutter/qr_flutter.dart';
|
|||
import 'package:unit2/test_data.dart';
|
||||
import 'package:unit2/theme-data.dart/btn-style.dart';
|
||||
import 'package:unit2/utils/global.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import '../../../theme-data.dart/colors.dart';
|
||||
import './components/cover-image.dart';
|
||||
|
||||
|
@ -23,36 +24,62 @@ class Profile extends StatelessWidget {
|
|||
child: Scaffold(
|
||||
body: SizedBox(
|
||||
width: screenWidth,
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
alignment: Alignment.center,
|
||||
child: Column(
|
||||
children: [
|
||||
const CoverImage(),
|
||||
const Positioned(top: 125, child: BuildProfileImage()),
|
||||
Positioned(
|
||||
top: 10,
|
||||
left: 20,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
context.go(context.namedLocation('home'));
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome5.arrow_left,
|
||||
size: 24,
|
||||
color: Colors.white,
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
const CoverImage(),
|
||||
Positioned(
|
||||
top: blockSizeVertical * 17.5,
|
||||
child: 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',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Positioned(
|
||||
top: 10,
|
||||
right: 20,
|
||||
child: IconButton(
|
||||
onPressed: () {},
|
||||
icon: const Icon(
|
||||
Icons.edit,
|
||||
size: 24,
|
||||
color: Colors.white,
|
||||
),
|
||||
)),
|
||||
),
|
||||
Positioned(
|
||||
top: 10,
|
||||
left: 20,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
context.go(context.namedLocation('home'));
|
||||
},
|
||||
icon: const Icon(
|
||||
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,
|
||||
size: blockSizeVertical * 30,
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
SizedBox(
|
||||
height: blockSizeVertical * 6,
|
||||
width: screenWidth * .60,
|
||||
child: ElevatedButton.icon(
|
||||
label: const Text("Signature pad"),
|
||||
icon: const Icon(
|
||||
FontAwesome5.signature,
|
||||
),
|
||||
style: mainBtnStyle(third, Colors.transparent, Colors.white54),
|
||||
onPressed: () {},
|
||||
height: blockSizeVertical * 6,
|
||||
child: SizedBox(
|
||||
child: ElevatedButton.icon(
|
||||
style:
|
||||
mainBtnStyle(third, Colors.transparent, Colors.white54),
|
||||
onPressed: () {
|
||||
context.goNamed('signature');
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome5.signature,
|
||||
size: 15,
|
||||
),
|
||||
label: const Text(signature)),
|
||||
),
|
||||
),
|
||||
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(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
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:unit2/utils/text_container.dart';
|
||||
|
||||
|
@ -40,7 +38,7 @@ class QRCodeScanner extends StatelessWidget {
|
|||
height: 8,
|
||||
),
|
||||
Text(
|
||||
"TAP TO SCAN QR CODE",
|
||||
tapToScanQR,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
|
@ -60,7 +58,7 @@ class QRCodeScanner extends StatelessWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"INCOMING",
|
||||
incoming,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
|
|
|
@ -53,7 +53,7 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
),
|
||||
ListTile(
|
||||
title: Text(
|
||||
"Set QR Scanner Settings",
|
||||
setQRScannerSettings,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.headline6!
|
||||
|
@ -61,10 +61,10 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
Text("Include other inputs?",
|
||||
Text(includeOtherInputs,
|
||||
style: Theme.of(context).textTheme.subtitle1),
|
||||
Text(
|
||||
"inputs such as body temperature, etc.",
|
||||
includeOtherInputsSubTitle,
|
||||
style: Theme.of(context).textTheme.caption,
|
||||
),
|
||||
SizedBox(
|
||||
|
@ -86,10 +86,10 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
),
|
||||
),
|
||||
// Incoming or outgoing
|
||||
Text("Incoming or Outgoing? ",
|
||||
Text(incomingORoutgoing,
|
||||
style: Theme.of(context).textTheme.subtitle1),
|
||||
Text(
|
||||
"incoming for entrance outgoing for exit.",
|
||||
incomingORoutgoingSubTitle,
|
||||
style: Theme.of(context).textTheme.caption,
|
||||
),
|
||||
FittedBox(
|
||||
|
@ -117,12 +117,12 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
FormBuilderDropdown<String?>(
|
||||
name: 'level',
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration: normalTextFieldStyle("Select level", "level"),
|
||||
errorText: fieldIsRequired),
|
||||
decoration: normalTextFieldStyle(selectLevel, "level"),
|
||||
items: levels
|
||||
.map((level) => DropdownMenuItem(
|
||||
child: Text(level),
|
||||
value: level,
|
||||
child: Text(level),
|
||||
))
|
||||
.toList(),
|
||||
// value: selectedLevel,
|
||||
|
@ -138,12 +138,14 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
FormBuilderDropdown<String?>(
|
||||
name: 'establishment',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Select establishment", "establishments"),
|
||||
selectedEstablishment, "establishments"),
|
||||
isExpanded: true,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: fieldIsRequired),
|
||||
items: establishments
|
||||
.map((est) => DropdownMenuItem(
|
||||
child: Text(est),
|
||||
value: est,
|
||||
child: Text(est),
|
||||
))
|
||||
.toList(),
|
||||
// value: selectedArea,
|
||||
|
@ -155,12 +157,12 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
),
|
||||
DropdownButtonFormField<String?>(
|
||||
decoration: normalTextFieldStyle(
|
||||
"Select establishment", "establishments"),
|
||||
selectEstablishment, "establishments"),
|
||||
isExpanded: true,
|
||||
items: establishments
|
||||
.map((est) => DropdownMenuItem(
|
||||
child: Text(est),
|
||||
value: est,
|
||||
child: Text(est),
|
||||
))
|
||||
.toList(),
|
||||
// value: selectedArea,
|
||||
|
|
|
@ -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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
|
||||
InputDecoration normalTextFieldStyle(String labelText, String hintText) {
|
||||
return InputDecoration(
|
||||
|
@ -53,6 +54,7 @@ InputDecoration loginTextFieldStyle() {
|
|||
floatingLabelBehavior: FloatingLabelBehavior.never,
|
||||
prefixIcon: const Icon(
|
||||
Icons.person,
|
||||
color: primary,
|
||||
),
|
||||
labelText: 'Username',
|
||||
hintText: 'Enter your username...',
|
||||
|
|
|
@ -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:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/utils/global.dart';
|
||||
|
||||
confirmAlert(context, Function() yes) {
|
||||
CoolAlert.show(
|
||||
loopAnimation: true,
|
||||
context: context,
|
||||
type: CoolAlertType.confirm,
|
||||
title: 'LOGOUT!',
|
||||
text: 'Are you sure you want to logout?',
|
||||
cancelBtnText: 'No',
|
||||
confirmBtnText: 'Yes',
|
||||
confirmBtnColor: second,
|
||||
showCancelBtn: true,
|
||||
barrierDismissible: false,
|
||||
onConfirmBtnTap: yes);
|
||||
AwesomeDialog(
|
||||
context: context,
|
||||
dialogType: DialogType.question,
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.green,
|
||||
width: 0,
|
||||
),
|
||||
width: blockSizeHorizontal * 90,
|
||||
buttonsBorderRadius: const BorderRadius.all(
|
||||
Radius.circular(2),
|
||||
),
|
||||
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) {
|
||||
CoolAlert.show(
|
||||
errorAlert(context, title, description) {
|
||||
AwesomeDialog(
|
||||
width: blockSizeHorizontal * 90,
|
||||
context: context,
|
||||
type: CoolAlertType.error,
|
||||
confirmBtnColor: second,
|
||||
title: 'Login Failed!',
|
||||
text: 'username or password is incorrect.',
|
||||
loopAnimation: false,
|
||||
);
|
||||
dialogType: DialogType.error,
|
||||
animType: AnimType.scale,
|
||||
headerAnimationLoop: false,
|
||||
title: title,
|
||||
desc: description,
|
||||
btnOkOnPress: () {},
|
||||
btnOkColor: Colors.red,
|
||||
).show();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import 'package:go_router/go_router.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/request_receipt.dart';
|
||||
import '../screens/sos/add_mobile.dart';
|
||||
|
@ -15,6 +19,10 @@ final GoRouter goRouter = GoRouter(routes: <GoRoute>[
|
|||
name: 'login',
|
||||
builder: (context, state) => UniT2Login(),
|
||||
routes: [
|
||||
GoRoute(
|
||||
name: 'register',
|
||||
path: 'register',
|
||||
builder: ((context, state) => const Register())),
|
||||
GoRoute(
|
||||
name: 'home',
|
||||
path: 'home',
|
||||
|
@ -23,7 +31,14 @@ final GoRouter goRouter = GoRouter(routes: <GoRoute>[
|
|||
GoRoute(
|
||||
name: '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(
|
||||
name: 'add-mobile',
|
||||
|
|
|
@ -36,7 +36,34 @@ const String documentTitle = "Document Title";
|
|||
const String documentSubject = "Document Subject";
|
||||
const String documentType = "Document Type";
|
||||
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";
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import 'package:form_builder_validators/form_builder_validators.dart';
|
|||
import '../utils/text_container.dart';
|
||||
|
||||
final mobileNumberValidator = FormBuilderValidators.compose([
|
||||
FormBuilderValidators.minLength(11),
|
||||
FormBuilderValidators.equalLength(11),
|
||||
FormBuilderValidators.required(errorText: mobileNumberRequired),
|
||||
FormBuilderValidators.numeric(errorText: numericValidator)
|
||||
]);
|
||||
|
|
|
@ -29,6 +29,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -106,13 +113,6 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -176,13 +176,6 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
flare_flutter:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flare_flutter
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
|
@ -301,6 +294,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.1"
|
||||
graphs:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: graphs
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
http:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -315,6 +315,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.2"
|
||||
image:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.2.2"
|
||||
intl:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -350,13 +357,6 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
lottie:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lottie
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.4.3"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -532,6 +532,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
rive:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: rive
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.1"
|
||||
rxdart:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -602,6 +609,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
signature:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: signature
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.3.0"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
|
|
|
@ -56,8 +56,9 @@ dependencies:
|
|||
date_time_picker: ^2.1.0
|
||||
flutter_progress_hud: ^2.0.2
|
||||
barcode_scan2: ^4.2.1
|
||||
cool_alert: ^1.1.0
|
||||
qr_flutter: ^4.0.0
|
||||
signature: ^5.3.0
|
||||
awesome_dialog: ^3.0.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
|
Loading…
Reference in New Issue