Skip to content

Commit

Permalink
Merge pull request #30 from fga-eps-mds/devel
Browse files Browse the repository at this point in the history
Atualização Release 1.2
  • Loading branch information
carlinhos-pinheiro authored Apr 6, 2021
2 parents 367ed8a + 37aed2f commit 66fdd5b
Show file tree
Hide file tree
Showing 26 changed files with 1,268 additions and 93 deletions.
13 changes: 11 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
---
name: Pull requests.
about: Template para a criação de pull requests.
title: Pull request.
labels: ''
assignees: ''

---

### Descrição - _<O que este Pull Request faz?>_
Pequena descrição sobre o PR, exemplificando quais arquivos foram criados, alterados e o porque de cada criação/alteração.

Expand All @@ -8,8 +17,8 @@ _Permite que o celular do usuário se conecte com o seu computador pessoal._
### Critérios de Aceitação
#### Checklist

- [x]
- [x] Build passando
- [x] Testes passando.
- [x] Build passando.
- [x] Sem conflitos com a Branch Main ou Development.

Resolve #Número_da_Issue.
32 changes: 23 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,27 @@ Repositório destinado ao backend: [e-Vacina Back End](https://github.com/fga-ep
## Documentação
Para mais informações sobre o projeto acesse nossa [documentação](https://fga-eps-mds.github.io/2020.2-e-Vacina-Backend/#/).

## Instalação
Para utilização do aplicativo será necessário:

- [Flutter](https://flutter.dev/docs/get-started/install)

### Clonando o repositório
```bash
$ git clone https://github.com/fga-eps-mds/2020.2-e-Vacina-Frontend.git
$ cd 2020.2-e-Vacina-Frontend
```
### Executando o flutter
```bash
$ flutter run
```

## Equipe
Matricula| Aluno
---|---
190011408|Carlos Daniel
190011424|Carlos Eduardo
190011611|Ciro Costa
190027355|Erick
190013354|Gabriel Luiz
190014032|Guilherme Rogelin
190047968|Paulo Vitor
Matricula| Aluno ||
---|---|---
190011408|Carlos Daniel|<img src="https://avatars.githubusercontent.com/u/49319516?v=4" width="50" title="Carlos Daniel">|
|190011611|Ciro Costa|<img src="https://avatars.githubusercontent.com/u/54088490?v=4" width="50" title="Ciro Costa">|
190027355|Erick Melo|<img src="https://avatars.githubusercontent.com/u/48844857?v=4" width="50" title="Erick Melo">|
190013354|Gabriel Luiz|<img src="https://avatars.githubusercontent.com/u/78509975?v=4" width="50" title="Gabriel Luiz">|
190014032|Guilherme Rogelin|<img src="https://avatars.githubusercontent.com/u/78435405?v=4" width="50" title="Guilherme Rogelin">|
190047968|Paulo Vitor|<img src="https://avatars.githubusercontent.com/u/78428733?v=4" width="50" title="Paulo Vitor">|
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

package com.example.flutter_application_1

import io.flutter.embedding.android.FlutterActivity
Expand Down
Binary file added assets/Carlos.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Ciro.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Erick.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Gabriel.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Guilherme.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Paulo.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/fonts/SuezOne-Regular.ttf
Binary file not shown.
16 changes: 0 additions & 16 deletions lib/api.dart

This file was deleted.

83 changes: 83 additions & 0 deletions lib/controllers/userController.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import 'package:mobx/mobx.dart';
import 'package:dio/dio.dart';
import 'package:e_vacina/globals.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';

part 'userController.g.dart';

class UserController = UserControllerBase with _$UserController;

final _storage = new FlutterSecureStorage();

abstract class UserControllerBase with Store {
@observable
String email;

@action
changeEmail(String value) => email = value;

@observable
String password;

@action
changePassword(String value) => password = value;

@observable
dynamic userId;

@action
changeUserId(String value) => userId = value;

@observable
dynamic token;

@action
changeToken(String value) => token = value;

@action
login(String email, String password) async {
Response response = await api.auth(email, password);

changeToken(response.data['token']);
changeUserId(response.data['user']['_id']);
await _storage.write(key: 'token', value: token);
await _storage.write(key: 'userId', value: userId);
print('$token');
}

@action
logout() async {
changeToken('');
changeUserId('');
await _storage.deleteAll();
}

@action
register(String email, String phoneNumber, String password) async {
if (email.isEmpty || phoneNumber.isEmpty || password.isEmpty) {
print("deu erro");
}
print("teste");
Response response = await api.registerUser(email, phoneNumber, password);
changeEmail(email);
changePassword(password);
changeUserId(response.data['savedUser']['_id']);
login(email, password);
print("deu certo");
}

@action
delete() async {
Response response = await api.deleteUser(userId, token);
print(response);
print(response.statusCode);
}

@action
update(String email, String phoneNumber, String password) async {
Response response =
await api.updateUser(email, phoneNumber, password, userId, token);
print(response);
print(response.statusCode);
}
}
165 changes: 165 additions & 0 deletions lib/controllers/userController.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions lib/globals.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:dio/dio.dart';
import 'package:e_vacina/controllers/userController.dart';
import 'package:e_vacina/services/api.dart';

UserController userController = new UserController();
Api api = new Api();

var options = BaseOptions(
baseUrl: 'http://localhost:3000',
connectTimeout: 5000,
receiveTimeout: 3000,
);

var dio = Dio(options);
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'LoginScreen.dart';
import 'package:e_vacina/screens/SplashScreen.dart';

void main() {
runApp(MyApp());
Expand All @@ -14,7 +14,7 @@ class MyApp extends StatelessWidget {
theme: ThemeData(
primaryColor: Color.fromRGBO(42, 174, 198, 1.0),
visualDensity: VisualDensity.adaptivePlatformDensity),
home: LoginMenu(),
home: InitialSplashScreen(),
);
}
}
Loading

0 comments on commit 66fdd5b

Please sign in to comment.