add costum alerts and finalize profile user interface
parent
cbca4ec97d
commit
8d5f713e52
|
@ -1,5 +1,6 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.example.unit2">
|
package="com.example.unit2">
|
||||||
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
<application
|
<application
|
||||||
android:label="unit2"
|
android:label="unit2"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
|
|
|
@ -63,7 +63,7 @@ class _MenuScreenState extends State<MenuScreen> {
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: FractionalOffset.bottomLeft,
|
alignment: FractionalOffset.bottomLeft,
|
||||||
child: getTile(WebSymbols.logout, "Logout", '/', context),
|
child: getTile(WebSymbols.logout, "Logout", 'login', context),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
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 '../../../../theme-data.dart/colors.dart';
|
import '../../../../theme-data.dart/colors.dart';
|
||||||
|
|
||||||
Widget getTile(
|
Widget getTile(
|
||||||
|
@ -17,9 +18,13 @@ Widget getTile(
|
||||||
style: const TextStyle(color: Colors.black),
|
style: const TextStyle(color: Colors.black),
|
||||||
),
|
),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
debugPrint(title);
|
if (title.toLowerCase() == "logout") {
|
||||||
ZoomDrawer.of(context)!.toggle();
|
confirmAlert(context, () {
|
||||||
|
context.goNamed("login");
|
||||||
|
});
|
||||||
|
} else {
|
||||||
context.goNamed(route);
|
context.goNamed(route);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
|
import 'package:barcode_scan2/barcode_scan2.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||||
import 'package:fluttericon/font_awesome5_icons.dart';
|
import 'package:fluttericon/font_awesome5_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:go_router/go_router.dart';
|
||||||
|
|
||||||
|
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||||
|
import 'package:unit2/utils/alerts.dart';
|
||||||
|
import 'package:unit2/utils/scanner.dart';
|
||||||
import 'package:unit2/utils/text_container.dart';
|
import 'package:unit2/utils/text_container.dart';
|
||||||
|
|
||||||
import '../../../widgets/wave.dart';
|
import '../../../widgets/wave.dart';
|
||||||
import '../../../utils/global.dart';
|
import '../../../utils/global.dart';
|
||||||
import '../../../theme-data.dart/colors.dart';
|
import '../../../theme-data.dart/colors.dart';
|
||||||
|
@ -29,215 +35,234 @@ class _UniT2LoginState extends State<UniT2Login> {
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: pressAgainToExit,
|
onWillPop: pressAgainToExit,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
body: SizedBox(
|
body: ProgressHUD(
|
||||||
child: SingleChildScrollView(
|
child: Builder(builder: (context) {
|
||||||
child: Stack(
|
return SizedBox(
|
||||||
children: [
|
child: SingleChildScrollView(
|
||||||
Positioned(
|
child: Stack(
|
||||||
bottom: 0,
|
children: [
|
||||||
right: 0,
|
Positioned(
|
||||||
child: WaveReverse(height: blockSizeVertical * 7)),
|
bottom: 0,
|
||||||
SizedBox(
|
right: 0,
|
||||||
height: blockSizeVertical * 100,
|
child: WaveReverse(height: blockSizeVertical * 7)),
|
||||||
child: FormBuilder(
|
SizedBox(
|
||||||
key: _formKey,
|
height: blockSizeVertical * 100,
|
||||||
child: Padding(
|
child: FormBuilder(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 25),
|
key: _formKey,
|
||||||
child: Column(
|
child: Padding(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
padding: const EdgeInsets.symmetric(horizontal: 25),
|
||||||
children: <Widget>[
|
child: Column(
|
||||||
SizedBox(height: blockSizeVertical * 7),
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
SvgPicture.asset(
|
children: <Widget>[
|
||||||
'assets/svgs/logo.svg',
|
SizedBox(height: blockSizeVertical * 7),
|
||||||
height: blockSizeVertical * 16,
|
SvgPicture.asset(
|
||||||
allowDrawingOutsideViewBox: true,
|
'assets/svgs/logo.svg',
|
||||||
color: primary,
|
height: blockSizeVertical * 16,
|
||||||
),
|
allowDrawingOutsideViewBox: true,
|
||||||
|
color: primary,
|
||||||
Text(
|
|
||||||
welcome,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: blockSizeVertical * 5,
|
|
||||||
fontWeight: FontWeight.w600),
|
|
||||||
),
|
|
||||||
Text(unitApp,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: blockSizeVertical * 8,
|
|
||||||
fontWeight: FontWeight.w800,
|
|
||||||
letterSpacing: .2,
|
|
||||||
height: 1,
|
|
||||||
color: primary)),
|
|
||||||
Text(
|
|
||||||
loginToContinue,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: blockSizeVertical * 2,
|
|
||||||
height: 1.5,
|
|
||||||
fontWeight: FontWeight.w600),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: blockSizeVertical * 1.5,
|
|
||||||
),
|
|
||||||
// USERNAME
|
|
||||||
FormBuilderTextField(
|
|
||||||
name: 'username',
|
|
||||||
validator: FormBuilderValidators.required(
|
|
||||||
errorText: "Username is required"),
|
|
||||||
autofocus: false,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: Colors.black87),
|
|
||||||
decoration: loginTextFieldStyle()),
|
|
||||||
SizedBox(
|
|
||||||
height: blockSizeVertical * 1.5,
|
|
||||||
),
|
|
||||||
// PASSWORD
|
|
||||||
FormBuilderTextField(
|
|
||||||
name: 'password',
|
|
||||||
validator: FormBuilderValidators.required(
|
|
||||||
errorText: "Password is required"),
|
|
||||||
|
|
||||||
// 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,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: blockSizeVertical * 2,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: blockSizeVertical * 7,
|
|
||||||
// Login Button
|
|
||||||
child: SizedBox(
|
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
child: ElevatedButton(
|
|
||||||
style: mainBtnStyle(
|
|
||||||
second, Colors.transparent, Colors.white54),
|
|
||||||
child: const Text(
|
|
||||||
"LOGIN",
|
|
||||||
style: TextStyle(color: Colors.white),
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
if (_formKey.currentState!
|
|
||||||
.saveAndValidate()) {
|
|
||||||
context.go(context.namedLocation('home'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// if (_formKey.currentState.validate()) {
|
|
||||||
// _formKey.currentState.save();
|
|
||||||
// BlocProvider.of<UserBloc>(context)
|
|
||||||
// .add(UserWebLogin(
|
|
||||||
// password: password,
|
|
||||||
// username: username));
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: blockSizeVertical * 1.5,
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(
|
Text(
|
||||||
height: blockSizeVertical * 7,
|
welcome,
|
||||||
child: SizedBox(
|
style: TextStyle(
|
||||||
|
fontSize: blockSizeVertical * 5,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
Text(unitApp,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: blockSizeVertical * 8,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
letterSpacing: .2,
|
||||||
|
height: 1,
|
||||||
|
color: primary)),
|
||||||
|
Text(
|
||||||
|
loginToContinue,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: blockSizeVertical * 2,
|
||||||
|
height: 1.5,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 1.5,
|
||||||
|
),
|
||||||
|
// USERNAME
|
||||||
|
FormBuilderTextField(
|
||||||
|
name: 'username',
|
||||||
|
validator: FormBuilderValidators.required(
|
||||||
|
errorText: "Username is required"),
|
||||||
|
autofocus: false,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.black87),
|
||||||
|
decoration: loginTextFieldStyle()),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 1.5,
|
||||||
|
),
|
||||||
|
// PASSWORD
|
||||||
|
FormBuilderTextField(
|
||||||
|
name: 'password',
|
||||||
|
validator: FormBuilderValidators.required(
|
||||||
|
errorText: "Password is required"),
|
||||||
|
|
||||||
|
// 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,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 2,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 7,
|
||||||
|
// Login Button
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: mainBtnStyle(second,
|
||||||
|
Colors.transparent, Colors.white54),
|
||||||
|
child: const Text(
|
||||||
|
login,
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
final progress = ProgressHUD.of(context);
|
||||||
|
progress?.showWithText(
|
||||||
|
'Logging in...',
|
||||||
|
);
|
||||||
|
Future.delayed(const Duration(seconds: 5),
|
||||||
|
() {
|
||||||
|
progress!.dismiss();
|
||||||
|
|
||||||
|
context.goNamed("home");
|
||||||
|
});
|
||||||
|
// if (_formKey.currentState!
|
||||||
|
// .saveAndValidate()) {
|
||||||
|
// context.go(context.namedLocation('home'));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (_formKey.currentState.validate()) {
|
||||||
|
// _formKey.currentState.save();
|
||||||
|
// BlocProvider.of<UserBloc>(context)
|
||||||
|
// .add(UserWebLogin(
|
||||||
|
// password: password,
|
||||||
|
// username: username));
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 1.5,
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 7,
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
child: ElevatedButton.icon(
|
||||||
|
style: mainBtnStyle(Colors.white, second,
|
||||||
|
primary.withOpacity(.4)),
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.qr_code,
|
||||||
|
color: second,
|
||||||
|
),
|
||||||
|
label: const Text(
|
||||||
|
loginViaQr,
|
||||||
|
style: TextStyle(color: second),
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
ScanResult result =
|
||||||
|
await QRCodeBarCodeScanner.instance
|
||||||
|
.scanner();
|
||||||
|
|
||||||
|
debugPrint(result.type.toString());
|
||||||
|
debugPrint(
|
||||||
|
result.rawContent.toString());
|
||||||
|
// BlocProvider.of<UserBloc>(context)
|
||||||
|
// .add(QRCodelogin());
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 1,
|
||||||
|
),
|
||||||
|
const LoginViaQr(text: emergencyReponseLabel),
|
||||||
|
SizedBox(
|
||||||
|
height: blockSizeVertical * 1,
|
||||||
|
),
|
||||||
|
// REQUEST SOS
|
||||||
|
SizedBox(
|
||||||
|
height: screenHeight * .07,
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
child: ElevatedButton.icon(
|
child: ElevatedButton.icon(
|
||||||
style: mainBtnStyle(Colors.white, second,
|
icon: const Icon(
|
||||||
primary.withOpacity(.4)),
|
FontAwesome5.life_ring,
|
||||||
icon: const Icon(
|
color: Colors.white,
|
||||||
Icons.qr_code,
|
),
|
||||||
color: second,
|
style: mainBtnStyle(third,
|
||||||
),
|
Colors.transparent, Colors.white38),
|
||||||
label: const Text(
|
onPressed: () {
|
||||||
loginViaQr,
|
context.goNamed('add-mobile');
|
||||||
style: TextStyle(color: second),
|
},
|
||||||
),
|
label: const Text(
|
||||||
onPressed: () async {
|
requestSOS,
|
||||||
context.go(context.namedLocation('home'));
|
style: TextStyle(color: Colors.white),
|
||||||
|
)),
|
||||||
// BlocProvider.of<UserBloc>(context)
|
)
|
||||||
// .add(QRCodelogin());
|
],
|
||||||
},
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
SizedBox(
|
|
||||||
height: blockSizeVertical * 1,
|
|
||||||
),
|
),
|
||||||
const LoginViaQr(text: emergencyReponseLabel),
|
),
|
||||||
SizedBox(
|
|
||||||
height: blockSizeVertical * 1,
|
|
||||||
),
|
|
||||||
// REQUEST SOS
|
|
||||||
SizedBox(
|
|
||||||
height: screenHeight * .07,
|
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
child: ElevatedButton.icon(
|
|
||||||
icon: const Icon(
|
|
||||||
FontAwesome5.life_ring,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
style: mainBtnStyle(
|
|
||||||
third, Colors.transparent, Colors.white38),
|
|
||||||
onPressed: () {
|
|
||||||
context.goNamed('add-mobile');
|
|
||||||
},
|
|
||||||
label: const Text(
|
|
||||||
requestSOS,
|
|
||||||
style: TextStyle(color: Colors.white),
|
|
||||||
)),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
);
|
||||||
),
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.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/web_symbols_icons.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
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 '../../../theme-data.dart/colors.dart';
|
||||||
import './components/cover-image.dart';
|
import './components/cover-image.dart';
|
||||||
|
|
||||||
class Profile extends StatelessWidget {
|
class Profile extends StatelessWidget {
|
||||||
|
@ -15,26 +21,40 @@ class Profile extends StatelessWidget {
|
||||||
},
|
},
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
body: Stack(
|
body: SizedBox(
|
||||||
clipBehavior: Clip.none,
|
width: screenWidth,
|
||||||
alignment: Alignment.center,
|
child: Stack(
|
||||||
children: [
|
clipBehavior: Clip.none,
|
||||||
const CoverImage(),
|
alignment: Alignment.center,
|
||||||
const Positioned(top: 125, child: BuildProfileImage()),
|
children: [
|
||||||
Positioned(
|
const CoverImage(),
|
||||||
top: 10,
|
const Positioned(top: 125, child: BuildProfileImage()),
|
||||||
left: 20,
|
Positioned(
|
||||||
child: IconButton(
|
top: 10,
|
||||||
onPressed: () {
|
left: 20,
|
||||||
context.go(context.namedLocation('home'));
|
child: IconButton(
|
||||||
},
|
onPressed: () {
|
||||||
icon: const Icon(
|
context.go(context.namedLocation('home'));
|
||||||
FontAwesome5.arrow_left,
|
},
|
||||||
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,
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -46,35 +66,55 @@ class BuildInformation extends StatelessWidget {
|
||||||
const BuildInformation({super.key});
|
const BuildInformation({super.key});
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return Container(
|
||||||
children: [
|
padding: const EdgeInsets.symmetric(horizontal: 25),
|
||||||
const SizedBox(
|
width: screenWidth,
|
||||||
height: 8,
|
child: Column(
|
||||||
),
|
children: [
|
||||||
Text(
|
const SizedBox(
|
||||||
"Rodolfo Bernales Acuin",
|
height: 25,
|
||||||
style: Theme.of(context)
|
),
|
||||||
.textTheme
|
Text(
|
||||||
.headline5!
|
"Rodolfo Bernales Acuin",
|
||||||
.copyWith(fontWeight: FontWeight.bold),
|
style: Theme.of(context)
|
||||||
),
|
.textTheme
|
||||||
Row(
|
.headline5!
|
||||||
children: [
|
.copyWith(fontWeight: FontWeight.bold),
|
||||||
Icon(
|
),
|
||||||
FontAwesome5.birthday_cake,
|
const SizedBox(
|
||||||
color: Colors.blueAccent,
|
height: 10,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"july 14, 1994 | Male",
|
||||||
|
style: Theme.of(context).textTheme.caption!.copyWith(fontSize: 18),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
QrImage(
|
||||||
|
data: uuid,
|
||||||
|
size: blockSizeVertical * 30,
|
||||||
|
),
|
||||||
|
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: () {},
|
||||||
),
|
),
|
||||||
const SizedBox(
|
),
|
||||||
width: 20,
|
const SizedBox(
|
||||||
),
|
height: 5,
|
||||||
Text(
|
),
|
||||||
"july 14, 1994 | Male",
|
],
|
||||||
style:
|
),
|
||||||
Theme.of(context).textTheme.caption!.copyWith(fontSize: 22),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,12 +129,12 @@ class BuildProfileImage extends StatelessWidget {
|
||||||
Stack(
|
Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
CircleAvatar(
|
const CircleAvatar(
|
||||||
radius: 85,
|
radius: 72,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
),
|
),
|
||||||
CircleAvatar(
|
CircleAvatar(
|
||||||
radius: 80,
|
radius: 69,
|
||||||
backgroundColor: Colors.grey.shade800,
|
backgroundColor: Colors.grey.shade800,
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
'assets/svgs/male.svg',
|
'assets/svgs/male.svg',
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import 'package:azlistview/azlistview.dart';
|
import 'package:azlistview/azlistview.dart';
|
||||||
|
String uuid = 'f68c3142-b939-11ec-9acb-3939f0cc109a';
|
||||||
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 = [
|
List<String> checkPointAreas = [
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
import 'package:cool_alert/cool_alert.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:unit2/theme-data.dart/colors.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);
|
||||||
|
}
|
||||||
|
|
||||||
|
errorAlert(context) {
|
||||||
|
CoolAlert.show(
|
||||||
|
context: context,
|
||||||
|
type: CoolAlertType.error,
|
||||||
|
confirmBtnColor: second,
|
||||||
|
title: 'Login Failed!',
|
||||||
|
text: 'username or password is incorrect.',
|
||||||
|
loopAnimation: false,
|
||||||
|
);
|
||||||
|
}
|
|
@ -13,7 +13,7 @@ final GoRouter goRouter = GoRouter(routes: <GoRoute>[
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'login',
|
name: 'login',
|
||||||
builder: (context, state) => Register(),
|
builder: (context, state) => UniT2Login(),
|
||||||
routes: [
|
routes: [
|
||||||
GoRoute(
|
GoRoute(
|
||||||
name: 'home',
|
name: 'home',
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
import 'package:barcode_scan2/barcode_scan2.dart';
|
||||||
|
|
||||||
|
class QRCodeBarCodeScanner {
|
||||||
|
static final QRCodeBarCodeScanner _instance = QRCodeBarCodeScanner();
|
||||||
|
static QRCodeBarCodeScanner get instance => _instance;
|
||||||
|
final _selectedCamera = -1;
|
||||||
|
final bool _useAutoFocus = true;
|
||||||
|
static final _possibleFormats = BarcodeFormat.values.toList()
|
||||||
|
..removeWhere((e) => e == BarcodeFormat.unknown);
|
||||||
|
ScanResult scanResult = ScanResult();
|
||||||
|
|
||||||
|
List<BarcodeFormat> selectedFormats = [..._possibleFormats];
|
||||||
|
|
||||||
|
Future<ScanResult> scanner() async {
|
||||||
|
ScanOptions options = ScanOptions(
|
||||||
|
strings: {
|
||||||
|
"cancel": "Back",
|
||||||
|
"flash_on": "Flash on",
|
||||||
|
"flash_off": "Flash off",
|
||||||
|
},
|
||||||
|
restrictFormat: selectedFormats,
|
||||||
|
useCamera: _selectedCamera,
|
||||||
|
// autoEnableFlash: _autoEnableFlash,
|
||||||
|
android: AndroidOptions(
|
||||||
|
// aspectTolerance: _aspectTolerance,
|
||||||
|
useAutoFocus: _useAutoFocus,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
try {
|
||||||
|
scanResult = await BarcodeScanner.scan(options: options);
|
||||||
|
} on Error catch (e) {
|
||||||
|
throw (e.toString());
|
||||||
|
}
|
||||||
|
return scanResult;
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,6 +8,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.2"
|
version: "3.0.2"
|
||||||
|
archive:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: archive
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.3.5"
|
||||||
async:
|
async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -29,6 +36,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.0.0"
|
||||||
|
barcode_scan2:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: barcode_scan2
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.2.1"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -78,6 +92,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.16.0"
|
version: "1.16.0"
|
||||||
|
convert:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: convert
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.1"
|
||||||
convex_bottom_bar:
|
convex_bottom_bar:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -85,6 +106,13 @@ 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:
|
||||||
|
@ -141,6 +169,20 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.4"
|
version: "6.1.4"
|
||||||
|
fixnum:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: fixnum
|
||||||
|
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:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -186,6 +228,13 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_progress_hud:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_progress_hud
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.2"
|
||||||
flutter_spinkit:
|
flutter_spinkit:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -301,6 +350,13 @@ 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:
|
||||||
|
@ -434,6 +490,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.3"
|
version: "2.1.3"
|
||||||
|
pointycastle:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: pointycastle
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.6.2"
|
||||||
process:
|
process:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -441,6 +504,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2.4"
|
version: "4.2.4"
|
||||||
|
protobuf:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: protobuf
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
provider:
|
provider:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -448,6 +518,20 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.4"
|
version: "6.0.4"
|
||||||
|
qr:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: qr
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
|
qr_flutter:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: qr_flutter
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.0"
|
||||||
rxdart:
|
rxdart:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -54,6 +54,10 @@ dependencies:
|
||||||
azlistview: ^2.0.0
|
azlistview: ^2.0.0
|
||||||
intl: ^0.17.0
|
intl: ^0.17.0
|
||||||
date_time_picker: ^2.1.0
|
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
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
Loading…
Reference in New Issue