Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
ealu_flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ester Alfonzo
ealu_flutter
Commits
83ec685b
Commit
83ec685b
authored
Apr 28, 2023
by
Ester Alfonzo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
utilizacion de clean architecture para vistas
parent
290c7207
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
179 additions
and
49 deletions
+179
-49
ConectionApi.dart
lib/core/ConectionApi.dart
+2
-1
api.dart
lib/core/api.dart
+3
-4
login_remote.dart
lib/data/datasources/login_remote.dart
+13
-0
LoginModel.dart
lib/data/models/LoginModel.dart
+55
-0
UserModel.dart
lib/data/models/UserModel.dart
+43
-0
login.dart
lib/domain/entities/login.dart
+4
-25
user.dart
lib/domain/entities/user.dart
+5
-18
ButtonLoginWithGoogle.dart
lib/presentation/widgets/ButtonLoginWithGoogle.dart
+0
-0
CustomBottonBar.dart
lib/presentation/widgets/CustomBottonBar.dart
+0
-0
OptionsGradient.dart
lib/presentation/widgets/OptionsGradient.dart
+0
-0
RecuperarPassword.dart
lib/presentation/widgets/RecuperarPassword.dart
+0
-0
Widgets.dart
lib/presentation/widgets/Widgets.dart
+1
-1
pubspec.lock
pubspec.lock
+48
-0
pubspec.yaml
pubspec.yaml
+5
-0
No files found.
lib/core/ConectionApi.dart
View file @
83ec685b
import
'dart:io'
;
import
'package:etramite_flutter/clases/SharedPref.dart'
;
import
'../data/SharedPref.dart'
;
class
ConectionApi
{
List
<
Cookie
>
cookies
=
[];
...
...
lib/
services/apiService
.dart
→
lib/
core/api
.dart
View file @
83ec685b
import
'dart:io'
;
import
'package:dio/adapter.dart'
;
import
'package:dio/dio.dart'
;
import
'package:etramite_flutter/clases/ConectionApi.dart'
;
import
'package:dio_cookie_manager/dio_cookie_manager.dart'
;
import
'package:cookie_jar/cookie_jar.dart'
;
import
'package:dio_cookie_manager/dio_cookie_manager.dart'
;
import
'ConectionApi.dart'
;
class
Api
Service
{
class
Api
{
String
apiUrl
=
"https://tramites.una.py/etramite-backend/"
;
ConectionApi
conection
=
ConectionApi
();
...
...
lib/data/datasources/login_remote.dart
0 → 100644
View file @
83ec685b
import
'package:ealu_flutter/core/api.dart'
;
import
'package:ealu_flutter/data/models/LoginModel.dart'
;
class
LoginRemote
{
Api
api
;
LoginRemote
(
this
.
api
);
Future
<
LoginModel
>
requestloginUser
(
dynamic
params
,
dynamic
body
)
async
{
var
response
=
await
api
.
post
(
''
,
params
,
body
);
if
(
response
!=
null
)
{
return
LoginModelFromJson
(
response
.
data
);
}
else
{}
}
}
lib/data/models/LoginModel.dart
0 → 100644
View file @
83ec685b
import
'dart:convert'
;
import
'../../domain/entities/login.dart'
;
import
'UserModel.dart'
;
LoginModel
LoginModelFromJson
(
String
str
)
=>
LoginModel
.
fromJson
(
json
.
decode
(
str
));
String
LoginModelToJson
(
LoginModel
data
)
=>
json
.
encode
(
data
.
toJson
());
class
LoginModel
extends
Login
{
bool
logged
;
dynamic
csrf
;
UserModel
user
;
List
<
String
>
permissionList
;
dynamic
msg
;
String
appVersion
;
dynamic
error
;
LoginModel
({
required
this
.
logged
,
this
.
csrf
,
required
this
.
user
,
required
this
.
permissionList
,
this
.
msg
,
required
this
.
appVersion
,
this
.
error
,
})
:
super
(
logged:
logged
,
csrf:
csrf
,
user:
user
,
permissionList:
permissionList
,
msg:
msg
,
appVersion:
appVersion
,
);
factory
LoginModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
LoginModel
(
logged:
json
[
"logged"
],
csrf:
json
[
"csrf"
],
user:
UserModel
.
fromJson
(
json
[
"user"
]),
permissionList:
List
<
String
>.
from
(
json
[
"permissionList"
].
map
((
x
)
=>
x
)),
msg:
json
[
"msg"
],
appVersion:
json
[
"appVersion"
],
error:
json
[
"error"
],
);
Map
<
String
,
dynamic
>
toJson
()
=>
{
"logged"
:
logged
,
"csrf"
:
csrf
,
"user"
:
user
.
toJson
(),
"permissionList"
:
List
<
dynamic
>.
from
(
permissionList
.
map
((
x
)
=>
x
)),
"msg"
:
msg
,
"appVersion"
:
appVersion
,
"error"
:
error
,
};
}
lib/data/models/UserModel.dart
0 → 100644
View file @
83ec685b
import
'../../domain/entities/user.dart'
;
class
UserModel
extends
User
{
int
id
;
String
username
;
String
name
;
String
surname
;
dynamic
image
;
String
nameAndSurname
;
UserModel
({
required
this
.
id
,
required
this
.
username
,
required
this
.
name
,
required
this
.
surname
,
this
.
image
,
required
this
.
nameAndSurname
,
})
:
super
(
id:
id
,
username:
username
,
name:
name
,
surname:
surname
,
nameAndSurname:
nameAndSurname
,
);
factory
UserModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
UserModel
(
id:
json
[
"id"
],
username:
json
[
"username"
],
name:
json
[
"name"
],
surname:
json
[
"surname"
],
image:
json
[
"image"
],
nameAndSurname:
json
[
"nameAndSurname"
],
);
Map
<
String
,
dynamic
>
toJson
()
=>
{
"id"
:
id
,
"username"
:
username
,
"name"
:
name
,
"surname"
:
surname
,
"image"
:
image
,
"nameAndSurname"
:
nameAndSurname
,
};
}
lib/domain/entities/login.dart
View file @
83ec685b
import
'
dart:conve
rt'
;
import
'
package:equatable/equatable.da
rt'
;
import
'user.dart'
;
Login
loginFromJson
(
String
str
)
=>
Login
.
fromJson
(
json
.
decode
(
str
));
String
loginToJson
(
Login
data
)
=>
json
.
encode
(
data
.
toJson
());
class
Login
{
class
Login
extends
Equatable
{
Login
({
required
this
.
logged
,
this
.
csrf
,
...
...
@@ -25,23 +21,6 @@ class Login {
String
appVersion
;
dynamic
error
;
factory
Login
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
Login
(
logged:
json
[
"logged"
],
csrf:
json
[
"csrf"
],
user:
User
.
fromJson
(
json
[
"user"
]),
permissionList:
List
<
String
>.
from
(
json
[
"permissionList"
].
map
((
x
)
=>
x
)),
msg:
json
[
"msg"
],
appVersion:
json
[
"appVersion"
],
error:
json
[
"error"
],
);
Map
<
String
,
dynamic
>
toJson
()
=>
{
"logged"
:
logged
,
"csrf"
:
csrf
,
"user"
:
user
.
toJson
(),
"permissionList"
:
List
<
dynamic
>.
from
(
permissionList
.
map
((
x
)
=>
x
)),
"msg"
:
msg
,
"appVersion"
:
appVersion
,
"error"
:
error
,
};
@override
List
<
Object
?>
get
props
=>
[
logged
,
permissionList
,
msg
,
user
];
}
lib/domain/entities/user.dart
View file @
83ec685b
class
User
{
import
'package:equatable/equatable.dart'
;
class
User
extends
Equatable
{
User
({
required
this
.
id
,
required
this
.
username
,
...
...
@@ -15,21 +17,6 @@ class User {
dynamic
image
;
String
nameAndSurname
;
factory
User
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
User
(
id:
json
[
"id"
],
username:
json
[
"username"
],
name:
json
[
"name"
],
surname:
json
[
"surname"
],
image:
json
[
"image"
],
nameAndSurname:
json
[
"nameAndSurname"
],
);
Map
<
String
,
dynamic
>
toJson
()
=>
{
"id"
:
id
,
"username"
:
username
,
"name"
:
name
,
"surname"
:
surname
,
"image"
:
image
,
"nameAndSurname"
:
nameAndSurname
,
};
@override
List
<
Object
>
get
props
=>
[
id
,
username
,
name
];
}
lib/widgets/ButtonLoginWithGoogle.dart
→
lib/
presentation/
widgets/ButtonLoginWithGoogle.dart
View file @
83ec685b
File moved
lib/widgets/CustomBottonBar.dart
→
lib/
presentation/
widgets/CustomBottonBar.dart
View file @
83ec685b
File moved
lib/widgets/OptionsGradient.dart
→
lib/
presentation/
widgets/OptionsGradient.dart
View file @
83ec685b
File moved
lib/widgets/RecuperarPassword.dart
→
lib/
presentation/
widgets/RecuperarPassword.dart
View file @
83ec685b
File moved
lib/widgets/Widgets.dart
→
lib/
presentation/
widgets/Widgets.dart
View file @
83ec685b
import
'package:flutter/material.dart'
;
import
'../core/customStyles.dart'
;
import
'../
../
core/customStyles.dart'
;
Widget
textInput
(
BuildContext
context
,
dynamic
titulo
,
dynamic
cuerpo
,
bool
negrita
,
bool
dense
)
{
...
...
pubspec.lock
View file @
83ec685b
...
...
@@ -49,6 +49,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.17.0"
cookie_jar:
dependency: "direct main"
description:
name: cookie_jar
sha256: "253920541bf248e4eda6eac5df6aa00c19c183e1fe333629925d8df666a27815"
url: "https://pub.dev"
source: hosted
version: "4.0.1"
cupertino_icons:
dependency: "direct main"
description:
...
...
@@ -57,6 +65,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.5"
dartz:
dependency: "direct main"
description:
name: dartz
sha256: e6acf34ad2e31b1eb00948692468c30ab48ac8250e0f0df661e29f12dd252168
url: "https://pub.dev"
source: hosted
version: "0.10.1"
dio:
dependency: "direct main"
description:
name: dio
sha256: "0894a098594263fe1caaba3520e3016d8a855caeb010a882273189cca10f11e9"
url: "https://pub.dev"
source: hosted
version: "5.1.1"
dio_cookie_manager:
dependency: "direct main"
description:
name: dio_cookie_manager
sha256: ff1755fd56d02485146d95a589fb4ace1f0ae0c0f3ca702a817de2dc1fbb835e
url: "https://pub.dev"
source: hosted
version: "3.0.0"
equatable:
dependency: "direct main"
description:
name: equatable
sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2
url: "https://pub.dev"
source: hosted
version: "2.0.5"
fake_async:
dependency: transitive
description:
...
...
@@ -112,6 +152,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
intl:
dependency: "direct main"
description:
...
...
pubspec.yaml
View file @
83ec685b
...
...
@@ -39,6 +39,11 @@ dependencies:
intl
:
^0.18.0
sizer
:
^2.0.15
shared_preferences
:
^2.1.0
dartz
:
^0.10.1
equatable
:
^2.0.5
cookie_jar
:
^4.0.1
dio
:
^5.1.1
dio_cookie_manager
:
^3.0.0
dev_dependencies
:
flutter_test
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment