Skip to content

Commit

Permalink
v2.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Webierta committed Oct 28, 2021
1 parent cdeb890 commit e402f63
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 36 deletions.
2 changes: 1 addition & 1 deletion fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>Detailed information by hours on the price of electricity in Spain (PVPC) for efficient management of electricity consumption.</p><p>This App offers general and detailed information on the price of electricity (PVPC) and the cheapest and most expensive hours throughout a day to facilitate the adjustment of consumption habits by seeking savings in the electricity bill.</p><p>In short, this App tries to help manage electricity consumption more efficiently.</p><p>The App has been adapted to the new electricity tariff system that has been applied since June 1, 2021. One of the main changes introduced by the regulations is that all the customers covered by the PVPC are grouped under the same toll rate called 2.0 TD, which replaces the previous three (the default rate 2.0 A, the night rate 2.0 DHA, and the electric vehicle rate 2.0 DHS).</p><p>The application supports two methods to obtain the data: with the official API (recommended) and from a file. To use the API you need to authenticate yourself with a personal access code (token) that is obtained free of charge by requesting it by email to consultaios@ree.es. The second method, extracting data from a file, is a slower, less efficient, and more error-prone process.</p>
<p>Detailed information by hours on the price of electricity in Spain (PVPC) for efficient management of electricity consumption.</p><p>This App offers general and detailed information on the price of electricity (PVPC) and the cheapest and most expensive hours throughout a day to facilitate the adjustment of consumption habits by seeking savings in the electricity bill.</p><p>In short, this App tries to help manage electricity consumption more efficiently.</p><p>The App has been adapted to the new electricity tariff system that has been applied since June 1, 2021. One of the main changes introduced by the regulations is that all the customers covered by the PVPC are grouped under the same toll rate called 2.0 TD, which replaces the previous three (the default rate 2.0 A, the night rate 2.0 DHA, and the electric vehicle rate 2.0 DHS).</p><p>This new 2.0 TD rate has a time discrimination in three periods: peak, flat and valley that are defined according to the day of the week, the time of day and the geographical territory (different for Ceuta and Melilla).</p><p>The App includes a tool that calculates and orders the cheapest time bands of the day (average prices) for a certain interval of time. For example, it is useful to know the best time of day to run the washer and dryer consecutively.</p>
2 changes: 1 addition & 1 deletion fastlane/metadata/android/es/full_description.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>Información detallada por horas sobre el precio de la electricidad en España (PVPC) para una gestión eficiente del consumo de electricidad.</p><p>Esta App ofrece información general y detallada sobre el precio de la electricidad (PVPC) y las horas más baratas y más caras a lo largo de un día para facilitar el ajuste de los hábitos de consumo buscando el ahorro en la factura de la luz.</p><p>En definitiva, esta App trata de ayudar a gestionar el consumo eléctrico de forma más eficiente.</p><p>La App se ha adaptado al nuevo sistema de la tarifa eléctrica que se aplica desde el 1 de junio de 2021. Uno de los principales cambios que introduce la normativa es que todos los clientes acogidos al PVPC se agrupan bajo una misma tarifa de peaje denominada 2.0 TD, que sustituye a las tres anteriores (la tarifa por defecto 2.0 A, la tarifa nocturna 2.0 DHA, y la de vehículo eléctrico 2.0 DHS).</p><p>La aplicación admite dos métodos para la obtención de los datos: con la API oficial (recomendado) y desde un archivo. Para utilizar la API se necesita autentificarse con un código de acceso personal (token) que se obtiene gratuitamente solicitándolo por email a consultasios@ree.es. El segundo método, la extracción de datos desde un archivo, es un proceso más lento, menos eficiente y más propenso a errores.</p>
<p>Información detallada por horas sobre el precio de la electricidad en España (PVPC) para una gestión eficiente del consumo de electricidad.</p><p>Esta App ofrece información general y detallada sobre el precio de la electricidad (PVPC) y las horas más baratas y más caras a lo largo de un día para facilitar el ajuste de los hábitos de consumo buscando el ahorro en la factura de la luz.</p><p>En definitiva, esta App trata de ayudar a gestionar el consumo eléctrico de forma más eficiente.</p><p>La App se ha adaptado al nuevo sistema de la tarifa eléctrica que se aplica desde el 1 de junio de 2021. Uno de los principales cambios que introduce la normativa es que todos los clientes acogidos al PVPC se agrupan bajo una misma tarifa de peaje denominada 2.0 TD, que sustituye a las tres anteriores (la tarifa por defecto 2.0 A, la tarifa nocturna 2.0 DHA, y la de vehículo eléctrico 2.0 DHS).</p><p>Esta nueva tarifa 2.0 TD cuenta con una discriminación horaria en tres periodos: punta, llano y valle que se definen según el día de la semana, la hora del día y el territorio geográfico (distinto para Ceuta y Melilla).</p><p>La App incluye una herramienta que calcula y ordena las franjas horarias más baratas del día (precios medios) para un intervalo determinado de tiempo. Por ejemplo, es útil para saber el mejor momento del día para poner consecutivamente la lavadora y la secadora.</p>
11 changes: 7 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
//import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'pages/inicio.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(statusBarColor: Colors.white));
//SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(statusBarColor: Colors.white));
runApp(PrecioLuz());
}

Expand All @@ -17,8 +17,11 @@ class PrecioLuz extends StatelessWidget {
title: 'PrecioLuz',
localizationsDelegates: GlobalMaterialLocalizations.delegates,
supportedLocales: [const Locale('es', 'ES')],
//theme: ThemeData(primaryColor: Color(0xff01A0C7)),
theme: ThemeData(primaryColor: Color(0xFF1565C0)),
theme: ThemeData(
//primaryColor: Color(0xFF151026),
primarySwatch: Colors.blue,
appBarTheme: AppBarTheme(color: const Color(0xFF1565C0)),
),
home: Inicio(),
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class About extends StatelessWidget {
const Head(),
const Icon(Icons.code, size: 60, color: Color(0xFF1565C0)),
Text(
'Versión 2.3.6', // VERSION
'Versión 2.3.7', // VERSION
style: Theme.of(context).textTheme.bodyText1,
),
Text(
Expand Down
43 changes: 28 additions & 15 deletions lib/pages/donate.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'dart:ui';

//import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart' show Clipboard, ClipboardData;
import 'package:url_launcher/url_launcher.dart';

import '../utils/constantes.dart';
import '../widgets/head.dart';

class DonationPage extends StatelessWidget {
Expand All @@ -12,7 +11,8 @@ class DonationPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
const String btcAddress = '15ZpNzqbYFx9P7wg4U438JMwZr2q3W6fkS';
const String urlPayPal = 'https://www.paypal.com/donate?hosted_button_id=986PSAHLH6N4L';
const String urlPayPal =
'https://www.paypal.com/donate?hosted_button_id=986PSAHLH6N4L';
const String urlGitHub = 'https://github.com/Webierta/precio-luz/issues';

void _launchURL(String url) async {
Expand All @@ -28,25 +28,29 @@ class DonationPage extends StatelessWidget {
return Scaffold(
appBar: AppBar(title: const Text('Buy Me a Coffee')),
body: SingleChildScrollView(
padding: const EdgeInsets.only(top: 10, left: 10, right: 10, bottom: 40),
padding:
const EdgeInsets.only(top: 10, left: 10, right: 10, bottom: 40),
child: Column(
children: [
const Head(),
const Icon(Icons.favorite_border, size: 60, color: Color(0xFF1565C0)),
const Icon(Icons.favorite_border,
size: 60, color: Color(0xFF1565C0)),
const Divider(),
const SizedBox(height: 10.0),
const Align(
alignment: Alignment.topLeft,
child: Text(
'Esta App es Software libre y de Código Abierto. Por favor considera colaborar '
'para mantener activo el desarrollo de esta App.'),
'para mantener activo el desarrollo de esta App.',
style: sizeText20),
),
const SizedBox(height: 10.0),
const Align(
alignment: Alignment.topLeft,
child: Text(
'¿Crees que has encontrado un problema? Identificar y corregir errores hace que '
'esta App sea mejor para todos. Informa de un error aquí:'),
'esta App sea mejor para todos. Informa de un error aquí:',
style: sizeText20),
),
const SizedBox(height: 5),
FractionallySizedBox(
Expand All @@ -61,7 +65,8 @@ class DonationPage extends StatelessWidget {
child: Center(
child: IconButton(
onPressed: () => _launchURL(urlGitHub),
icon: const Icon(Icons.bug_report, size: 40, color: Colors.white),
icon: const Icon(Icons.bug_report,
size: 40, color: Colors.white),
//padding: const EdgeInsets.all(10),
),
),
Expand All @@ -72,13 +77,15 @@ class DonationPage extends StatelessWidget {
alignment: Alignment.topLeft,
child: Text(
'Puedes colaborar con el desarrollo de ésta y otras aplicaciones con una pequeña '
'aportación a mi monedero de Bitcoins o vía PayPal.'),
'aportación a mi monedero de Bitcoins o vía PayPal.',
style: sizeText20),
),
const Align(
alignment: Alignment.topLeft,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 10.0),
child: Text('Scan this QR code with your wallet application:'),
child: Text('Scan this QR code with your wallet application:',
style: sizeText20),
),
),
FractionallySizedBox(
Expand All @@ -89,7 +96,8 @@ class DonationPage extends StatelessWidget {
alignment: Alignment.topLeft,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 10.0),
child: Text('Or copy the BTC Wallet Address:'),
child:
Text('Or copy the BTC Wallet Address:', style: sizeText20),
),
),
FittedBox(
Expand Down Expand Up @@ -126,12 +134,15 @@ class DonationPage extends StatelessWidget {
height: 50,
decoration: BoxDecoration(
border: Border(
left: BorderSide(color: Colors.black12, style: BorderStyle.solid)),
left: BorderSide(
color: Colors.black12,
style: BorderStyle.solid)),
),
child: IconButton(
icon: const Icon(Icons.copy),
onPressed: () async {
await Clipboard.setData(ClipboardData(text: btcAddress));
await Clipboard.setData(
ClipboardData(text: btcAddress));
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text('BTC Address copied to Clipboard.'),
));
Expand All @@ -146,7 +157,9 @@ class DonationPage extends StatelessWidget {
alignment: Alignment.topLeft,
child: const Padding(
padding: EdgeInsets.only(top: 20.0, bottom: 10.0),
child: Text('Donate vía Paypal (open the PayPal payment website):'),
child: Text(
'Donate via Paypal (open the PayPal payment website):',
style: sizeText20),
),
),
FractionallySizedBox(
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/inicio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ class _InicioState extends State<Inicio> {
),
),
BotonSource(source: Source.api, action: actionApi),
SizedBox(height: 20.0),
//SizedBox(height: 20.0),
Divider(color: Colors.blueGrey, indent: 20, endIndent: 20, height: 40.0),
BotonSource(source: Source.file, action: actionFile),
],
),
Expand Down
3 changes: 1 addition & 2 deletions lib/services/datos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:math';
import '../utils/estados.dart';
import 'package:xml/xml.dart';
import 'package:http/http.dart' as http;
import 'package:shared_preferences/shared_preferences.dart';
import 'package:intl/intl.dart';

import '../utils/estados.dart';
import 'datos_json.dart';

class Datos {
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/constantes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ const ShapeBorderClipper kBorderClipper = ShapeBorderClipper(
borderRadius: BorderRadius.all(Radius.circular(10)),
),
);

const TextStyle sizeText20 = TextStyle(fontSize: 20.0);
1 change: 1 addition & 0 deletions lib/widgets/appbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class BaseAppBar extends StatelessWidget implements PreferredSizeWidget {
Widget build(BuildContext context) {
return AppBar(
title: FittedBox(child: title),
//backgroundColor: Color(0xFF1565C0),
actions: <Widget>[
IconButton(
icon: Icon(Icons.help, color: Colors.white),
Expand Down
34 changes: 25 additions & 9 deletions lib/widgets/fab.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';

import '../utils/constantes.dart';
import 'head.dart';

class Fab extends StatelessWidget {
Expand All @@ -19,22 +19,38 @@ class Fab extends StatelessWidget {
child: Column(
children: const <Widget>[
Head(),
Icon(Icons.help_outline, size: 60, color: Color(0xFF1565C0)),
Icon(Icons.help_outline,
size: 60, color: Color(0xFF1565C0)),
Divider(),
SizedBox(height: 10.0),
Text('La aplicación admite dos métodos para la obtención de los datos: '
'con la API oficial (recomendado) y desde un archivo.'),
Text(
'La aplicación admite dos métodos para la obtención de los datos: '
'con la API oficial (recomendado) y desde un archivo.',
style: sizeText20),
SizedBox(height: 10.0),
Text(
'Para utilizar la API se necesita autentificarse con un código de acceso personal '
'(token) que se obtiene gratuitamente solicitándolo por email a consultasios@ree.es'),
'(token) gestionado por el Sistema de Información del Operador del Sistema (e·sios).',
style: sizeText20),
SizedBox(height: 10.0),
Text('Solo es necesario introducir el token personal la primera vez '
'puesto que queda almacenado en los ajustes de la aplicación.'),
Text(
'El segundo método, la extracción de datos desde un archivo, es un proceso '
'potencialmente más lento, menos eficiente y más propenso a errores.',
style: sizeText20),
SizedBox(height: 10.0),
Icon(Icons.warning,
color: Color(0xFFF44336), size: 60.0),
Text(
'El segundo método, la extracción de datos desde un archivo, es un proceso más lento, '
'menos eficiente y más propenso a errores.'),
'IMPORTANTE: Si dispone y utiliza un token como código de acceso al '
'sistema REData de REE, debe tener en cuenta la advertencia de realizar '
'un uso responsable de la API y no ejecutar peticiones masivas, '
'redundantes o innecesarias. En REE se analiza la utilización de la API por '
'parte de los usuarios con el fin de detectar malas prácticas, siendo '
'cada usuario responsable del uso de su token personal. Esta aplicación '
'no asume ninguna responsabilidad sobre posibles acciones de REE '
'derivadas de un uso inadecuado o irresponsable de la API por parte de '
'los usuarios.',
style: sizeText20),
],
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/read_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ReadFile extends StatelessWidget {
return Text(
snapshot.data ?? 'Error: archivo no encontrado',
softWrap: true,
style: TextStyle(fontSize: 18, color: Colors.black87),
style: TextStyle(fontSize: 20, color: Colors.black87),
);
},
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: Detailed information by hours on the price of electricity in Spain
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.3.6+20
version: 2.3.7+21

environment:
sdk: ">=2.6.0 <3.0.0"
Expand Down

0 comments on commit e402f63

Please sign in to comment.