diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
new file mode 100644
index 0000000..73d1f98
--- /dev/null
+++ b/.github/workflows/deploy.yml
@@ -0,0 +1,17 @@
+name: deploy
+on:
+ push:
+ branches: [ master ]
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: subosito/flutter-action@v1
+ with:
+ channel: stable
+ - run: flutter pub get
+ - run: flutter format --set-exit-if-changed .
+ - run: flutter analyze --fatal-infos
+ - run: flutter test
+ - uses: erickzanardo/flutter-gh-pages@v2
diff --git a/.gitignore b/.gitignore
index e2c5be1..53ee6c2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,3 +42,5 @@ app.*.map.json
# Openapi java generator
openapi/openapi-generator-cli.jar
+
+windows
\ No newline at end of file
diff --git a/README.md b/README.md
index d571116..5441eb2 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,48 @@
-# Gestión UH
+
+ Gestión UH
+
-A UH managment app.
+
+
+
-[![tests](https://github.com/NODO-UH/gestionapp/actions/workflows/tests.yml/badge.svg)](https://github.com/NODO-UH/gestionapp/actions/workflows/tests.yml) [![Codemagic build status](https://api.codemagic.io/apps/607a1a18d35b7a12ffb6c7dc/607a1a18d35b7a12ffb6c7db/status_badge.svg)](https://codemagic.io/apps/607a1a18d35b7a12ffb6c7dc/607a1a18d35b7a12ffb6c7db/latest_build)
+
+ Aplicación para la gestión electrónica en la Universidad de La Habana.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+### Principales funcionalidades
+
+- Creación del perfil.
+- Consultar la cuota de Internet.
+- Consultar el espacio restante del buzón de Correo.
+
+### Desarrolladores
+
+1. Nodo Central de Red - UH
+ - Jesús Luis Guerrero Campins - Infraestructura y Conectividad
+ - [Máximo Alejandro Alfonso Fernández - Infraestructura y Conectividad](https://github.com/maximoalejandro)
+ - [Andy González Peña - Infraestructura y Conectividad](https://github.com/andyglez)
+ - [Juan Jose Roque Cires - Desarrollador de Servicios](https://github.com/jr638091)
+ - [Christian Rodriguez Diaz - Desarrollador de Servicios](https://github.com/WrathXL)
+2. Grupo de Redes y Sistemas - UH
+ - [Adrian Tubal Páez Ruiz - Desarrollador de Servicios](https://github.com/stdevAdrianPaez)
+ - [Marcos Antonio Maceo Reyes - Desarrollador de Servicios](https://github.com/stdevMac)
+ - [Roberto Marti Cedeño - Desarrollador](https://github.com/rmarticedeno)
+3. Facultad de Matemática y Computación - UH
+ - [Carlos Bermúdez Porto - Desarrollador](https://github.com/cbermudez97)
+ - [Leonel Alejandro García López - Desarrollador](https://github.com/lagcleaner)
+ - [Leynier Gutiérrez González - Desarrollador](https://github.com/leynier)
diff --git a/analysis_options.yaml b/analysis_options.yaml
index ed0d062..a3258d1 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -1,5 +1,14 @@
include: package:lint/analysis_options.yaml
+analyzer:
+ exclude:
+ - build/**
+ - lib/generated_plugin_registrant.dart
+ - lib/**/*.g.dart
+ - lib/**/*.freezed.dart
+ strong-mode:
+ implicit-casts: false
+
linter:
rules:
always_use_package_imports: true
diff --git a/android/app/src/main/res/drawable-hdpi/splash.png b/android/app/src/main/res/drawable-hdpi/splash.png
index 2e879a7..aa75bb7 100644
Binary files a/android/app/src/main/res/drawable-hdpi/splash.png and b/android/app/src/main/res/drawable-hdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable-mdpi/splash.png b/android/app/src/main/res/drawable-mdpi/splash.png
index 9f44cae..41c0dfa 100644
Binary files a/android/app/src/main/res/drawable-mdpi/splash.png and b/android/app/src/main/res/drawable-mdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable-xhdpi/splash.png b/android/app/src/main/res/drawable-xhdpi/splash.png
index bea1acb..a42873f 100644
Binary files a/android/app/src/main/res/drawable-xhdpi/splash.png and b/android/app/src/main/res/drawable-xhdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable-xxhdpi/splash.png b/android/app/src/main/res/drawable-xxhdpi/splash.png
index 90147d7..18465be 100644
Binary files a/android/app/src/main/res/drawable-xxhdpi/splash.png and b/android/app/src/main/res/drawable-xxhdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable-xxxhdpi/splash.png b/android/app/src/main/res/drawable-xxxhdpi/splash.png
index 583188a..30a6888 100644
Binary files a/android/app/src/main/res/drawable-xxxhdpi/splash.png and b/android/app/src/main/res/drawable-xxxhdpi/splash.png differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png
index 8db3b90..2b8fe5d 100644
Binary files a/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png and b/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png
index 38584b3..7aa597c 100644
Binary files a/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png and b/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png differ
diff --git a/assets/images/ico.png b/assets/images/ico.png
deleted file mode 100644
index 6cacf10..0000000
Binary files a/assets/images/ico.png and /dev/null differ
diff --git a/assets/images/icon.png b/assets/images/icon.png
new file mode 100644
index 0000000..39edcbb
Binary files /dev/null and b/assets/images/icon.png differ
diff --git a/assets/images/logo-uh.png b/assets/images/logo-uh.png
index 79bf89a..6a0eaab 100644
Binary files a/assets/images/logo-uh.png and b/assets/images/logo-uh.png differ
diff --git a/assets/images/splash.png b/assets/images/splash.png
index 541438e..8bbe03a 100644
Binary files a/assets/images/splash.png and b/assets/images/splash.png differ
diff --git a/assets/images/splash2.png b/assets/images/splash2.png
index 1e18945..8f3e7e5 100644
Binary files a/assets/images/splash2.png and b/assets/images/splash2.png differ
diff --git a/banner.png b/banner.png
new file mode 100644
index 0000000..2acf8b1
Binary files /dev/null and b/banner.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
index 96a5f6f..717f520 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
index 96a5f6f..717f520 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
index cf8cce3..a39af26 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
index 01c3cc3..9203ee5 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
index eef6d30..27cc6b3 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
index 057949d..3c30181 100644
Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
index ec777ec..751630f 100644
Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
index 583188a..30a6888 100644
Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ
diff --git a/lib/app.dart b/lib/app.dart
deleted file mode 100644
index acdcf5d..0000000
--- a/lib/app.dart
+++ /dev/null
@@ -1,110 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:gestionuh/deps_injector.dart';
-import 'package:gestionuh/src/data/repository/auth_repository/auth_repository.dart';
-import 'package:gestionuh/src/presentation/blocs.dart';
-import 'package:gestionuh/src/presentation/pages.dart';
-import 'package:gestionuh/src/presentation/pages/about_page.dart';
-import 'package:gestionuh/src/presentation/pages/register_page.dart';
-import 'package:gestionuh/src/presentation/theme.dart';
-import 'package:gestionuh/src/utils/constants.dart';
-import 'package:gestionuh/src/utils/constants/routes.dart';
-
-class GestionUhApp extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- title: Constants.appName,
- theme: gestionuhLightTheme,
- debugShowCheckedModeBanner: Constants.testMode,
- onGenerateRoute: (settings) {
- switch (settings.name) {
- case LOGIN_ROUTE_NAME:
- final authRepo = di();
- if (authRepo.logged) {
- return MaterialPageRoute(
- builder: (_) => BlocProvider(
- create: (_) => di()..add(QuotaInitialized()),
- child: const QuotaPage(),
- ),
- );
- }
- return MaterialPageRoute(
- builder: (_) => BlocProvider(
- create: (_) => di(),
- child: const LoginPage(),
- ),
- );
- case QUOTA_ROUTE_NAME:
- return MaterialPageRoute(
- builder: (_) => BlocProvider(
- create: (_) => di()..add(QuotaInitialized()),
- child: const QuotaPage(),
- ),
- );
- case PROFILE_ROUTE_NAME:
- return MaterialPageRoute(
- builder: (_) => BlocProvider(
- create: (_) => di()..add(ProfileInitialized()),
- child: const ProfilePage(),
- ),
- );
- case MAIL_ROUTE_NAME:
- return MaterialPageRoute(
- builder: (_) => BlocProvider(
- create: (_) => di()..add(MailQuotaInitialized()),
- child: const MailQuotaPage(),
- ),
- );
- case RESET_PASSWORD_ROUTE_NAME:
- return MaterialPageRoute(
- builder: (_) => BlocProvider(
- create: (_) => di(),
- child: const ResetPasswordPage(),
- ),
- );
- case REGISTER_ROUTE_NAME:
- return MaterialPageRoute(
- builder: (_) => Overlay(
- initialEntries: [
- OverlayEntry(builder: (context) {
- return BlocProvider(
- create: (_) => di()..add(QuestionsRequestedRegister()),
- child: const RegisterPage(),
- );
- }),
- ],
- ),
- );
- case ABOUT_ROUTE_NAME:
- return MaterialPageRoute(
- builder: (_) => const AboutInformationPage(),
- );
- case RECOVER_PASSWORD_ROUTE_NAME:
- return MaterialPageRoute(
- builder: (_) => BlocProvider(
- create: (_) => di(),
- child: RecoverPasswordPage(),
- ),
- );
- default:
- final authRepo = di();
- if (authRepo.logged) {
- return MaterialPageRoute(
- builder: (_) => BlocProvider(
- create: (_) => di()..add(ProfileInitialized()),
- child: const ProfilePage(),
- ),
- );
- }
- return MaterialPageRoute(
- builder: (_) => BlocProvider(
- create: (_) => di(),
- child: const LoginPage(),
- ),
- );
- }
- },
- );
- }
-}
diff --git a/lib/deps_injector.dart b/lib/deps_injector.dart
deleted file mode 100644
index 1dff131..0000000
--- a/lib/deps_injector.dart
+++ /dev/null
@@ -1,103 +0,0 @@
-import 'package:flutter_secure_storage/flutter_secure_storage.dart';
-import 'package:gestionuh/src/data/api/api.dart';
-import 'package:gestionuh/src/data/local.dart';
-import 'package:gestionuh/src/data/repository.dart';
-import 'package:gestionuh/src/presentation/blocs.dart';
-import 'package:get_it/get_it.dart';
-import 'package:shared_preferences/shared_preferences.dart';
-
-final di = GetIt.instance;
-
-Future init() async {
- //Data Providers
- di.registerSingleton(GestionApi());
-
- final sharedPrefs = await SharedPreferences.getInstance();
- di.registerSingleton(sharedPrefs);
-
- di.registerLazySingleton(
- () => const FlutterSecureStorage(),
- );
-
- di.registerLazySingleton(
- () => LocalStorage(
- prefs: di(),
- secureStorage: di(),
- ),
- );
-
- //Repositories
- di.registerLazySingleton(
- () => AuthRepository(
- api: di(),
- localStorage: di(),
- ),
- );
-
- di.registerLazySingleton(
- () => QuotasRepository(
- api: di(),
- ),
- );
-
- di.registerLazySingleton(
- () => MailQuotasRepository(
- api: di(),
- ),
- );
-
- di.registerLazySingleton(
- () => ProfileRepository(
- api: di(),
- ),
- );
-
- di.registerLazySingleton(
- () => RecoverPasswordRepository(
- api: di(),
- ),
- );
-
- //Blocs
- di.registerFactory(
- () => LoginBloc(
- authRepository: di(),
- ),
- );
-
- di.registerFactory(
- () => QuotaBloc(
- quotasRepository: di(),
- ),
- );
-
- di.registerFactory(
- () => ResetPasswordBloc(
- authRepository: di(),
- ),
- );
-
- di.registerFactory(
- () => MailQuotaBloc(
- mailQuotasRepository: di(),
- ),
- );
-
- di.registerFactory(
- () => RecoverPasswordBloc(
- recoverPasswordRepository: di(),
- ),
- );
-
- di.registerFactory(
- () => RegisterBloc(
- repository: di(),
- ),
- );
-
- di.registerFactory(
- () => ProfileBloc(
- profileRepository: di(),
- ),
- );
-}
diff --git a/lib/main.dart b/lib/main.dart
index 76adcfe..100d3fa 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -1,18 +1,19 @@
import 'package:flutter/material.dart';
-import 'package:gestionuh/app.dart';
-import 'package:gestionuh/deps_injector.dart';
-import 'package:gestionuh/src/data/repository/auth_repository/auth_repository.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:gestionuh/src/app.dart';
+import 'package:gestionuh/src/data/repositories/repositories.dart';
+import 'package:gestionuh/src/dependencies.dart';
+import 'package:gestionuh/src/utils/configurations/configure_nonweb.dart'
+ if (dart.library.html) 'package:gestionuh/src/utils/configurations/configure_web.dart';
+import 'package:gestionuh/src/utils/simple_bloc_observer.dart';
+import 'package:get_it/get_it.dart';
Future main() async {
- await initialize();
- runApp(GestionUhApp());
-}
-
-Future initialize() async {
WidgetsFlutterBinding.ensureInitialized();
-
- await init();
-
+ configureApp();
+ Bloc.observer = SimpleBlocObserver();
+ await DependencyInjection.init();
// Load user credentials
- await di().initialize();
+ await GetIt.I().initialize();
+ runApp(GestionUhApp());
}
diff --git a/lib/src/app.dart b/lib/src/app.dart
new file mode 100644
index 0000000..6ac5c58
--- /dev/null
+++ b/lib/src/app.dart
@@ -0,0 +1,16 @@
+import 'package:flutter/material.dart';
+import 'package:gestionuh/src/presentation/theme/theme.dart';
+import 'package:gestionuh/src/router.dart';
+import 'package:gestionuh/src/utils/constants/constants.dart';
+
+class GestionUhApp extends StatelessWidget {
+ @override
+ Widget build(BuildContext context) {
+ return MaterialApp(
+ title: Constants.appName,
+ theme: gestionuhLightTheme,
+ debugShowCheckedModeBanner: Constants.testMode,
+ onGenerateRoute: RouterNavigation.onGenerateRoute,
+ );
+ }
+}
diff --git a/lib/src/data/api/api.dart b/lib/src/data/api/api.dart
index 0e4119b..a832a02 100644
--- a/lib/src/data/api/api.dart
+++ b/lib/src/data/api/api.dart
@@ -1,8 +1,9 @@
import 'dart:convert';
import 'package:dio/dio.dart';
-import 'package:gestionuh/src/data/models.dart';
-import 'package:gestionuh/src/utils/constants.dart';
+import 'package:gestionuh/src/data/models/base_model.dart';
+import 'package:gestionuh/src/data/models/models.dart';
+import 'package:gestionuh/src/utils/constants/constants.dart';
typedef ClassBuilder = T Function(
Map json);
@@ -27,7 +28,7 @@ class GestionApi {
final Auth response = Auth();
if (userName == null || password == null) {
- response.error = 'Missing User Name or Password';
+ response.error = 'Missing User Name or Password'; // dead code
return response;
}
@@ -138,7 +139,7 @@ class GestionApi {
);
}
- Future resetPassword(String newPassw) async {
+ Future resetPassword(String currentPassw, String newPassw) async {
if (Constants.testMode) return Status(status: true);
Status response;
@@ -251,7 +252,7 @@ class GestionApi {
queryParameters: queryParams,
);
} catch (error) {
- target.error = Errors.retrieveError(error.toString());
+ target.error = Errors.ConnectionError;
return target;
}
@@ -265,7 +266,7 @@ class GestionApi {
target = builder(jsonDecode(response.data!) as Map);
}
} catch (e) {
- target.error = e.toString();
+ target.error = Errors.DefaultError;
}
}
diff --git a/lib/src/data/enums/enums.dart b/lib/src/data/enums/enums.dart
new file mode 100644
index 0000000..28ee91f
--- /dev/null
+++ b/lib/src/data/enums/enums.dart
@@ -0,0 +1 @@
+export 'home_item_enum.dart';
diff --git a/lib/src/data/enums/home_item_enum.dart b/lib/src/data/enums/home_item_enum.dart
new file mode 100644
index 0000000..c4aa248
--- /dev/null
+++ b/lib/src/data/enums/home_item_enum.dart
@@ -0,0 +1,9 @@
+enum HomeItemEnum {
+ Separator,
+ Profile,
+ Quota,
+ MailQuota,
+ ResetPassword,
+ Logout,
+ AboutUs,
+}
diff --git a/lib/src/data/local.dart b/lib/src/data/local.dart
deleted file mode 100644
index a8d95ab..0000000
--- a/lib/src/data/local.dart
+++ /dev/null
@@ -1 +0,0 @@
-export 'local/local_storage.dart';
diff --git a/lib/src/data/local/local_storage.dart b/lib/src/data/local/local_storage.dart
index f686a6c..5840f09 100644
--- a/lib/src/data/local/local_storage.dart
+++ b/lib/src/data/local/local_storage.dart
@@ -1,5 +1,8 @@
+import 'dart:io' show Platform;
+
+import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
-import 'package:gestionuh/src/utils/constants.dart';
+import 'package:gestionuh/src/utils/constants/constants.dart';
import 'package:shared_preferences/shared_preferences.dart';
abstract class ILocalStorage {
@@ -8,6 +11,8 @@ abstract class ILocalStorage {
bool isLogged();
+ bool get isSecureStorageAvailable;
+
Future