Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Altera nome dos arquivos e pastas (fga-eps-mds/2024.2-ARANDU-DOC#00) #73

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/core/log/log.dart';

class StorageValue {

static const String _authToken = "auth_token";
static const String _refreshToken = "refresh_token";
static const String _email = "email";
Expand All @@ -15,8 +14,7 @@ class StorageValue {
: storage = const FlutterSecureStorage(
aOptions: AndroidOptions(encryptedSharedPreferences: true));

factory StorageValue.getInstance() =>
_singleton ??= StorageValue._internal();
factory StorageValue.getInstance() => _singleton ??= StorageValue._internal();

Future<void> _setValue(String key, String value) async {
try {
Expand Down
File renamed without changes.
9 changes: 4 additions & 5 deletions lib/core/network/app_interceptors.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:aranduapp/core/data/local/StorageValue.dart';
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/core/data/local/storage_value.dart';
import 'package:aranduapp/core/log/log.dart';
import 'package:aranduapp/core/network/token_manager/auth_service.dart';
import 'package:aranduapp/core/network/token_manager/model/refresh_token_response.dart';
import 'package:dio/dio.dart';
Expand All @@ -13,7 +13,7 @@ class AppInterceptors extends Interceptor {
Log.w(token);

if (token != null) {
options.headers['Authorization'] = 'Bearer $token';
options.headers['Authorization'] = 'Bearer $token';
} else {
Log.w('Token não encontrado');
}
Expand All @@ -27,8 +27,7 @@ class AppInterceptors extends Interceptor {
try {
Log.i('Token expirado. Tentando atualizar o token...');

RefreshTokenResponse tokens =
await AuthService().refreshToken();
RefreshTokenResponse tokens = await AuthService().refreshToken();

final requestOptions = err.requestOptions;

Expand Down
6 changes: 1 addition & 5 deletions lib/core/network/base_api.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/core/log/log.dart';
import 'package:aranduapp/core/network/app_interceptors.dart';

import 'package:dio/dio.dart';
Expand Down Expand Up @@ -53,7 +53,6 @@ class BaseApi {
}
}


Future<Response> patch({required String path, Object? data}) async {
try {
return await _dio.patch(path, data: data);
Expand All @@ -63,8 +62,6 @@ class BaseApi {
}
}



Future<Response> put({required String path, Object? data}) async {
try {
return await _dio.put(path, data: data);
Expand All @@ -73,5 +70,4 @@ class BaseApi {
rethrow;
}
}

}
4 changes: 2 additions & 2 deletions lib/core/network/token_manager/auth_service.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:aranduapp/core/data/local/StorageValue.dart';
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/core/data/local/storage_value.dart';
import 'package:aranduapp/core/log/log.dart';
import 'package:aranduapp/core/network/base_api.dart';
import 'package:aranduapp/core/network/token_manager/model/refresh_token_response.dart';
import 'package:dio/dio.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:aranduapp/config/ThemeApp.dart';
import 'package:aranduapp/config/theme_app.dart';
import 'package:aranduapp/ui/welcome/view/welcome_view.dart';
import 'package:aranduapp/core/di/locator.dart';
import 'package:aranduapp/ui/welcome/view/WelcomeView.dart';
import 'package:flutter/material.dart';

void main() {
Expand Down
6 changes: 3 additions & 3 deletions lib/ui/edit_password/view/edit_password_view.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:aranduapp/ui/edit_password/viewmodel/edit_password_viewmode.dart';
import 'package:aranduapp/ui/shared/requestbutton.dart';
import 'package:aranduapp/ui/edit_password/viewmodel/edit_password_viewmodel.dart';
import 'package:aranduapp/ui/shared/request_button.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import 'package:aranduapp/ui/shared/TextPassword.dart';
import 'package:aranduapp/ui/shared/text_password.dart';

class EditPassword extends StatelessWidget {
const EditPassword({super.key});
Expand Down
15 changes: 4 additions & 11 deletions lib/ui/edit_profile/view/edit_profile_view.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:aranduapp/ui/edit_profile/viewmodel/edit_profile_viewmodel.dart';
import 'package:aranduapp/ui/shared/TextEmail.dart';
import 'package:aranduapp/ui/shared/TextName.dart';
import 'package:aranduapp/ui/shared/requestbutton.dart';
import 'package:aranduapp/ui/shared/text_email.dart';
import 'package:aranduapp/ui/shared/text_name.dart';
import 'package:aranduapp/ui/shared/request_button.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

Expand All @@ -25,7 +25,6 @@ class EditProfileScreen extends StatelessWidget {
EditProfileViewModel viewModel = Provider.of<EditProfileViewModel>(context);

return Scaffold(

appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.surface,
elevation: 0,
Expand Down Expand Up @@ -55,7 +54,6 @@ class EditProfileScreen extends StatelessWidget {
],
),
));

}

Widget _buildForm(BuildContext context, EditProfileViewModel viewModel) {
Expand Down Expand Up @@ -88,23 +86,18 @@ class EditProfileScreen extends StatelessWidget {
);
}


Widget _saveButton(BuildContext context, EditProfileViewModel viewModel) {
return Requestbutton(
command: viewModel.editCommand,
nameButton: "Salvar",
onErrorCallback: (e) {

ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(e)),

);
},
onSuccessCallback: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text(
'Usuario atualizado com sucesso. ')),
const SnackBar(content: Text('Usuario atualizado com sucesso. ')),
);
});
}
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions lib/ui/login/service/login_service.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:aranduapp/core/data/local/StorageValue.dart';
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/core/data/local/storage_value.dart';
import 'package:aranduapp/core/log/log.dart';
import 'package:aranduapp/core/network/base_api.dart';
import 'package:aranduapp/core/network/token_manager/auth_service.dart';
import 'package:aranduapp/ui/login/model/LoginRequest.dart';
import 'package:aranduapp/ui/login/model/LoginResponse.dart';
import 'package:aranduapp/ui/login/model/login_request.dart';
import 'package:aranduapp/ui/login/model/login_response.dart';
import 'package:dio/dio.dart';

class LoginService {
Expand Down
18 changes: 9 additions & 9 deletions lib/ui/login/view/login_view.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/ui/navbar/view/navBarView.dart';
import 'package:aranduapp/ui/shared/TextAndLink.dart';
import 'package:aranduapp/ui/shared/requestbutton.dart';
import 'package:aranduapp/core/log/log.dart';
import 'package:aranduapp/ui/navbar/view/navbar_view.dart';
import 'package:aranduapp/ui/shared/text_and_link.dart';
import 'package:aranduapp/ui/shared/request_button.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:provider/provider.dart';
Expand All @@ -12,11 +12,11 @@ import 'package:aranduapp/ui/login/viewmodel/login_viewmodel.dart';
import 'package:aranduapp/ui/recover_account/view/recover_account_view.dart';
import 'package:aranduapp/ui/register_account/view/register_account_view.dart';

import 'package:aranduapp/ui/shared/TitleSlogan.dart';
import 'package:aranduapp/ui/shared/TextEmail.dart';
import 'package:aranduapp/ui/shared/ErrorPopUp.dart';
import 'package:aranduapp/ui/shared/TextPassword.dart';
import 'package:aranduapp/ui/shared/OrDivider.dart';
import 'package:aranduapp/ui/shared/title_slogan.dart';
import 'package:aranduapp/ui/shared/text_email.dart';
import 'package:aranduapp/ui/shared/error_popup.dart';
import 'package:aranduapp/ui/shared/text_password.dart';
import 'package:aranduapp/ui/shared/or_divider.dart';

class Login extends StatelessWidget {
const Login({super.key});
Expand Down
6 changes: 2 additions & 4 deletions lib/ui/login/viewmodel/login_viewmodel.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/core/log/log.dart';
import 'package:aranduapp/core/state/command.dart';
import 'package:async/async.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:local_auth/local_auth.dart';
import 'package:aranduapp/ui/login/service/login_service.dart';
import 'package:aranduapp/ui/login/model/LoginRequest.dart';
import 'package:aranduapp/ui/login/model/login_request.dart';

class LoginViewModel extends ChangeNotifier {

late Command0<void> loginCommand;
late Command0<void> validadeTokenCommand;

Expand All @@ -20,7 +19,6 @@ class LoginViewModel extends ChangeNotifier {
: formKey = GlobalKey<FormState>(),
emailController = TextEditingController(),
passwordController = TextEditingController() {

loginCommand = Command0<void>(loginWithEmailAndPassword);

validadeTokenCommand = Command0<void>(validateToken);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:aranduapp/ui/home/view/HomeView.dart';
import 'package:aranduapp/ui/profile/view/ProfileView.dart';
import 'package:aranduapp/ui/home/view/home_view.dart';
import 'package:aranduapp/ui/profile/view/profile_view.dart';
//import 'package:aranduapp/ui/profile/view/profileView.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:aranduapp/ui/navbar/model/navBarViewModel.dart';
import 'package:aranduapp/ui/navbar/viewmodel/navbar_viewmodel.dart';

class NavbarView extends StatelessWidget {
const NavbarView({super.key});
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/onboarding/view/onboarding_view.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../viewModel/onboarding_view_model.dart';
import '../viewmodel/onboarding_viewmodel.dart';

class OnboardingView extends StatelessWidget {
const OnboardingView({super.key});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:aranduapp/ui/edit_password/view/edit_password_view.dart';
import 'package:provider/provider.dart';
import 'package:flutter/material.dart';

import 'package:aranduapp/ui/shared/ProfileHeader.dart';
import 'package:aranduapp/ui/profile/viewModel/ProfileViewModel.dart';
import 'package:aranduapp/ui/shared/profile_header.dart';
import 'package:aranduapp/ui/profile/viewmodel/profile_viewmodel.dart';
import 'package:aranduapp/ui/edit_profile/view/edit_profile_view.dart';

class Profile extends StatelessWidget {
Expand Down Expand Up @@ -102,7 +102,6 @@ class Profile extends StatelessWidget {
);
}


Widget _setting(BuildContext context) {
return Card(
child: Column(
Expand Down
17 changes: 0 additions & 17 deletions lib/ui/recover_account/service/RecoverAccountService.dart

This file was deleted.

12 changes: 12 additions & 0 deletions lib/ui/recover_account/service/recover_account_service.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:aranduapp/core/network/base_api.dart';
import 'package:aranduapp/ui/recover_account/model/recover_account_request.dart';

class RecoverAccountService {
static Future<void> forgetPassword(
RecoverAccountRequest recoverAccountRequest) async {
await BaseApi.getInstance(auth: false)
.post(path: '/auth/forgot-password', data: <String, dynamic>{
'email': recoverAccountRequest.email,
});
}
}
14 changes: 7 additions & 7 deletions lib/ui/recover_account/view/recover_account_view.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/ui/recover_account/viewModel/recover_account_view_model.dart';
import 'package:aranduapp/ui/shared/ErrorPopUp.dart';
import 'package:aranduapp/ui/shared/TextAndLink.dart';
import 'package:aranduapp/ui/shared/TextEmail.dart';
import 'package:aranduapp/ui/shared/TitleSlogan.dart';
import 'package:aranduapp/ui/shared/requestbutton.dart';
import 'package:aranduapp/core/log/log.dart';
import 'package:aranduapp/ui/recover_account/viewmodel/recover_account_viewmodel.dart';
import 'package:aranduapp/ui/shared/error_popup.dart';
import 'package:aranduapp/ui/shared/text_and_link.dart';
import 'package:aranduapp/ui/shared/text_email.dart';
import 'package:aranduapp/ui/shared/title_slogan.dart';
import 'package:aranduapp/ui/shared/request_button.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/core/log/log.dart';
import 'package:aranduapp/core/state/command.dart';
import 'package:aranduapp/ui/recover_account/model/RecoverAccountRequest.dart';
import 'package:aranduapp/ui/recover_account/service/RecoverAccountService.dart';
import 'package:aranduapp/ui/recover_account/model/recover_account_request.dart';
import 'package:aranduapp/ui/recover_account/service/recover_account_service.dart';
import 'package:async/async.dart';
import 'package:flutter/material.dart';

Expand Down
20 changes: 10 additions & 10 deletions lib/ui/register_account/view/register_account_view.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import 'package:aranduapp/ui/login/view/login_view.dart';
import 'package:aranduapp/ui/shared/OrDivider.dart';
import 'package:aranduapp/ui/shared/TextAndLink.dart';
import 'package:aranduapp/ui/shared/TextName.dart';
import 'package:aranduapp/ui/shared/requestbutton.dart';
import 'package:aranduapp/ui/shared/or_divider.dart';
import 'package:aranduapp/ui/shared/text_and_link.dart';
import 'package:aranduapp/ui/shared/text_name.dart';
import 'package:aranduapp/ui/shared/request_button.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/core/log/log.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';

import 'package:aranduapp/ui/register_account/viewModel/register_view_model.dart';
import 'package:aranduapp/ui/register_account/viewmodel/register_viewmodel.dart';

import 'package:aranduapp/ui/shared/TitleSlogan.dart';
import 'package:aranduapp/ui/shared/TextEmail.dart';
import 'package:aranduapp/ui/shared/ErrorPopUp.dart';
import 'package:aranduapp/ui/shared/TextPassword.dart';
import 'package:aranduapp/ui/shared/title_slogan.dart';
import 'package:aranduapp/ui/shared/text_email.dart';
import 'package:aranduapp/ui/shared/error_popup.dart';
import 'package:aranduapp/ui/shared/text_password.dart';

class RegisterAccount extends StatelessWidget {
const RegisterAccount({super.key});
Expand Down
15 changes: 4 additions & 11 deletions lib/ui/shared/ErrorPopUp.dart → lib/ui/shared/error_popup.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import 'package:flutter/material.dart';
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/core/log/log.dart';

class ErrorPopUp extends StatelessWidget {

final Widget content;

const ErrorPopUp({super.key, required this.content});

@override
Widget build(BuildContext context) {
return AlertDialog (
title: Align(

return AlertDialog(
title: Align(
alignment: Alignment.centerLeft,

child: Icon(
Icons.error,
size: 40,
Expand All @@ -23,11 +20,7 @@ class ErrorPopUp extends StatelessWidget {
content: content,
actions: <Widget>[
TextButton(

onPressed: () => {
Log.d('tap'),
Navigator.pop(context, 'OK')
},
onPressed: () => {Log.d('tap'), Navigator.pop(context, 'OK')},
child: const Text('OK'),
),
],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:aranduapp/ui/shared/ErrorPopUp.dart';
import 'package:aranduapp/ui/shared/error_popup.dart';

void main() {
testWidgets('Testa ErrorPopUp', (WidgetTester tester) async {
Expand Down
File renamed without changes.
Loading
Loading