Skip to content

Commit

Permalink
v2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Webierta committed Nov 7, 2021
1 parent ac0d277 commit d982892
Show file tree
Hide file tree
Showing 23 changed files with 1,005 additions and 685 deletions.
117 changes: 117 additions & 0 deletions .idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

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

1 change: 1 addition & 0 deletions assets/files/info.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Esta App ofrece información general y detallada sobre la tarifa eléctrica regulada, el denominado Precio Voluntario para el Pequeño Consumidor (PVPC), con 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.

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).

Expand Down
17 changes: 14 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import 'package:flutter/material.dart';
//import 'package:flutter/services.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'pages/inicio.dart';
import 'services/database.dart';
import 'utils/constantes.dart';

void main() {
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
//SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(statusBarColor: Colors.white));
// https://sarunw.com/posts/how-to-change-status-bar-text-color-in-flutter/
await Hive.initFlutter();
Hive.registerAdapter(DatabaseAdapter());
await Hive.openBox<Database>(boxPVPC);
runApp(PrecioLuz());
}

Expand All @@ -20,7 +27,11 @@ class PrecioLuz extends StatelessWidget {
theme: ThemeData(
//primaryColor: Color(0xFF151026),
primarySwatch: Colors.blue,
appBarTheme: AppBarTheme(color: const Color(0xFF1565C0)),
//appBarTheme: AppBarTheme(color: const Color(0xFF1565C0)),
appBarTheme: AppBarTheme(
color: const Color(0xFF1565C0),
systemOverlayStyle: SystemUiOverlayStyle.light,
),
),
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.7', // VERSION
'Versión 2.4.0', // VERSION
style: Theme.of(context).textTheme.bodyText1,
),
Text(
Expand Down
73 changes: 30 additions & 43 deletions lib/pages/donate.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//import 'dart:ui';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart' show Clipboard, ClipboardData;
import 'package:url_launcher/url_launcher.dart';
Expand All @@ -11,8 +11,7 @@ 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,13 +27,11 @@ 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(
Expand All @@ -45,30 +42,26 @@ class DonationPage extends StatelessWidget {
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í:',
style: sizeText20),
),
const SizedBox(height: 5),
FractionallySizedBox(
widthFactor: 0.3,
child: Container(
padding: const EdgeInsets.only(bottom: 10),
decoration: BoxDecoration(
color: Color(0xFF4CAF50),
border: Border.all(color: Colors.green[900], width: 2.0),
borderRadius: BorderRadius.circular(10.0),
),
child: Center(
child: IconButton(
onPressed: () => _launchURL(urlGitHub),
icon: const Icon(Icons.bug_report,
size: 40, color: Colors.white),
//padding: const EdgeInsets.all(10),
),
Center(
child: RichText(
text: TextSpan(
children: [
TextSpan(
//style: TextStyle(color: Colors.black, fontSize: 22),
style: size22Black,
text:
'¿Crees que has encontrado un problema? Identificar y corregir errores hace que '
'esta App sea mejor para todos. Informa de un error aquí: '),
TextSpan(
style: const TextStyle(
color: Colors.blueAccent,
fontSize: 22,
decoration: TextDecoration.underline,
),
text: 'GitHub issues.',
recognizer: TapGestureRecognizer()..onTap = () => _launchURL(urlGitHub),
),
],
),
),
),
Expand All @@ -84,8 +77,7 @@ class DonationPage extends StatelessWidget {
alignment: Alignment.topLeft,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 10.0),
child: Text('Scan this QR code with your wallet application:',
style: sizeText20),
child: Text('Scan this QR code with your wallet application:', style: sizeText20),
),
),
FractionallySizedBox(
Expand All @@ -96,8 +88,7 @@ class DonationPage extends StatelessWidget {
alignment: Alignment.topLeft,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 10.0),
child:
Text('Or copy the BTC Wallet Address:', style: sizeText20),
child: Text('Or copy the BTC Wallet Address:', style: sizeText20),
),
),
FittedBox(
Expand Down Expand Up @@ -134,15 +125,12 @@ 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 @@ -157,9 +145,8 @@ class DonationPage extends StatelessWidget {
alignment: Alignment.topLeft,
child: const Padding(
padding: EdgeInsets.only(top: 20.0, bottom: 10.0),
child: Text(
'Donate via Paypal (open the PayPal payment website):',
style: sizeText20),
child:
Text('Donate via Paypal (open the PayPal payment website):', style: sizeText20),
),
),
FractionallySizedBox(
Expand Down
Loading

0 comments on commit d982892

Please sign in to comment.