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

[RELEASE] Adiciona modificações para a Release Minor #71

Merged
merged 105 commits into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
b723909
(FIX#58) Melhora Front e arruma responsividade
dylancavalcante Dec 11, 2024
2fed740
(FIX#58) Fix responsividade, imagens e botões
dylancavalcante Dec 11, 2024
4a9c766
feat(#60) adiciona view e viewModel para o recoverAccount
GabrielCostaDeOliveira Dec 12, 2024
e1fa386
(FIX#58): Resolve conflict merge
dylancavalcante Dec 12, 2024
23823a8
fix(#60):Correção do erro na página de recurar conta
MarinaGaldi Dec 12, 2024
55bc995
feat(#60) cria conexão com o servidor
GabrielCostaDeOliveira Dec 13, 2024
72d486c
fix(#60) modifica botão RecoverAccount
Yasm1nNasc1mento Dec 13, 2024
291895f
fix(#60) corrige e implementa recoverAccount
GabrielCostaDeOliveira Dec 13, 2024
c6d4091
Merge pull request #40 from fga-eps-mds/feat#60/recuperar_conta
GabrielCostaDeOliveira Dec 13, 2024
2132cf0
(FIX#58) Refatora código e modifica imagens
dylancavalcante Dec 14, 2024
3818bf2
fix(#58): Ajusta permissão para internet
EngDann Dec 10, 2024
d3e8736
Merge pull request #36 from fga-eps-mds/fix#58/Permissao-internet
GabrielCostaDeOliveira Dec 15, 2024
9cc1908
fix(#58): inicio do refresh token
GabrielCostaDeOliveira Dec 13, 2024
d545d7c
fix(#58): corrigerefresh token
GabrielCostaDeOliveira Dec 15, 2024
34ba1c4
fix(#58): adicionar autenticação do dispositivo
GabrielCostaDeOliveira Dec 15, 2024
d315e1c
Merge branch 'dev' into feat#58/login_com_dispositivo
GabrielCostaDeOliveira Dec 15, 2024
732d328
Merge pull request #43 from fga-eps-mds/feat#58/login_com_dispositivo
GabrielCostaDeOliveira Dec 15, 2024
b292079
fix(#58) Passa estado e métodos para a viewModel
dylancavalcante Dec 16, 2024
67381ee
fix(#58) resolve merge comflict
dylancavalcante Dec 16, 2024
19ef465
fix(#58) ReSoLvE mErGe CoNfLiCt
dylancavalcante Dec 16, 2024
ed85187
fix(#58) Renomeia arquivos para evitar merge conflict
dylancavalcante Dec 16, 2024
7c0d67a
Merge branch 'dev' into feat#58/implementa_onboarding
GabrielCostaDeOliveira Dec 16, 2024
e5b6742
fix(#59) alterar próxima página do onboarding
GabrielCostaDeOliveira Dec 16, 2024
d15eeb4
feat(#59) Criacao das pastas para o Modelo MVVM
R1K4S Dec 16, 2024
c07ba61
Merge pull request #37 from fga-eps-mds/feat#58/implementa_onboarding
GabrielCostaDeOliveira Dec 16, 2024
3aca07d
feat(#59) Criação do Componente ProfileHeader
R1K4S Dec 16, 2024
272db90
feat(#59) Criação do Componente ProfileHeader
R1K4S Dec 16, 2024
eecc1a4
feat(#59) Arrumando a estrutura melhor da Tela
R1K4S Dec 16, 2024
fb940bd
feat(#59) Criado ProfileSection e editando a TelaProfile
R1K4S Dec 16, 2024
bbacee4
feat(#59) Tela com estrutura inicial Finalizada e aparentemente funci…
R1K4S Dec 16, 2024
3c2831b
feat(#59) NavBar inicial
MarinaGaldi Dec 16, 2024
02d40b4
feat(#59) Implementando navegação de Telas
R1K4S Dec 17, 2024
d144b15
fix(#59) Arrumando e melhorando Desing da Tela
R1K4S Dec 17, 2024
291d1a7
Merge branch 'dev' into feat#59/Navbar
GabrielCostaDeOliveira Dec 18, 2024
7fd2366
fix(#59): correção de cores e caminhos
GabrielCostaDeOliveira Dec 18, 2024
33c817d
Merge pull request #46 from fga-eps-mds/feat#59/Navbar
GabrielCostaDeOliveira Dec 18, 2024
a073ae1
Fix(#59): correção de tela
GabrielCostaDeOliveira Dec 7, 2024
6fffd0d
fix(fga-eps-mds/2024.2-ARANDU-DOC#59): fixing merge conflicts
gabrielm2q Dec 18, 2024
dfa2a32
<Fix>(#59):Ajustando Interface nos padrões Figma
zDrNz Dec 7, 2024
3299d9d
Style(#59): Ajustes visuais na parte do edit profile
zDrNz Dec 11, 2024
f8fd866
<fix>(fga-eps-mds/2024.2-ARANDU-DOC#59):Ajuste de cores
zDrNz Dec 19, 2024
dd82e75
fix(#59): Corrige e ajusta aparência da WelcomeView
Yasm1nNasc1mento Dec 19, 2024
62a0856
fix(#59): corrige e melhora api do aplicativo
GabrielCostaDeOliveira Dec 19, 2024
78ffade
test(#59): Realizacao de teste dos componentes shared
Joao151104 Dec 19, 2024
16d4f97
fix(#59) Arrumando cores e padronizando
R1K4S Dec 20, 2024
3f3404b
Merge branch 'dev' into feat#59/Profile-Hearder
R1K4S Dec 20, 2024
ee57555
Merge branch 'feat#59/Tela-de-EditProfile' into feat#59/Profile-Hearder
R1K4S Dec 20, 2024
43a755a
fix(#58): corrige arquitetura
GabrielCostaDeOliveira Dec 20, 2024
3334072
deletando arquivo desnecessário
GabrielCostaDeOliveira Dec 20, 2024
7230b84
fix(#59): Tela Profile + Tela EditProfile Atualizadas
R1K4S Dec 20, 2024
0dab13d
Merge pull request #47 from fga-eps-mds/qa/shared
dartmol203 Dec 20, 2024
e8fcd6c
fix(#59): melhorando arquitetura
GabrielCostaDeOliveira Dec 20, 2024
cad2b79
Merge branch 'dev' into feat#58/corrige_orientação
GabrielCostaDeOliveira Dec 20, 2024
4a486ea
Merge pull request #49 from fga-eps-mds/feat#58/corrige_orientação
GabrielCostaDeOliveira Dec 20, 2024
e76b3f4
fix(#59): corrige navegação
GabrielCostaDeOliveira Dec 20, 2024
4fc01ad
adiciona link para o apk
GabrielCostaDeOliveira Dec 20, 2024
c555068
test(#58): cria teste para view
GabrielCostaDeOliveira Dec 20, 2024
75972ba
test(#58): cria teste da requisição
GabrielCostaDeOliveira Dec 22, 2024
e984826
Merge branch 'dev' into qa/recover_account
GabrielCostaDeOliveira Dec 22, 2024
9f3d130
Merge pull request #52 from fga-eps-mds/qa/recover_account
GabrielCostaDeOliveira Dec 22, 2024
af065a5
fix(#58): troca nome de arquivo para snake case
GabrielCostaDeOliveira Dec 23, 2024
2f00182
test(#58): teste da view
GabrielCostaDeOliveira Dec 23, 2024
0e6095a
fix(#58): corrige erro de navegação
GabrielCostaDeOliveira Dec 23, 2024
13ac32f
test(#58): melhora casos de test da view
GabrielCostaDeOliveira Dec 23, 2024
c99ebbb
fix(#58): corrige erro encontrado com o teste
GabrielCostaDeOliveira Dec 23, 2024
288039a
fix#59/melhora mensagens de erro do register_account e ajusta casos d…
Yasm1nNasc1mento Dec 23, 2024
a203335
test(#58): molhora casos de teste da LoginView
GabrielCostaDeOliveira Dec 24, 2024
7d2832d
Merge pull request #54 from fga-eps-mds/feat#58/teste_login_view
GabrielCostaDeOliveira Dec 24, 2024
a172397
fix(#59): Corrige register_account viewModel, shared e test
Yasm1nNasc1mento Dec 26, 2024
1842fe5
Merge branch 'dev' into fix#59/ajusta-menssagem-register_account
GabrielCostaDeOliveira Dec 26, 2024
0d1a76b
Merge branch 'fix#59/ajusta-menssagem-register_account' of https://gi…
GabrielCostaDeOliveira Dec 26, 2024
05ac25a
Merge pull request #53 from fga-eps-mds/fix#59/ajusta-menssagem-regis…
GabrielCostaDeOliveira Dec 26, 2024
83e9bcd
ref(#59): use command pattern
GabrielCostaDeOliveira Dec 26, 2024
1b6eb75
ref(#59): corrigindo nomes de classes e arquivos
GabrielCostaDeOliveira Dec 27, 2024
2c2a76d
test(#59): adiciona teste da view
GabrielCostaDeOliveira Dec 27, 2024
5e28b25
Merge pull request #56 from fga-eps-mds/qa/register_account
GabrielCostaDeOliveira Dec 27, 2024
3c711ca
fix(#60): Adiciona mensagem recover_account_view.dart
Yasm1nNasc1mento Dec 27, 2024
710570a
ref(#60): usa command pattern
GabrielCostaDeOliveira Dec 28, 2024
1ea970a
test(#60): melhorando testes
GabrielCostaDeOliveira Dec 28, 2024
fc4872f
Merge pull request #57 from fga-eps-mds/fix#60/mensagem_recover_account
GabrielCostaDeOliveira Dec 28, 2024
92a8317
fix(#58): Adiciona command ao view model
EngDann Dec 28, 2024
61ad837
fix(#58): Adiciona botão de requisição ao invés do elevatedButton
EngDann Dec 28, 2024
39e58b2
Update code-analysis.yml
dartmol203 Jan 8, 2025
adfc863
Merge pull request #62 from fga-eps-mds/dartmol203-patch-2
gabrielm2q Jan 8, 2025
9ef695c
Update code-analysis.yml
dartmol203 Jan 8, 2025
656c152
Update code-analysis.yml
dartmol203 Jan 8, 2025
e7b1db2
Merge pull request #63 from fga-eps-mds/dartmol203-patch-3
dartmol203 Jan 8, 2025
f8a4241
fix(#58): Adiciona command a viewmodel
GabrielCostaDeOliveira Jan 9, 2025
3d334cb
Merge pull request #61 from fga-eps-mds/fix#58/adiciona-command-ao-login
GabrielCostaDeOliveira Jan 10, 2025
8801575
ref(#59): adiciona request button
GabrielCostaDeOliveira Jan 10, 2025
c3105bc
test(#59): adiciona teste no Checkbox
GabrielCostaDeOliveira Jan 10, 2025
b9998c3
Merge branch 'dev' into feat#59/adiciona-requestButton
GabrielCostaDeOliveira Jan 10, 2025
80d73a7
Merge pull request #60 from fga-eps-mds/feat#59/adiciona-requestButton
GabrielCostaDeOliveira Jan 10, 2025
a0664e5
Merge branch 'dev' into feat#59/Profile-Hearder
GabrielCostaDeOliveira Jan 10, 2025
15fbdaa
test(#59): adiciona service e viewmodel
GabrielCostaDeOliveira Jan 10, 2025
5dfd20c
feat(#59): adiciona service e viewmodel
GabrielCostaDeOliveira Jan 10, 2025
6d45993
feat(#59): adiciona edit password
GabrielCostaDeOliveira Jan 10, 2025
a96eeb5
Merge pull request #51 from fga-eps-mds/feat#59/Profile-Hearder
GabrielCostaDeOliveira Jan 10, 2025
a1599c9
Merge branch 'dev' into feat#59/editPassword
GabrielCostaDeOliveira Jan 10, 2025
2d5746a
Merge pull request #66 from fga-eps-mds/feat#59/editPassword
GabrielCostaDeOliveira Jan 10, 2025
ad09af6
fix(#59): corrige autorização da api
GabrielCostaDeOliveira Jan 11, 2025
3e32099
Merge pull request #68 from fga-eps-mds/fix#59/apiToken
GabrielCostaDeOliveira Jan 11, 2025
7e739d8
fix: adds APK link to readme
gabrielm2q Jan 11, 2025
e63bf90
Merge pull request #70 from fga-eps-mds/fixapk-link
dartmol203 Jan 11, 2025
1fd4e1d
Merge pull request #69 from fga-eps-mds/dev
gabrielm2q Jan 11, 2025
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
6 changes: 4 additions & 2 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ jobs:
restore-keys: ${{ runner.os }}-sonar
- name: Build
run: flutter build
- name: Execute tests
run: flutter test --coverage
- name: Download sonar-scanner
run: |
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-linux-x64.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
- name: Execute tests
run: |
flutter test --coverage
ls coverage/
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# APP em Flutter para o Projeto Arandu

A new Flutter project.
## APK

- [APK](https://drive.google.com/file/d/1Onw1dsXU3rjpezBIfxpIiuR0Qq4BxE3D/view?usp=drive_link)

## Getting Started

Expand Down
6 changes: 6 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
<uses-permission android:name="android.permission.INTERNET"/>


<application
android:label="aranduapp"
android:name="${applicationName}"
Expand Down Expand Up @@ -31,6 +36,7 @@
android:name="flutterEmbedding"
android:value="2" />
</application>

<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.example.aranduapp

import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity: FlutterActivity()
class MainActivity: FlutterFragmentActivity()
Binary file modified assets/images/Component1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/Component2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/Component3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 0 additions & 27 deletions lib/core/network/AppInterceptors.dart

This file was deleted.

42 changes: 0 additions & 42 deletions lib/core/network/BaseApi.dart

This file was deleted.

53 changes: 53 additions & 0 deletions lib/core/network/app_interceptors.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import 'package:aranduapp/core/data/local/StorageValue.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';

class AppInterceptors extends Interceptor {
@override
Future<void> onRequest(
RequestOptions options, RequestInterceptorHandler handler) async {
String? token = await StorageValue.getInstance().getAuthToken();

Log.w(token);

if (token != null) {
options.headers['Authorization'] = 'Bearer $token';
} else {
Log.w('Token não encontrado');
}

super.onRequest(options, handler);
}

@override
Future onError(DioException err, ErrorInterceptorHandler handler) async {
if (err.response?.statusCode == 401) {
try {
Log.i('Token expirado. Tentando atualizar o token...');

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

final requestOptions = err.requestOptions;

requestOptions.headers['Authorization'] = 'Bearer ${tokens.authToken}';

final response = await Dio().request(
requestOptions.path,
options: Options(
method: requestOptions.method,
headers: requestOptions.headers,
),
data: requestOptions.data,
);

Log.i('Token expirado atualizado.');
return handler.resolve(response);
} catch (e) {
super.onError(err, handler);
}
}
}
}
77 changes: 77 additions & 0 deletions lib/core/network/base_api.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import 'package:aranduapp/core/log/Log.dart';
import 'package:aranduapp/core/network/app_interceptors.dart';

import 'package:dio/dio.dart';

class BaseApi {
final Dio _dio;

static BaseApi? _authInstance, _nonAuthInstance;

final String url = 'https://arandu-user-service.onrender.com';

BaseApi._internal(bool auth) : _dio = Dio() {
_dio.options.baseUrl = url;
_dio.options.connectTimeout = const Duration(seconds: 5);
_dio.options.receiveTimeout = const Duration(seconds: 5);

if (auth) _dio.interceptors.add(AppInterceptors());

_dio.interceptors.add(LogInterceptor(
requestBody: true,
responseBody: true,
requestHeader: true,
error: true,
responseHeader: true,
request: true));
}

static BaseApi getInstance({required bool auth}) {
if (auth) {
return _authInstance ??= BaseApi._internal(auth);
} else {
return _nonAuthInstance ??= BaseApi._internal(auth);
}
}

Future<Response> get(
{required String path, Map<String, dynamic>? queryParameters}) async {
try {
return await _dio.get(path, queryParameters: queryParameters);
} catch (e) {
Log.e(e);
rethrow;
}
}

Future<Response> post({required String path, Object? data}) async {
try {
return await _dio.post(path, data: data);
} catch (e) {
Log.e(e);
rethrow;
}
}


Future<Response> patch({required String path, Object? data}) async {
try {
return await _dio.patch(path, data: data);
} catch (e) {
Log.e(e);
rethrow;
}
}



Future<Response> put({required String path, Object? data}) async {
try {
return await _dio.put(path, data: data);
} catch (e) {
Log.e(e);
rethrow;
}
}

}
31 changes: 31 additions & 0 deletions lib/core/network/token_manager/auth_service.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import 'package:aranduapp/core/data/local/StorageValue.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';

class AuthService {
Future<RefreshTokenResponse> refreshToken() async {
String? refresh = await StorageValue.getInstance().getRefreshToken();

assert(refresh != null);

Response response = await BaseApi.getInstance(auth: false).post(
path: '/auth/refresh',
data: <String, dynamic>{'refreshToken': refresh});

RefreshTokenResponse tokens =
RefreshTokenResponse.fromJsonString(response.toString());

await StorageValue.getInstance().setAuthToken(tokens.authToken!);
await StorageValue.getInstance().setRefreshToken(tokens.refreshToken!);

Log.i("Tokens atualizados com sucesso.");

return tokens;
}

Future<void> validateToken() async {
await BaseApi.getInstance(auth: true).get(path: '/auth/validate-token');
}
}
18 changes: 18 additions & 0 deletions lib/core/network/token_manager/model/refresh_token_response.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'dart:convert';

class RefreshTokenResponse {

String? authToken;
String? refreshToken;

RefreshTokenResponse(this.authToken, this.refreshToken);

factory RefreshTokenResponse.fromJsonString(String jsonString) {
Map<String, dynamic> json = jsonDecode(jsonString);
return RefreshTokenResponse(
json['accessToken'] as String?,
json['refreshToken'] as String?
);
}

}
47 changes: 47 additions & 0 deletions lib/core/state/command.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import 'package:async/async.dart';
import 'package:flutter/material.dart';

abstract class Command<T> extends ChangeNotifier {
Result<T>? _result;

bool _running = false;

Command();

bool get isError => result?.asError != null;

bool get isOk => result?.asValue != null;

Result<T>? get result => _result;

bool get running => _running;

Future<void> _execute(action) async {
if (running) return;

_result = null;
_running = true;
notifyListeners();

try {
_result = await action();
} catch (e) {
_result = Result.error(e);
} finally {
_running = false;
notifyListeners();
}
}
}

class Command0<T> extends Command<T> {
final Future<Result<T>> Function() action;

Command0(this.action);

Future<Result<T>> execute() async {
await _execute(action);

return _result!;
}
}
3 changes: 1 addition & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:aranduapp/config/ThemeApp.dart';
import 'package:aranduapp/ui/login/view/LoginView.dart';
import 'package:aranduapp/ui/welcome/view/WelcomeView.dart';
import 'package:flutter/material.dart';

Expand All @@ -16,7 +15,7 @@ class MyApp extends StatelessWidget {
theme: ThemeApp.themeData(),
darkTheme: ThemeApp.darkThemeData(),
debugShowCheckedModeBanner: false,
home: const Login(),
home: WelcomeView(),
);
}
}
28 changes: 28 additions & 0 deletions lib/ui/edit_password/model/edit_password_request.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'dart:convert';

class EditPasswordRequest {
final String oldPassword;
final String newPassword;

EditPasswordRequest({
required this.oldPassword,
required this.newPassword,
});

Map<String, dynamic> toJson() {
return <String, dynamic>{
'oldPassword': oldPassword,
'newPassword': newPassword,
};
}

factory EditPasswordRequest.fromJsonString(String jsonString) {
final json = jsonDecode(jsonString);

return EditPasswordRequest(
oldPassword: json['oldPpassword']! as String,
newPassword: json['newPassword']! as String,
);
}
}

Loading
Loading