Skip to content

Commit

Permalink
v2.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Webierta committed Aug 5, 2021
1 parent 13a1eda commit 1a73617
Show file tree
Hide file tree
Showing 27 changed files with 366 additions and 280 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

### Información detallada por horas sobre el precio de la electricidad en España (PVPC) para una gestión eficiente del consumo de electricidad

![Screenshot](https://raw.githubusercontent.com/Webierta/precio-luz/master/Screenshot_1583839388.png)
![Screenshot](https://raw.githubusercontent.com/Webierta/precio-luz/master/Screenshot_1.png)

![Screenshot](https://raw.githubusercontent.com/Webierta/precio-luz/master/Screenshot_1583839405.png) ![Screenshot](https://raw.githubusercontent.com/Webierta/precio-luz/master/Screenshot_1583839415.png)
![Screenshot](https://raw.githubusercontent.com/Webierta/precio-luz/master/Screenshot_2.png) ![Screenshot](https://raw.githubusercontent.com/Webierta/precio-luz/master/Screenshot_3.png)

![Screenshot](https://raw.githubusercontent.com/Webierta/precio-luz/master/Screenshot_1583839452.png) ![Screenshot](https://raw.githubusercontent.com/Webierta/precio-luz/master/Screenshot_1583839466.png)
![Screenshot](https://raw.githubusercontent.com/Webierta/precio-luz/master/Screenshot_4.png) ![Screenshot](https://raw.githubusercontent.com/Webierta/precio-luz/master/Screenshot_6.png)

![Screenshot](https://raw.githubusercontent.com/Webierta/precio-luz/master/Screenshot_6.png)

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. En definitiva, esta App trata de ayudar a gestionar el consumo eléctrico de forma más eficiente.

Expand Down
Binary file added Screenshot_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Screenshot_1583839388.png
Binary file not shown.
Binary file removed Screenshot_1583839405.png
Binary file not shown.
Binary file removed Screenshot_1583839415.png
Binary file not shown.
Binary file removed Screenshot_1583839452.png
Binary file not shown.
Binary file removed Screenshot_1583839466.png
Binary file not shown.
Binary file added Screenshot_2.png
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 Screenshot_3.png
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 Screenshot_4.png
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 Screenshot_5.png
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 Screenshot_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'pages/inicio.dart';

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

class PrecioLuz extends StatelessWidget {
@override
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.2', // VERSION
'Versión 2.3.3', // VERSION
style: Theme.of(context).textTheme.bodyText1,
),
Text(
Expand Down
184 changes: 92 additions & 92 deletions lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,110 +44,110 @@ class _HomeState extends State<Home> {
appBar: AppBar(),
),
body: SafeArea(
child: Container(
height: MediaQuery.of(context).size.height,
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
children: <Widget>[
FittedBox(
child: Center(
child: Container(
//height: MediaQuery.of(context).size.height,
padding: const EdgeInsets.all(20.0),
child: Column(
children: <Widget>[
Align(
alignment: Alignment.topLeft,
child: FittedBox(
child: Text(
'Selecciona el día que quieres consultar:',
style: Theme.of(context).textTheme.subtitle1,
textAlign: TextAlign.center,
),
),
const SizedBox(height: 20.0),
Form(
key: _formKey,
child: Column(
children: <Widget>[
TextFormField(
decoration: const InputDecoration(
labelText: 'Fecha',
labelStyle: TextStyle(
color: Colors.black45,
fontSize: 18.0,
fontWeight: FontWeight.w400,
),
prefixIcon: const Icon(
Icons.calendar_today,
color: Colors.black45,
),
contentPadding: const EdgeInsets.symmetric(vertical: 30.0),
),
const SizedBox(height: 10.0),
Form(
key: _formKey,
child: Column(
children: <Widget>[
TextFormField(
decoration: const InputDecoration(
labelText: 'Fecha',
labelStyle: TextStyle(
color: Colors.black45,
fontSize: 18.0,
fontWeight: FontWeight.w400,
),
style: const TextStyle(
//height: 0.0,
fontWeight: FontWeight.bold,
fontSize: 18,
prefixIcon: const Icon(
Icons.calendar_today,
color: Colors.black45,
),
validator: (value) => value.trim().isEmpty ? 'Fecha requerida' : null,
controller: _dataController,
onTap: () async {
FocusScope.of(context).requestFocus(FocusNode());
DateTime picked = await showDatePicker(
context: context,
locale: const Locale('es', 'ES'),
initialDate: DateTime.now(),
firstDate: DateTime(2021, 6),
lastDate: manana,
);
if (picked != null) {
//if (picked != _fechaIn) { RESET?? //}
_dataController.text = DateFormat('dd/MM/yyyy').format(picked);
setState(() {
_fechaIn = DateFormat('yyyy-MM-dd').format(picked);
_datos.fecha = _fechaIn;
});
noPublicado = picked == manana && hoy.hour < 20 ? true : false;
}
},
contentPadding: const EdgeInsets.symmetric(vertical: 30.0),
),
style: const TextStyle(
//height: 0.0,
fontWeight: FontWeight.bold,
fontSize: 18,
),
const SizedBox(height: 30),
Material(
elevation: 5.0,
borderRadius: BorderRadius.circular(30.0),
color: const Color(0xFF1565C0),
child: MaterialButton(
minWidth: MediaQuery.of(context).size.width,
padding: const EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 15.0),
child: const Text(
"Consultar",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.0,
color: Colors.white,
fontWeight: FontWeight.bold,
),
validator: (value) => value.trim().isEmpty ? 'Fecha requerida' : null,
controller: _dataController,
onTap: () async {
FocusScope.of(context).requestFocus(FocusNode());
DateTime picked = await showDatePicker(
context: context,
locale: const Locale('es', 'ES'),
initialDate: DateTime.now(),
firstDate: DateTime(2021, 6),
lastDate: manana,
);
if (picked != null) {
//if (picked != _fechaIn) { RESET?? //}
_dataController.text = DateFormat('dd/MM/yyyy').format(picked);
setState(() {
_fechaIn = DateFormat('yyyy-MM-dd').format(picked);
_datos.fecha = _fechaIn;
});
noPublicado = picked == manana && hoy.hour < 20 ? true : false;
}
},
),
const SizedBox(height: 30),
Material(
elevation: 5.0,
borderRadius: BorderRadius.circular(30.0),
color: const Color(0xFF1565C0),
child: MaterialButton(
minWidth: MediaQuery.of(context).size.width,
padding: const EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 15.0),
child: const Text(
"Consultar",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.0,
color: Colors.white,
fontWeight: FontWeight.bold,
),
onPressed: () async {
setState(() => _progressActive = true);
seguirConsulta = true;
if (noPublicado == true) {
await dialogoNoPublicado();
}
if (_formKey.currentState.validate() && seguirConsulta == true) {
await consultar();
}
},
),
onPressed: () async {
setState(() => _progressActive = true);
seguirConsulta = true;
if (noPublicado == true) {
await dialogoNoPublicado();
}
if (_formKey.currentState.validate() && seguirConsulta == true) {
await consultar();
}
},
),
const SizedBox(height: 20.0),
SizedBox(
height: 2.0,
child: _progressActive == true
? LinearProgressIndicator(
valueColor: AlwaysStoppedAnimation(Colors.blue),
backgroundColor: Colors.yellow,
)
: null,
),
],
),
),
const SizedBox(height: 20.0),
SizedBox(
height: 2.0,
child: _progressActive == true
? LinearProgressIndicator(
valueColor: AlwaysStoppedAnimation(Colors.blue),
backgroundColor: Colors.yellow,
)
: null,
),
],
),
],
),
),
],
),
),
),
Expand Down
51 changes: 37 additions & 14 deletions lib/pages/info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,17 @@ class Formula extends StatefulWidget {
class _FormulaState extends State<Formula> {
bool visiblePoliticos = false;

ScrollController _controller;
@override
void initState() {
super.initState();
_controller = ScrollController();
}

@override
Widget build(BuildContext context) {
return Container(
return SingleChildScrollView(
controller: _controller,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
Expand All @@ -98,26 +106,41 @@ class _FormulaState extends State<Formula> {
const Text('Distribución (REE) +', style: TextStyle(color: Colors.white)),
const Text('Impuestos (IVA) +', style: TextStyle(color: Colors.white)),
const FittedBox(
child: Text(
'Otros costes regulados +',
style: TextStyle(color: Colors.white),
)),
child: Text('Otros costes regulados +', style: TextStyle(color: Colors.white)),
),
InkWell(
onTap: () => setState(() => visiblePoliticos = !visiblePoliticos),
onTap: () => setState(() {
visiblePoliticos = !visiblePoliticos;
if (visiblePoliticos) {
WidgetsBinding.instance.addPostFrameCallback((_) {
_controller.animateTo(
_controller.position.maxScrollExtent,
duration: Duration(seconds: 1),
curve: Curves.ease,
);
});
} else {
_controller.animateTo(_controller.position.minScrollExtent,
duration: Duration(seconds: 1), curve: Curves.ease);
}
}),
child: const FittedBox(
child: Text('Otros costes no regulados* +', style: TextStyle(color: Colors.white)),
),
),
visiblePoliticos
? const FittedBox(
child: Text(
'(políticos y puertas giratorias) ',
style: TextStyle(color: Colors.white70),
),
)
: const SizedBox(height: 0),
const Divider(color: Colors.white70),
const Text('= PVPC', style: TextStyle(color: Colors.white)),
const SizedBox(height: 10),
Opacity(
opacity: visiblePoliticos ? 1.0 : 0.0,
child: const Text(
'* Prácticas comerciales oligopolistas en un sistema opaco y sin libre competencia '
'permitido por la Comisión Nacional de la Competencia y los políticos, '
'habituales de las puertas giratorias.',
textScaleFactor: 1,
style: TextStyle(color: Colors.white70),
),
)
],
),
);
Expand Down
12 changes: 7 additions & 5 deletions lib/pages/inicio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ class _InicioState extends State<Inicio> {
padding: const EdgeInsets.all(20.0),
child: Column(
children: <Widget>[
FittedBox(
child: Text(
'Selecciona el método de descarga de datos:',
style: Theme.of(context).textTheme.subtitle1,
textAlign: TextAlign.center,
Align(
alignment: Alignment.topLeft,
child: FittedBox(
child: Text(
'Selecciona el método de descarga de datos:',
style: Theme.of(context).textTheme.subtitle1,
),
),
),
Stack(
Expand Down
Loading

0 comments on commit 1a73617

Please sign in to comment.