remove comment and hardcoded states

feature/passo/PASSO-#1-Sync-data-from-device-to-postgre-and-vice-versa
rodolfobacuinjr 2023-01-23 16:43:02 +08:00
parent 9c5239d6b3
commit 9714099af3
14 changed files with 9 additions and 127 deletions

View File

@ -1,11 +1,9 @@
import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:bloc/bloc.dart'; import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:unit2/model/login_data/user_info/user_data.dart'; import 'package:unit2/model/login_data/user_info/user_data.dart';
import 'package:unit2/model/login_data/version_info.dart'; import 'package:unit2/model/login_data/version_info.dart';
import 'package:unit2/sevices/login_service/auth_service.dart'; import 'package:unit2/sevices/login_service/auth_service.dart';
import 'package:unit2/widgets/error_state.dart';
import '../../utils/scanner.dart'; import '../../utils/scanner.dart';

View File

@ -20,7 +20,6 @@ class UserLogin extends UserEvent {
} }
class LoadLoggedInUser extends UserEvent { class LoadLoggedInUser extends UserEvent {
// final UserData? userData;
LoadLoggedInUser(); LoadLoggedInUser();
} }

View File

@ -1,9 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:fluttericon/font_awesome_icons.dart';
import 'package: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/theme-data.dart/text-styles.dart';
import 'package:unit2/utils/screen_info.dart'; import 'package:unit2/utils/screen_info.dart';
import '../../theme-data.dart/btn-style.dart'; import '../../theme-data.dart/btn-style.dart';
@ -112,8 +109,7 @@ class AddMobile extends StatelessWidget {
onPressed: () { onPressed: () {
if (_formKey.currentState! if (_formKey.currentState!
.saveAndValidate()) { .saveAndValidate()) {
context.go(context
.namedLocation('request-sos'));
} }
// } // }

View File

@ -3,12 +3,10 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_progress_hud/flutter_progress_hud.dart'; import 'package:flutter_progress_hud/flutter_progress_hud.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:go_router/go_router.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:qr_flutter/qr_flutter.dart'; import 'package:qr_flutter/qr_flutter.dart';
import 'package:unit2/bloc/bloc/user_bloc.dart'; import 'package:unit2/bloc/bloc/user_bloc.dart';
import 'package:unit2/model/login_data/user_info/user_data.dart'; import 'package:unit2/model/login_data/user_info/user_data.dart';
import 'package:unit2/test_data.dart';
import 'package:unit2/theme-data.dart/btn-style.dart'; import 'package:unit2/theme-data.dart/btn-style.dart';
import 'package:unit2/utils/global.dart'; import 'package:unit2/utils/global.dart';
import 'package:unit2/utils/text_container.dart'; import 'package:unit2/utils/text_container.dart';
@ -161,7 +159,6 @@ class BuildInformation extends StatelessWidget {
style: style:
mainBtnStyle(third, Colors.transparent, Colors.white54), mainBtnStyle(third, Colors.transparent, Colors.white54),
onPressed: () { onPressed: () {
context.goNamed('signature');
}, },
icon: const Icon( icon: const Icon(
FontAwesome5.signature, FontAwesome5.signature,

View File

@ -46,7 +46,6 @@ class DashBoard extends StatelessWidget {
children: roles[index].roles.map((role) { children: roles[index].roles.map((role) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
print("Role is click");
}, },
child: Column(children: [ child: Column(children: [
Icon( Icon(

View File

@ -1,7 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:fluttericon/web_symbols_icons.dart'; import 'package:fluttericon/web_symbols_icons.dart';
import 'package:fluttericon/typicons_icons.dart';
import 'package:fluttericon/font_awesome5_icons.dart'; import 'package:fluttericon/font_awesome5_icons.dart';
import '../../../../model/login_data/user_info/user_data.dart'; import '../../../../model/login_data/user_info/user_data.dart';
import 'menu.dart'; import 'menu.dart';

View File

@ -1,6 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_zoom_drawer/flutter_zoom_drawer.dart';
import 'package:go_router/go_router.dart';
import 'package:unit2/model/login_data/user_info/user_data.dart'; import 'package:unit2/model/login_data/user_info/user_data.dart';
import 'package:unit2/utils/alerts.dart'; import 'package:unit2/utils/alerts.dart';
import '../../../../theme-data.dart/colors.dart'; import '../../../../theme-data.dart/colors.dart';

View File

@ -5,7 +5,6 @@ import 'package:fluttericon/font_awesome5_icons.dart';
import 'package:fluttericon/font_awesome_icons.dart'; import 'package:fluttericon/font_awesome_icons.dart';
import 'package:fluttericon/typicons_icons.dart'; import 'package:fluttericon/typicons_icons.dart';
import 'package:unit2/screens/unit2/homepage.dart/components/dashboard.dart'; import 'package:unit2/screens/unit2/homepage.dart/components/dashboard.dart';
import 'package:unit2/test_data.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';

View File

@ -1,7 +1,5 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/container.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:unit2/theme-data.dart/btn-style.dart'; import 'package:unit2/theme-data.dart/btn-style.dart';
@ -60,9 +58,9 @@ class _UpdateState extends State<Update> {
color: Colors.black, color: Colors.black,
), ),
children: <TextSpan>[ children: <TextSpan>[
TextSpan( const TextSpan(
text: "mobileVersion", text: "mobileVersion",
style: const TextStyle( style: TextStyle(
color: primary, fontWeight: FontWeight.bold)), color: primary, fontWeight: FontWeight.bold)),
const TextSpan( const TextSpan(
text: " did not match with the latest version ", text: " did not match with the latest version ",

View File

@ -1,7 +1,6 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
Future<bool> pressAgainToExit() async { Future<bool> pressAgainToExit() async {

View File

@ -6,7 +6,6 @@ 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:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.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:flutter_progress_hud/flutter_progress_hud.dart'; import 'package:flutter_progress_hud/flutter_progress_hud.dart';
import 'package:unit2/bloc/bloc/user_bloc.dart'; import 'package:unit2/bloc/bloc/user_bloc.dart';
@ -205,26 +204,10 @@ class _UniT2LoginState extends State<UniT2Login> {
BlocProvider.of<UserBloc>(context) BlocProvider.of<UserBloc>(context)
.add(UserLogin( .add(UserLogin(
username: username:
"rjvincentlopeplopez", _formKey.currentState!.value['username'],
password: "shesthequ33n" password:_formKey.currentState!.value['password']
// username: _formKey
// .currentState!
// .value['username'],
// password: _formKey
// .currentState!
// .value[
// 'password']
)); ));
} }
// if (_formKey.currentState.validate()) {
// _formKey.currentState.save();
// BlocProvider.of<UserBloc>(context)
// .add(UserWebLogin(
// password: password,
// username: username));
// }
}, },
), ),
), ),
@ -275,7 +258,6 @@ class _UniT2LoginState extends State<UniT2Login> {
style: mainBtnStyle(third, style: mainBtnStyle(third,
Colors.transparent, Colors.white38), Colors.transparent, Colors.white38),
onPressed: () { onPressed: () {
context.goNamed('add-mobile');
}, },
label: const Text( label: const Text(
requestSOS, requestSOS,

View File

@ -7,9 +7,6 @@ import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:flutter_progress_hud/flutter_progress_hud.dart'; import 'package:flutter_progress_hud/flutter_progress_hud.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:fluttericon/font_awesome5_icons.dart'; import 'package:fluttericon/font_awesome5_icons.dart';
import 'package:fluttericon/font_awesome_icons.dart';
import 'package:form_builder_validators/form_builder_validators.dart';
import 'package:go_router/go_router.dart';
import 'package:unit2/theme-data.dart/btn-style.dart'; import 'package:unit2/theme-data.dart/btn-style.dart';
import 'package:unit2/widgets/error_state.dart'; import 'package:unit2/widgets/error_state.dart';
import 'package:unit2/widgets/wave.dart'; import 'package:unit2/widgets/wave.dart';
@ -159,57 +156,7 @@ class _QRLoginState extends State<QRLogin> {
const SizedBox( const SizedBox(
height: 15, 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: confirmPassword,
// hintText: enterConfirmPassword),
// obscureText: _showPassword ? true : false,
// ),
const SizedBox( const SizedBox(
height: 15, height: 15,
), ),
@ -228,13 +175,7 @@ class _QRLoginState extends State<QRLogin> {
'Logging in...', 'Logging in...',
); );
context.read<UserBloc>().add(UuidLogin(uuid: state.uuid,password: _formKey.currentState!.value['password'])); context.read<UserBloc>().add(UuidLogin(uuid: state.uuid,password: _formKey.currentState!.value['password']));
// BlocProvider.of<UserBloc>(context)
// .add(UserLogin(
// username: _formKey
// .currentState!.value['username'],
// password: _formKey
// .currentState!.value['password'],
// ));
} }
}, },
child: const Text(submit)), child: const Text(submit)),

View File

@ -127,13 +127,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.2" version: "3.0.2"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
date_time_picker: date_time_picker:
dependency: "direct main" dependency: "direct main"
description: description:
@ -322,13 +315,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
go_router:
dependency: "direct main"
description:
name: go_router
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
graphs: graphs:
dependency: transitive dependency: transitive
description: description:
@ -385,13 +371,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.0.1"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:

View File

@ -35,8 +35,6 @@ dependencies:
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
go_router: ^3.0.6
flutter_custom_clippers: ^2.0.0 flutter_custom_clippers: ^2.0.0
flutter_svg: ^1.1.6 flutter_svg: ^1.1.6
flutter_form_builder: ^7.7.0 flutter_form_builder: ^7.7.0