Skip to content

Commit

Permalink
Disclaimer page
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Ciber committed Sep 5, 2021
1 parent ebc3d0a commit a145652
Show file tree
Hide file tree
Showing 17 changed files with 255 additions and 25 deletions.
31 changes: 31 additions & 0 deletions DISCLAIMER
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
TODO es una aplicación de código abierto creada por un grupo de desarrolladores cubanos:

https://github.com/todo-devs/

Con el objetivo de ayudar al usuario a consultar y acceder a los servicios de ETECSA.

Se recomienda al usuario descargar siempre la aplicación desde las fuentes oficiales, las cuáles se listan al final de este escrito y que esté al tanto de las actualizaciones para que la aplicación funcione correctamente.

No se almacena ni se exporta ningún tipo de información personal del usuario.

Los servicios solicitados mediante la aplicación responden a las prestaciones de ETECSA, la aplicación solo actúa como una herramienta para facilitar la ejecución de los códigos ussd y la gestión de conexión en el servicio de WIFI_ETECSA y Nauta Hogar. No nos hacemos responsables por demoras o mal funcionamiento de los servicios de la compañía.

El código de la aplicación se encuentra disponible bajo la licencia de código abierto BSD-3, cualquier tipo de copia, modificación y compilación del código deben hacerse respetando la licencia y bajo principios éticos, no se aceptarán contribuciones al código que traten de engañar a los usuarios o de exportar información de los mismos a servidores externos.

UNA VEZ MÁS. HACEMOS ÉNFASIS EN QUE LOS USUARIOS DEBEN DESCARGAR LA APLICACIÓN DESDE FUENTES OFICIALES:

FUENTES OFICIALES:

1. Google Play

https://play.google.com/store/apps/details?id=com.cubanopensource.todo

2. Tienda cubana de aplicaciones Apklis



3. Repositorio oficial de Github

https://github.com/todo-devs/todo/releases

Fecha de actualización: 5 de septiembre del 2021
5 changes: 4 additions & 1 deletion file_structure.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,17 @@ lib/
│   │   ├── settings_event.dart
│   │   └── settings_state.dart
│   ├── router
│   │   ├── disclaimer_page.dart
│   │   ├── router.dart
│   │   ├── settings_location.dart
│   │   └── settings_page.dart
│   ├── settings.dart
│   ├── view
│   │   ├── disclaimer_view.dart
│   │   ├── settings_view.dart
│   │   └── view.dart
│   └── widgets
│   ├── settings_button.dart
│   ├── settings_switch.dart
│   └── widgets.dart
└── ussd_codes
Expand All @@ -140,4 +143,4 @@ lib/
├── ussd_item_widget.dart
└── widgets.dart

41 directories, 99 files
41 directories, 102 files
5 changes: 4 additions & 1 deletion lib/app/widgets/app_drawer_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ class AppDrawerTile extends StatelessWidget {
fontWeight: FontWeight.bold,
),
),
onTap: onTap,
onTap: () {
Navigator.pop(context);
onTap();
},
),
);
}
Expand Down
4 changes: 4 additions & 0 deletions lib/settings/bloc/settings/settings_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:bloc/bloc.dart';
import 'package:flutter/services.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:injectable/injectable.dart';
import 'package:todo/app/app.dart';
Expand All @@ -16,6 +17,7 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> {
appVersion: environment.appVersion,
showFloatWidget: false,
turnOffWifi: false,
disclaimerText: '',
),
) {
on<_LoadData>(_loadData);
Expand All @@ -31,11 +33,13 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> {
) async {
final showFloatWidget = await getShowWidgetPreference();
final turnOffWifi = await getTurnOffWifiPreference();
final disclaimerText = await rootBundle.loadString('DISCLAIMER');

emit(
state.copyWith(
showFloatWidget: showFloatWidget ?? false,
turnOffWifi: turnOffWifi ?? false,
disclaimerText: disclaimerText,
),
);
}
Expand Down
47 changes: 39 additions & 8 deletions lib/settings/bloc/settings/settings_bloc.freezed.dart

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

1 change: 1 addition & 0 deletions lib/settings/bloc/settings/settings_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ class SettingsState with _$SettingsState {
required String appVersion,
required bool showFloatWidget,
required bool turnOffWifi,
required String disclaimerText,
}) = _SettingsState;
}
32 changes: 32 additions & 0 deletions lib/settings/router/disclaimer_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import 'package:beamer/beamer.dart';
import 'package:flutter/material.dart';
import 'package:todo/settings/settings.dart';

class DisclaimerPage extends BeamPage {
DisclaimerPage({
required String disclaimer,
}) : super(
title: 'Términos de uso',
type: BeamPageType.cupertino,
child: DisclaimerView(
disclaimer: disclaimer,
),
);

static String get pathBlueprint => '/settings/disclaimer';

static String route() => '/settings/disclaimer';

static void open(
BuildContext context, {
required String disclaimer,
}) =>
context.beamToNamed(
route(),
data: {'disclaimer': disclaimer},
);

static bool checkBeamState(BeamState state) =>
state.pathBlueprintSegments.contains('disclaimer') &&
state.data.containsKey('disclaimer');
}
1 change: 1 addition & 0 deletions lib/settings/router/router.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export 'disclaimer_page.dart';
export 'settings_location.dart';
export 'settings_page.dart';
5 changes: 5 additions & 0 deletions lib/settings/router/settings_location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ class SettingsLocation extends BeamLocation {
@override
List get pathBlueprints => [
SettingsPage.pathBlueprint,
DisclaimerPage.pathBlueprint,
];

@override
List<BeamPage> buildPages(BuildContext context, BeamState state) => [
HomePage(),
if (SettingsPage.checkBeamState(state)) SettingsPage(),
if (DisclaimerPage.checkBeamState(state))
DisclaimerPage(
disclaimer: state.data['disclaimer'] as String,
),
];
}
1 change: 0 additions & 1 deletion lib/settings/router/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class SettingsPage extends BeamPage {

static void open(BuildContext context) => context.beamToNamed(
route(),
popBeamLocationOnPop: true,
);

static bool checkBeamState(BeamState state) =>
Expand Down
49 changes: 49 additions & 0 deletions lib/settings/view/disclaimer_view.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import 'package:flutter/material.dart';
import 'package:todo/app/app.dart';
import 'package:todo/settings/settings.dart';
import 'package:beamer/beamer.dart';

class DisclaimerView extends StatelessWidget {
const DisclaimerView({
Key? key,
required this.disclaimer,
}) : super(key: key);

final String disclaimer;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const AppBarTitle('Términos de uso'),
),
body: ListView(
children: [
const SizedBox(
height: 20,
),
Container(
margin: const EdgeInsets.all(20),
child: Text(disclaimer),
),
const SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 30,
),
child: SettingsButton(
text: 'Aceptar',
icon: Icons.verified_user,
onPressed: context.beamBack,
),
),
const SizedBox(
height: 20,
),
],
),
);
}
}
15 changes: 14 additions & 1 deletion lib/settings/view/settings_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import 'package:todo/app/app.dart';
import 'package:todo/settings/settings.dart';

class SettingsView extends StatelessWidget {
const SettingsView({Key? key}) : super(key: key);
const SettingsView({
Key? key,
}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -37,6 +39,17 @@ class SettingsView extends StatelessWidget {
),
),
const SizedBox(height: 30),
SettingsButton(
text: 'Términos de uso',
icon: Icons.verified_user,
onPressed: () {
DisclaimerPage.open(
context,
disclaimer: state.disclaimerText,
);
},
),
const SizedBox(height: 10),
],
),
);
Expand Down
Loading

0 comments on commit a145652

Please sign in to comment.