create user interface for registration in charge and create password for new user
parent
7b880a08bd
commit
cbca4ec97d
|
@ -0,0 +1,25 @@
|
||||||
|
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';
|
||||||
|
|
||||||
|
class DocInfo extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
final String subTitle;
|
||||||
|
const DocInfo({super.key, required this.title, required this.subTitle});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ListTile(
|
||||||
|
dense: true,
|
||||||
|
title: Text(
|
||||||
|
title,
|
||||||
|
style: titleTextStyle()
|
||||||
|
.copyWith(color: Colors.black87, fontSize: blockSizeVertical * 2),
|
||||||
|
),
|
||||||
|
subtitle: Text(subTitle),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,156 @@
|
||||||
|
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';
|
||||||
|
import 'package:unit2/screens/docsms/components/doc_info_tile.dart';
|
||||||
|
import 'package:unit2/theme-data.dart/colors.dart';
|
||||||
|
import 'package:unit2/utils/text_container.dart';
|
||||||
|
import 'package:unit2/widgets/costum_divider.dart';
|
||||||
|
import 'package:unit2/widgets/text_icon.dart';
|
||||||
|
|
||||||
|
import '../../test_data.dart';
|
||||||
|
import '../../theme-data.dart/btn-style.dart';
|
||||||
|
import '../../theme-data.dart/form-style.dart';
|
||||||
|
import '../../utils/global.dart';
|
||||||
|
|
||||||
|
class RequetAutoReceipt extends StatefulWidget {
|
||||||
|
RequetAutoReceipt({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<RequetAutoReceipt> createState() => _RequetAutoReceiptState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RequetAutoReceiptState extends State<RequetAutoReceipt> {
|
||||||
|
final _formKey = GlobalKey<FormBuilderState>();
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SafeArea(
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: primary,
|
||||||
|
),
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
// ignore: avoid_unnecessary_containers
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||||
|
child:
|
||||||
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
|
const DocInfo(title: "4427", subTitle: documentId),
|
||||||
|
const CostumDivider(),
|
||||||
|
const DocInfo(title: "Purchase of Diesel", subTitle: documentTitle),
|
||||||
|
const CostumDivider(),
|
||||||
|
const DocInfo(title: "N/A", subTitle: documentSubject),
|
||||||
|
const CostumDivider(),
|
||||||
|
const DocInfo(title: "Request for Quotation", subTitle: documentType),
|
||||||
|
const CostumDivider(),
|
||||||
|
Form(
|
||||||
|
child: Column(children: [
|
||||||
|
FormBuilder(
|
||||||
|
key: _formKey,
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 12, horizontal: 25),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const TextIcon(title: "Source", icon: Entypo.reply),
|
||||||
|
const SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"Source Remarks",
|
||||||
|
style: Theme.of(context).textTheme.caption,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
FormBuilderTextField(
|
||||||
|
name: "remarks",
|
||||||
|
validator: FormBuilderValidators.compose([
|
||||||
|
FormBuilderValidators.required(
|
||||||
|
errorText: "Remarks is required")
|
||||||
|
]),
|
||||||
|
autovalidateMode:
|
||||||
|
AutovalidateMode.onUserInteraction,
|
||||||
|
maxLines: 5,
|
||||||
|
decoration: normalTextFieldStyle(
|
||||||
|
"Enter your remarks", "..."),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
const TextIcon(
|
||||||
|
title: "Destination", icon: Entypo.forward),
|
||||||
|
const SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
FormBuilderDropdown<String?>(
|
||||||
|
name: 'department',
|
||||||
|
autofocus: false,
|
||||||
|
validator: FormBuilderValidators.compose([
|
||||||
|
FormBuilderValidators.required(
|
||||||
|
errorText: "Department is required")
|
||||||
|
]),
|
||||||
|
decoration:
|
||||||
|
normalTextFieldStyle("Department", ""),
|
||||||
|
items: puroks
|
||||||
|
.map((purok) => DropdownMenuItem(
|
||||||
|
value: purok,
|
||||||
|
child: Text(purok),
|
||||||
|
))
|
||||||
|
.toList()),
|
||||||
|
const SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
FormBuilderDropdown<String?>(
|
||||||
|
name: 'purok',
|
||||||
|
autofocus: false,
|
||||||
|
validator: FormBuilderValidators.compose([
|
||||||
|
FormBuilderValidators.required(
|
||||||
|
errorText: "Purok is required")
|
||||||
|
]),
|
||||||
|
decoration:
|
||||||
|
normalTextFieldStyle("Substation", ""),
|
||||||
|
items: puroks
|
||||||
|
.map((purok) => DropdownMenuItem(
|
||||||
|
value: purok,
|
||||||
|
child: Text(purok),
|
||||||
|
))
|
||||||
|
.toList()),
|
||||||
|
const SizedBox(
|
||||||
|
height: 24,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
height: screenHeight * .06,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: secondaryBtnStyle(
|
||||||
|
second, Colors.transparent, Colors.white54),
|
||||||
|
child: const Text(
|
||||||
|
"Request Auto Receipt",
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
if (_formKey.currentState!
|
||||||
|
.saveAndValidate()) {
|
||||||
|
debugPrint(_formKey
|
||||||
|
.currentState!.value['remarks']);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
]),
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -94,7 +94,6 @@ class AddMobile extends StatelessWidget {
|
||||||
),
|
),
|
||||||
FormBuilderTextField(
|
FormBuilderTextField(
|
||||||
name: 'mobile2',
|
name: 'mobile2',
|
||||||
validator: mobileNumberValidator,
|
|
||||||
decoration: normalTextFieldStyle(
|
decoration: normalTextFieldStyle(
|
||||||
"mobile number 2", "+63")),
|
"mobile number 2", "+63")),
|
||||||
|
|
||||||
|
@ -113,14 +112,12 @@ class AddMobile extends StatelessWidget {
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.go(
|
if (_formKey.currentState!
|
||||||
context.namedLocation('request-sos'));
|
.saveAndValidate()) {
|
||||||
// if (_formKey.currentState.validate()) {
|
context.go(context
|
||||||
// _formKey.currentState.save();
|
.namedLocation('request-sos'));
|
||||||
// BlocProvider.of<UserBloc>(context)
|
}
|
||||||
// .add(UserWebLogin(
|
|
||||||
// password: password,
|
|
||||||
// username: username));
|
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
),
|
),
|
|
@ -6,7 +6,7 @@ import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:fluttericon/font_awesome5_icons.dart';
|
import 'package:fluttericon/font_awesome5_icons.dart';
|
||||||
import 'package:fluttericon/typicons_icons.dart';
|
import 'package:fluttericon/typicons_icons.dart';
|
||||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||||
import 'package:unit2/screen/sos/components/mobile.dart';
|
import 'package:unit2/screens/sos/components/mobile.dart';
|
||||||
import 'package:unit2/theme-data.dart/colors.dart';
|
import 'package:unit2/theme-data.dart/colors.dart';
|
||||||
import 'package:unit2/utils/text_container.dart';
|
import 'package:unit2/utils/text_container.dart';
|
||||||
|
|
|
@ -161,7 +161,11 @@ class _UniT2LoginState extends State<UniT2Login> {
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
if (_formKey.currentState!
|
||||||
|
.saveAndValidate()) {
|
||||||
context.go(context.namedLocation('home'));
|
context.go(context.namedLocation('home'));
|
||||||
|
}
|
||||||
|
|
||||||
// if (_formKey.currentState.validate()) {
|
// if (_formKey.currentState.validate()) {
|
||||||
// _formKey.currentState.save();
|
// _formKey.currentState.save();
|
||||||
// BlocProvider.of<UserBloc>(context)
|
// BlocProvider.of<UserBloc>(context)
|
||||||
|
@ -193,6 +197,8 @@ class _UniT2LoginState extends State<UniT2Login> {
|
||||||
style: TextStyle(color: second),
|
style: TextStyle(color: second),
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
context.go(context.namedLocation('home'));
|
||||||
|
|
||||||
// BlocProvider.of<UserBloc>(context)
|
// BlocProvider.of<UserBloc>(context)
|
||||||
// .add(QRCodelogin());
|
// .add(QRCodelogin());
|
||||||
},
|
},
|
||||||
|
@ -217,8 +223,7 @@ class _UniT2LoginState extends State<UniT2Login> {
|
||||||
style: mainBtnStyle(
|
style: mainBtnStyle(
|
||||||
third, Colors.transparent, Colors.white38),
|
third, Colors.transparent, Colors.white38),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context
|
context.goNamed('add-mobile');
|
||||||
.go(context.namedLocation('add-mobile'));
|
|
||||||
},
|
},
|
||||||
label: const Text(
|
label: const Text(
|
||||||
requestSOS,
|
requestSOS,
|
|
@ -0,0 +1,202 @@
|
||||||
|
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:flutter_svg/svg.dart';
|
||||||
|
import 'package:fluttericon/font_awesome5_icons.dart';
|
||||||
|
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||||
|
import 'package:unit2/theme-data.dart/btn-style.dart';
|
||||||
|
import 'package:unit2/widgets/wave.dart';
|
||||||
|
|
||||||
|
import '../../../theme-data.dart/colors.dart';
|
||||||
|
import '../../../theme-data.dart/form-style.dart';
|
||||||
|
import '../../../utils/global.dart';
|
||||||
|
import '../../../utils/text_container.dart';
|
||||||
|
import '../../../utils/validators.dart';
|
||||||
|
|
||||||
|
class Register extends StatefulWidget {
|
||||||
|
const Register({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<Register> createState() => _RegisterState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RegisterState extends State<Register> {
|
||||||
|
bool showSuffixIcon = false;
|
||||||
|
bool _showPassword = true;
|
||||||
|
final _formKey = GlobalKey<FormBuilderState>();
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SafeArea(
|
||||||
|
child: Scaffold(
|
||||||
|
resizeToAvoidBottomInset: true,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Wave(height: blockSizeVertical * 8),
|
||||||
|
Positioned(
|
||||||
|
bottom: 0, child: WaveReverse(height: blockSizeVertical * 8)),
|
||||||
|
Container(
|
||||||
|
height: screenHeight * .97,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
|
child: FormBuilder(
|
||||||
|
key: _formKey,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
SvgPicture.asset(
|
||||||
|
'assets/svgs/logo.svg',
|
||||||
|
height: blockSizeVertical * 16,
|
||||||
|
allowDrawingOutsideViewBox: true,
|
||||||
|
color: primary,
|
||||||
|
),
|
||||||
|
Text(unitApp,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: blockSizeVertical * 8,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
letterSpacing: .2,
|
||||||
|
height: 1,
|
||||||
|
color: Colors.black87)),
|
||||||
|
Text(
|
||||||
|
registerToContinue,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: blockSizeVertical * 2,
|
||||||
|
height: 1.5,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
// Password
|
||||||
|
FormBuilderTextField(
|
||||||
|
name: 'password',
|
||||||
|
validator: registerPasswordValidator,
|
||||||
|
// initialValue: state.password,
|
||||||
|
onChanged: (value) {
|
||||||
|
value!.isEmpty
|
||||||
|
? setState(() {
|
||||||
|
showSuffixIcon = false;
|
||||||
|
})
|
||||||
|
: setState(() {
|
||||||
|
showSuffixIcon = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
autofocus: false,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.bold, color: Colors.black87),
|
||||||
|
decoration: loginTextFieldStyle().copyWith(
|
||||||
|
suffixIcon: Visibility(
|
||||||
|
visible: showSuffixIcon,
|
||||||
|
child: _showPassword
|
||||||
|
? IconButton(
|
||||||
|
icon: Icon(FontAwesome5.eye_slash,
|
||||||
|
size: 24,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.displayLarge
|
||||||
|
?.color),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_showPassword = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_showPassword = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: Icon(FontAwesome5.eye,
|
||||||
|
size: 24,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.displayLarge
|
||||||
|
?.color)),
|
||||||
|
),
|
||||||
|
prefixIcon: const Icon(Icons.lock),
|
||||||
|
labelText: "Password",
|
||||||
|
hintText: "Enter Password..."),
|
||||||
|
obscureText: _showPassword ? true : false,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
FormBuilderTextField(
|
||||||
|
name: 'confirmPassword',
|
||||||
|
validator: registerPasswordValidator,
|
||||||
|
// initialValue: state.password,
|
||||||
|
onChanged: (value) {
|
||||||
|
value!.isEmpty
|
||||||
|
? setState(() {
|
||||||
|
showSuffixIcon = false;
|
||||||
|
})
|
||||||
|
: setState(() {
|
||||||
|
showSuffixIcon = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
autofocus: false,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.bold, color: Colors.black87),
|
||||||
|
decoration: loginTextFieldStyle().copyWith(
|
||||||
|
suffixIcon: Visibility(
|
||||||
|
visible: showSuffixIcon,
|
||||||
|
child: _showPassword
|
||||||
|
? IconButton(
|
||||||
|
icon: Icon(FontAwesome5.eye_slash,
|
||||||
|
size: 24,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.displayLarge
|
||||||
|
?.color),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_showPassword = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_showPassword = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: Icon(FontAwesome5.eye,
|
||||||
|
size: 24,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.displayLarge
|
||||||
|
?.color)),
|
||||||
|
),
|
||||||
|
prefixIcon: const Icon(Icons.lock),
|
||||||
|
labelText: "Confirm Password",
|
||||||
|
hintText: "Confirm Password..."),
|
||||||
|
obscureText: _showPassword ? true : false,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
height: blockSizeVertical * 6,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: secondaryBtnStyle(
|
||||||
|
second, Colors.transparent, primary),
|
||||||
|
onPressed: () {
|
||||||
|
if (_formKey.currentState!.saveAndValidate()) {}
|
||||||
|
},
|
||||||
|
child: const Text("Register")),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,7 +4,7 @@ import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:fluttericon/entypo_icons.dart';
|
import 'package:fluttericon/entypo_icons.dart';
|
||||||
import 'package:fluttericon/modern_pictograms_icons.dart';
|
import 'package:fluttericon/modern_pictograms_icons.dart';
|
||||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||||
import 'package:unit2/screen/unit2/roles/qr_code_scanner.dart/components/custom_switch.dart';
|
import 'package:unit2/screens/unit2/roles/qr_code_scanner.dart/components/custom_switch.dart';
|
||||||
import 'package:unit2/test_data.dart';
|
import 'package:unit2/test_data.dart';
|
||||||
import 'package:unit2/utils/text_container.dart';
|
import 'package:unit2/utils/text_container.dart';
|
||||||
import '../../../../theme-data.dart/btn-style.dart';
|
import '../../../../theme-data.dart/btn-style.dart';
|
|
@ -0,0 +1,232 @@
|
||||||
|
import 'package:date_time_picker/date_time_picker.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||||
|
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||||
|
import 'package:unit2/utils/global.dart';
|
||||||
|
import 'package:unit2/utils/text_container.dart';
|
||||||
|
import 'package:unit2/widgets/label.dart';
|
||||||
|
import '../../../../../test_data.dart';
|
||||||
|
import '../../../../../theme-data.dart/btn-style.dart';
|
||||||
|
import '../../../../../theme-data.dart/colors.dart';
|
||||||
|
|
||||||
|
class AddPerson extends StatefulWidget {
|
||||||
|
const AddPerson({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AddPerson> createState() => _AddPersonState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AddPersonState extends State<AddPerson> {
|
||||||
|
final _formKey = GlobalKey<FormBuilderState>();
|
||||||
|
|
||||||
|
DateFormat dteFormat = DateFormat("y-M-d");
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 25),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: FormBuilder(
|
||||||
|
key: _formKey,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const Label(text: basicInformation),
|
||||||
|
//Firstname
|
||||||
|
FormBuilderTextField(
|
||||||
|
name: 'firstname',
|
||||||
|
validator: FormBuilderValidators.required(
|
||||||
|
errorText: "First name is required"),
|
||||||
|
autofocus: false,
|
||||||
|
decoration: normalTextFieldStyle("First name", ""),
|
||||||
|
textCapitalization: TextCapitalization.characters,
|
||||||
|
keyboardType: TextInputType.text,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
//Firstname
|
||||||
|
FormBuilderTextField(
|
||||||
|
name: 'lastname',
|
||||||
|
validator: FormBuilderValidators.required(
|
||||||
|
errorText: "Middle name is required"),
|
||||||
|
autofocus: false,
|
||||||
|
textCapitalization: TextCapitalization.characters,
|
||||||
|
keyboardType: TextInputType.text,
|
||||||
|
decoration: normalTextFieldStyle("Last name", "")),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: FormBuilderTextField(
|
||||||
|
name: 'middlename',
|
||||||
|
validator: FormBuilderValidators.required(
|
||||||
|
errorText: "Middle name is required"),
|
||||||
|
autofocus: false,
|
||||||
|
textCapitalization: TextCapitalization.characters,
|
||||||
|
keyboardType: TextInputType.text,
|
||||||
|
decoration: normalTextFieldStyle("Middle name", "")),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: DateTimePicker(
|
||||||
|
decoration: normalTextFieldStyle("Birth date", ""),
|
||||||
|
initialValue: '',
|
||||||
|
firstDate: DateTime(2000),
|
||||||
|
lastDate: DateTime(2100),
|
||||||
|
dateLabelText: 'Date',
|
||||||
|
onChanged: (val) => print(val),
|
||||||
|
validator: (val) {
|
||||||
|
if (val!.isEmpty) {
|
||||||
|
return "Birthdate is required";
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
onSaved: (val) => print(val),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: FormBuilderTextField(
|
||||||
|
name: 'extension-name',
|
||||||
|
autofocus: false,
|
||||||
|
textCapitalization: TextCapitalization.characters,
|
||||||
|
keyboardType: TextInputType.text,
|
||||||
|
decoration:
|
||||||
|
normalTextFieldStyle("Extenstion name", "")),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: FormBuilderDropdown<String?>(
|
||||||
|
validator: FormBuilderValidators.required(
|
||||||
|
errorText: "Gender is required"),
|
||||||
|
name: 'gender',
|
||||||
|
autofocus: false,
|
||||||
|
decoration: normalTextFieldStyle("Gender", ""),
|
||||||
|
items: genders
|
||||||
|
.map((gender) => DropdownMenuItem(
|
||||||
|
value: gender,
|
||||||
|
child: Text(gender),
|
||||||
|
))
|
||||||
|
.toList()),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const Label(text: address),
|
||||||
|
FormBuilderDropdown<String?>(
|
||||||
|
name: 'region',
|
||||||
|
autofocus: false,
|
||||||
|
validator: FormBuilderValidators.required(
|
||||||
|
errorText: "Region is required"),
|
||||||
|
decoration: normalTextFieldStyle("Region", ""),
|
||||||
|
items: regions
|
||||||
|
.map((region) => DropdownMenuItem(
|
||||||
|
value: region,
|
||||||
|
child: Text(region),
|
||||||
|
))
|
||||||
|
.toList()),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
FormBuilderDropdown<String?>(
|
||||||
|
name: 'province',
|
||||||
|
autofocus: false,
|
||||||
|
validator: FormBuilderValidators.required(
|
||||||
|
errorText: "Province is required"),
|
||||||
|
decoration: normalTextFieldStyle("Province", ""),
|
||||||
|
items: provinces
|
||||||
|
.map((province) => DropdownMenuItem(
|
||||||
|
value: province,
|
||||||
|
child: Text(province),
|
||||||
|
))
|
||||||
|
.toList()),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
FormBuilderDropdown<String?>(
|
||||||
|
name: 'municipality',
|
||||||
|
autofocus: false,
|
||||||
|
validator: FormBuilderValidators.required(
|
||||||
|
errorText: "Municipality is required"),
|
||||||
|
decoration: normalTextFieldStyle("Municipalities", ""),
|
||||||
|
items: municipalities
|
||||||
|
.map((municipality) => DropdownMenuItem(
|
||||||
|
value: municipality,
|
||||||
|
child: Text(municipality),
|
||||||
|
))
|
||||||
|
.toList()),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
FormBuilderDropdown<String?>(
|
||||||
|
name: 'barangay',
|
||||||
|
autofocus: false,
|
||||||
|
validator: FormBuilderValidators.required(
|
||||||
|
errorText: "Barangay is required"),
|
||||||
|
decoration: normalTextFieldStyle("Barangay", ""),
|
||||||
|
items: barangays
|
||||||
|
.map((barangay) => DropdownMenuItem(
|
||||||
|
value: barangay,
|
||||||
|
child: Text(barangay),
|
||||||
|
))
|
||||||
|
.toList()),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
FormBuilderDropdown<String?>(
|
||||||
|
name: 'purok',
|
||||||
|
autofocus: false,
|
||||||
|
validator: FormBuilderValidators.required(
|
||||||
|
errorText: "Purok is required"),
|
||||||
|
decoration: normalTextFieldStyle("Purok", ""),
|
||||||
|
items: puroks
|
||||||
|
.map((purok) => DropdownMenuItem(
|
||||||
|
value: purok,
|
||||||
|
child: Text(purok),
|
||||||
|
))
|
||||||
|
.toList()),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
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: () {
|
||||||
|
print(_formKey.currentState!.value['firstname']);
|
||||||
|
if (_formKey.currentState!.saveAndValidate()) {}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/src/widgets/container.dart';
|
||||||
|
import 'package:flutter/src/widgets/framework.dart';
|
||||||
|
|
||||||
|
class RequestQR extends StatefulWidget {
|
||||||
|
const RequestQR({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<RequestQR> createState() => _RequestQRState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RequestQRState extends State<RequestQR> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
child: Center(child: Text("Request QR")),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
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:fluttericon/entypo_icons.dart';
|
||||||
|
import 'package:fluttericon/font_awesome_icons.dart';
|
||||||
|
import 'package:fluttericon/linearicons_free_icons.dart';
|
||||||
|
import 'package:fluttericon/octicons_icons.dart';
|
||||||
|
import 'package:fluttericon/typicons_icons.dart';
|
||||||
|
import 'package:unit2/widgets/label.dart';
|
||||||
|
|
||||||
|
import '../../../../../theme-data.dart/btn-style.dart';
|
||||||
|
import '../../../../../theme-data.dart/colors.dart';
|
||||||
|
import '../../../../../utils/global.dart';
|
||||||
|
import '../../../../../utils/text_container.dart';
|
||||||
|
|
||||||
|
class SyncData extends StatefulWidget {
|
||||||
|
const SyncData({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<SyncData> createState() => _SyncDataState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SyncDataState extends State<SyncData> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 25),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
const Label(text: syncTitle),
|
||||||
|
Icon(
|
||||||
|
Octicons.sync_icon,
|
||||||
|
size: blockSizeVertical * 25,
|
||||||
|
color: success2,
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
const Text(syncSubTittle),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
height: screenHeight * .06,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: secondaryBtnStyle(
|
||||||
|
second, Colors.transparent, Colors.white54),
|
||||||
|
child: const Text(
|
||||||
|
syncNow,
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,100 @@
|
||||||
|
import 'package:azlistview/azlistview.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/src/widgets/container.dart';
|
||||||
|
import 'package:flutter/src/widgets/framework.dart';
|
||||||
|
import 'package:fluttericon/octicons_icons.dart';
|
||||||
|
import 'package:unit2/theme-data.dart/colors.dart';
|
||||||
|
import 'package:unit2/utils/global.dart';
|
||||||
|
|
||||||
|
import '../../../../../test_data.dart';
|
||||||
|
import '../../../../../theme-data.dart/text-styles.dart';
|
||||||
|
|
||||||
|
class _AZItem extends ISuspensionBean {
|
||||||
|
final String title;
|
||||||
|
final String tag;
|
||||||
|
|
||||||
|
_AZItem({required this.title, required this.tag});
|
||||||
|
|
||||||
|
@override
|
||||||
|
String getSuspensionTag() {
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ViewList extends StatefulWidget {
|
||||||
|
const ViewList({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<ViewList> createState() => _ViewListState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ViewListState extends State<ViewList> {
|
||||||
|
List<_AZItem> convertedPersonList = [];
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
addedPersons.sort(
|
||||||
|
(a, b) => a.lastname.toLowerCase().compareTo(b.lastname.toLowerCase()));
|
||||||
|
initList(addedPersons);
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
void initList(List<Person> persons) {
|
||||||
|
convertedPersonList = persons
|
||||||
|
.map((person) => _AZItem(
|
||||||
|
title: person.lastname + ' ' + person.name,
|
||||||
|
tag: person.lastname[0]))
|
||||||
|
.toList();
|
||||||
|
SuspensionUtil.sortListBySuspensionTag(persons);
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AzListView(
|
||||||
|
data: addedPersons,
|
||||||
|
itemCount: addedPersons.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
final person = convertedPersonList[index];
|
||||||
|
return _buildListItem(person, true);
|
||||||
|
},
|
||||||
|
physics: const BouncingScrollPhysics(),
|
||||||
|
indexBarItemHeight: blockSizeVertical * 3,
|
||||||
|
indexBarData: SuspensionUtil.getTagIndexList(addedPersons),
|
||||||
|
indexBarMargin: const EdgeInsets.all(0),
|
||||||
|
indexBarOptions: const IndexBarOptions(
|
||||||
|
selectItemDecoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
selectTextStyle:
|
||||||
|
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
|
||||||
|
needRebuild: true,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
_buildListItem(_AZItem person, bool selected) {
|
||||||
|
return Card(
|
||||||
|
elevation: 0,
|
||||||
|
child: ListTile(
|
||||||
|
onTap: (() => setState(() {
|
||||||
|
selected = !selected;
|
||||||
|
})),
|
||||||
|
dense: true,
|
||||||
|
subtitle: Text(
|
||||||
|
"December 15 1994",
|
||||||
|
style: Theme.of(context).textTheme.caption,
|
||||||
|
),
|
||||||
|
leading: Checkbox(
|
||||||
|
onChanged: (value) {
|
||||||
|
selected = value!;
|
||||||
|
setState(() {});
|
||||||
|
print(selected);
|
||||||
|
},
|
||||||
|
value: selected,
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
person.title,
|
||||||
|
style: personInfo(),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,88 @@
|
||||||
|
import 'package:convex_bottom_bar/convex_bottom_bar.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/font_awesome_icons.dart';
|
||||||
|
import 'package:fluttericon/iconic_icons.dart';
|
||||||
|
import 'package:unit2/screens/unit2/roles/registration_in_charge/components/add.dart';
|
||||||
|
import 'package:unit2/screens/unit2/roles/registration_in_charge/components/request_qr.dart';
|
||||||
|
import 'package:unit2/screens/unit2/roles/registration_in_charge/components/sync.dart';
|
||||||
|
import 'package:unit2/theme-data.dart/colors.dart';
|
||||||
|
import 'package:unit2/utils/text_container.dart';
|
||||||
|
|
||||||
|
import 'components/view.dart';
|
||||||
|
|
||||||
|
class RegistrationInCharge extends StatefulWidget {
|
||||||
|
const RegistrationInCharge({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<RegistrationInCharge> createState() => _RegistrationInChargeState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RegistrationInChargeState extends State<RegistrationInCharge> {
|
||||||
|
final List<Widget> _pages = [
|
||||||
|
const ViewList(),
|
||||||
|
const AddPerson(),
|
||||||
|
const SyncData(),
|
||||||
|
const RequestQR()
|
||||||
|
];
|
||||||
|
int currentIndex = 0;
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text(registrationInChargeTitle),
|
||||||
|
backgroundColor: second,
|
||||||
|
centerTitle: true,
|
||||||
|
actions: <Widget>[
|
||||||
|
IconButton(
|
||||||
|
// ##SEARCH BUTTON
|
||||||
|
icon: const Icon(Icons.search),
|
||||||
|
color: Colors.white,
|
||||||
|
onPressed: () {
|
||||||
|
// Navigator.pushNamed(context, '/Registration Search');
|
||||||
|
},
|
||||||
|
),
|
||||||
|
PopupMenuButton(
|
||||||
|
onSelected: (value) {
|
||||||
|
// SORT VIA DATE ADDED
|
||||||
|
if (value == 1) {
|
||||||
|
}
|
||||||
|
// SORT VIA LAST NAME
|
||||||
|
else if (value == 2) {}
|
||||||
|
},
|
||||||
|
itemBuilder: (context) => [
|
||||||
|
PopupMenuItem(
|
||||||
|
value: 1,
|
||||||
|
child: Row(
|
||||||
|
children: const <Widget>[Text('Sort By Date Added')],
|
||||||
|
)),
|
||||||
|
PopupMenuItem(
|
||||||
|
value: 2,
|
||||||
|
child: Row(
|
||||||
|
children: const <Widget>[Text('Sort by Lastname')],
|
||||||
|
)),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
bottomNavigationBar: ConvexAppBar(
|
||||||
|
color: Colors.white70,
|
||||||
|
gradient: primaryGradient(),
|
||||||
|
style: TabStyle.react,
|
||||||
|
items: const [
|
||||||
|
TabItem(icon: Entypo.home, title: "Home"),
|
||||||
|
TabItem(icon: Iconic.plus_circle, title: "Add"),
|
||||||
|
TabItem(icon: Iconic.loop, title: "Sync"),
|
||||||
|
TabItem(icon: FontAwesome.qrcode, title: "Request QR"),
|
||||||
|
],
|
||||||
|
initialActiveIndex: 0,
|
||||||
|
onTap: (int i) {
|
||||||
|
setState(() {
|
||||||
|
currentIndex = i;
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
body: _pages[currentIndex],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,3 +1,87 @@
|
||||||
|
import 'package:azlistview/azlistview.dart';
|
||||||
|
|
||||||
List<String> levels = ['Establishments', 'Office'];
|
List<String> levels = ['Establishments', 'Office'];
|
||||||
List<String> establishments = ['Provincial Government of Agusan del Norte'];
|
List<String> establishments = ['Provincial Government of Agusan del Norte'];
|
||||||
List <String> checkPointAreas = ['Agusan Up', 'Bids and Awards Committee','Cabadbaran District Hospital','Commision on Audit'];
|
List<String> checkPointAreas = [
|
||||||
|
'Agusan Up',
|
||||||
|
'Bids and Awards Committee',
|
||||||
|
'Cabadbaran District Hospital',
|
||||||
|
'Commision on Audit'
|
||||||
|
];
|
||||||
|
|
||||||
|
final List<String> genders = ["MALE", "FEMALE"];
|
||||||
|
final List<String> regions = [
|
||||||
|
"Region I",
|
||||||
|
"Region II",
|
||||||
|
"Region III",
|
||||||
|
"Region IV",
|
||||||
|
"Region V"
|
||||||
|
];
|
||||||
|
final List<String> barangays = [
|
||||||
|
"Ambago",
|
||||||
|
"Lingayao",
|
||||||
|
"Obrero",
|
||||||
|
"Bading",
|
||||||
|
"Limaha",
|
||||||
|
"Peqeno"
|
||||||
|
];
|
||||||
|
final List<String> puroks = [
|
||||||
|
"Ambago",
|
||||||
|
"Lingayao",
|
||||||
|
"Obrero",
|
||||||
|
"Bading",
|
||||||
|
"Limaha",
|
||||||
|
"Peqeno"
|
||||||
|
];
|
||||||
|
|
||||||
|
final List<String> municipalities = [
|
||||||
|
"Buenavista",
|
||||||
|
"Butuan City",
|
||||||
|
"Carmen",
|
||||||
|
"Cabadbaran",
|
||||||
|
"Jabonga"
|
||||||
|
];
|
||||||
|
final List<String> provinces = [
|
||||||
|
"Agusan del Norte",
|
||||||
|
"Agusan del Sur",
|
||||||
|
"Surigao del Norte",
|
||||||
|
"Surigao del Sur"
|
||||||
|
];
|
||||||
|
|
||||||
|
List<Person> addedPersons = [
|
||||||
|
Person(name: "Nav", lastname: "Acuin"),
|
||||||
|
Person(name: "Jhonny", lastname: "Agoy"),
|
||||||
|
Person(name: "Philip", lastname: "Amaw"),
|
||||||
|
Person(name: "Jojo", lastname: "Asus"),
|
||||||
|
Person(name: "Naruto", lastname: "Acer"),
|
||||||
|
Person(name: "Agata", lastname: "Azarcon"),
|
||||||
|
Person(name: "Nav", lastname: "Amen"),
|
||||||
|
Person(name: "Cristine", lastname: "Albarina"),
|
||||||
|
Person(name: "Nav", lastname: "Zcuin"),
|
||||||
|
Person(name: "Jhonny", lastname: "Zgoy"),
|
||||||
|
Person(name: "Philip", lastname: "Zmaw"),
|
||||||
|
Person(name: "Jojo", lastname: "Zsus"),
|
||||||
|
Person(name: "Naruto", lastname: "Zcer"),
|
||||||
|
Person(name: "Agata", lastname: "Zzarcon"),
|
||||||
|
Person(name: "Nav", lastname: "Zmen"),
|
||||||
|
Person(name: "Cristine", lastname: "Zlbarina"),
|
||||||
|
Person(name: "Nav", lastname: "Bcuin"),
|
||||||
|
Person(name: "Jhonny", lastname: "Tgoy"),
|
||||||
|
Person(name: "Philip", lastname: "Smaw"),
|
||||||
|
Person(name: "Jojo", lastname: "Dsus"),
|
||||||
|
Person(name: "Naruto", lastname: "Fcer"),
|
||||||
|
Person(name: "Agata", lastname: "Ezarcon"),
|
||||||
|
Person(name: "Nav", lastname: "Cmen"),
|
||||||
|
Person(name: "Cristine", lastname: "Blbarina"),
|
||||||
|
];
|
||||||
|
|
||||||
|
class Person extends ISuspensionBean {
|
||||||
|
final String name;
|
||||||
|
final String lastname;
|
||||||
|
Person({required this.name, required this.lastname});
|
||||||
|
|
||||||
|
@override
|
||||||
|
String getSuspensionTag() {
|
||||||
|
return lastname[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -8,3 +8,10 @@ const fifth = Color(0xfffdfefd);
|
||||||
const success = Color(0xffa5d6a7);
|
const success = Color(0xffa5d6a7);
|
||||||
const success2 = Color(0xff66bb6a);
|
const success2 = Color(0xff66bb6a);
|
||||||
const primary2 = Color(0xff039be5);
|
const primary2 = Color(0xff039be5);
|
||||||
|
|
||||||
|
LinearGradient primaryGradient() {
|
||||||
|
return const LinearGradient(
|
||||||
|
begin: Alignment.topRight,
|
||||||
|
end: Alignment.bottomLeft,
|
||||||
|
colors: [second, Color(0xffFF5151)]);
|
||||||
|
}
|
||||||
|
|
|
@ -5,3 +5,17 @@ TextStyle titleTextStyle() {
|
||||||
return TextStyle(
|
return TextStyle(
|
||||||
fontSize: blockSizeVertical * 2.5, fontWeight: FontWeight.w500);
|
fontSize: blockSizeVertical * 2.5, fontWeight: FontWeight.w500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextStyle personInitials() {
|
||||||
|
return TextStyle(
|
||||||
|
fontSize: blockSizeVertical * 2,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.white);
|
||||||
|
}
|
||||||
|
|
||||||
|
TextStyle personInfo() {
|
||||||
|
return TextStyle(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.black54,
|
||||||
|
fontSize: blockSizeVertical * 2.5);
|
||||||
|
}
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:unit2/screen/unit2/roles/qr_code_scanner.dart/scan.dart';
|
import 'package:unit2/screens/unit2/login/register.dart';
|
||||||
import '../screen/sos/add_mobile.dart';
|
import '../screens/docsms/components/doc_info_tile.dart';
|
||||||
import '../screen/sos/request_sos.dart';
|
import '../screens/docsms/request_receipt.dart';
|
||||||
import '../screen/unit2/login/login.dart';
|
import '../screens/sos/add_mobile.dart';
|
||||||
import '../screen/unit2/homepage.dart/components/drawer-screen.dart';
|
import '../screens/sos/request_sos.dart';
|
||||||
import '../screen/unit2/profile/profile.dart';
|
import '../screens/unit2/login/login.dart';
|
||||||
|
import '../screens/unit2/homepage.dart/components/drawer-screen.dart';
|
||||||
|
import '../screens/unit2/profile/profile.dart';
|
||||||
|
import '../screens/unit2/roles/registration_in_charge/home.dart';
|
||||||
|
|
||||||
final GoRouter goRouter = GoRouter(routes: <GoRoute>[
|
final GoRouter goRouter = GoRouter(routes: <GoRoute>[
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'login',
|
name: 'login',
|
||||||
builder: (context, state) => const QRCodeScanner(),
|
builder: (context, state) => Register(),
|
||||||
routes: [
|
routes: [
|
||||||
GoRoute(
|
GoRoute(
|
||||||
name: 'home',
|
name: 'home',
|
||||||
|
|
|
@ -25,3 +25,18 @@ const String qrScannerTitle = "QR-Code Scanner";
|
||||||
const String establishment = "Establishment";
|
const String establishment = "Establishment";
|
||||||
const String checkpointArea = "Checkpoint Area";
|
const String checkpointArea = "Checkpoint Area";
|
||||||
const String scanMode = 'Scan Mode';
|
const String scanMode = 'Scan Mode';
|
||||||
|
const String registrationInChargeTitle = "Registration In Charge";
|
||||||
|
const String basicInformation = "Basic Information";
|
||||||
|
const String address = "Address";
|
||||||
|
const String syncTitle = "Sync Data";
|
||||||
|
const String syncSubTittle = "Press Sync button to get latest data available";
|
||||||
|
const String syncNow = "SYNC NOW";
|
||||||
|
const String documentId = "Document ID";
|
||||||
|
const String documentTitle = "Document Title";
|
||||||
|
const String documentSubject = "Document Subject";
|
||||||
|
const String documentType = "Document Type";
|
||||||
|
const String registerToContinue = "Create your password to register";
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
|
@ -1,12 +1,14 @@
|
||||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
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.required(
|
FormBuilderValidators.minLength(11),
|
||||||
errorText: mobileNumberRequired),
|
FormBuilderValidators.required(errorText: mobileNumberRequired),
|
||||||
FormBuilderValidators.numeric(
|
FormBuilderValidators.numeric(errorText: numericValidator)
|
||||||
errorText: numericValidator)
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
final registerPasswordValidator = FormBuilderValidators.compose([
|
||||||
|
FormBuilderValidators.required(errorText: "Password is required"),
|
||||||
|
FormBuilderValidators.minLength(6,
|
||||||
|
errorText: "Password must be equal or greater than 6 characters"),
|
||||||
|
]);
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class CostumDivider extends StatelessWidget {
|
||||||
|
const CostumDivider({
|
||||||
|
Key? key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Divider(
|
||||||
|
color: Colors.grey.withOpacity(.5),
|
||||||
|
height: 1,
|
||||||
|
thickness: 1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/src/widgets/container.dart';
|
||||||
|
import 'package:flutter/src/widgets/framework.dart';
|
||||||
|
|
||||||
|
import '../utils/global.dart';
|
||||||
|
|
||||||
|
class Label extends StatelessWidget {
|
||||||
|
final String text;
|
||||||
|
const Label({super.key, required this.text});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||||
|
child: Text(text,
|
||||||
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.displayMedium!
|
||||||
|
.copyWith(fontSize: blockSizeVertical * 2.5)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:unit2/theme-data.dart/text-styles.dart';
|
||||||
|
|
||||||
|
import '../theme-data.dart/colors.dart';
|
||||||
|
|
||||||
|
class TextIcon extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
final IconData icon;
|
||||||
|
|
||||||
|
const TextIcon({Key? key, required this.title, required this.icon})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Wrap(
|
||||||
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: titleTextStyle().copyWith(color: primary, fontSize: 18),
|
||||||
|
),
|
||||||
|
Icon(
|
||||||
|
icon,
|
||||||
|
color: primary,
|
||||||
|
size: 24,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
onPressed: () {
|
||||||
|
print(_formKey.currentState!.value['firstname']);
|
||||||
|
if (_formKey.currentState!.saveAndValidate()) {}
|
||||||
|
},
|
|
@ -22,6 +22,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0"
|
version: "3.0.0"
|
||||||
|
azlistview:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: azlistview
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -71,6 +78,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.16.0"
|
version: "1.16.0"
|
||||||
|
convex_bottom_bar:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: convex_bottom_bar
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0+1"
|
||||||
crypto:
|
crypto:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -85,6 +99,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.5"
|
version: "1.0.5"
|
||||||
|
date_time_picker:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: date_time_picker
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
device_frame:
|
device_frame:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -246,7 +267,7 @@ packages:
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.2"
|
version: "4.0.2"
|
||||||
intl:
|
intl:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: intl
|
name: intl
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
|
@ -434,6 +455,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.27.7"
|
version: "0.27.7"
|
||||||
|
scrollable_positioned_list:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: scrollable_positioned_list
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.3"
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -50,6 +50,10 @@ dependencies:
|
||||||
animate_do: ^3.0.2
|
animate_do: ^3.0.2
|
||||||
flutter_spinkit: ^5.1.0
|
flutter_spinkit: ^5.1.0
|
||||||
toggle_switch: ^2.0.1
|
toggle_switch: ^2.0.1
|
||||||
|
convex_bottom_bar: ^3.1.0+1
|
||||||
|
azlistview: ^2.0.0
|
||||||
|
intl: ^0.17.0
|
||||||
|
date_time_picker: ^2.1.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
Loading…
Reference in New Issue