diff --git a/lib/main.dart b/lib/main.dart index 447823b..0698708 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -94,8 +94,6 @@ class MyHomePage extends StatefulWidget { _MyHomePageState createState() => _MyHomePageState(); } - - const List choices = const [ const Choice(title: Strings.ayuda, icon: Icons.help), const Choice(title: Strings.acercaDe, icon: Icons.info), diff --git a/lib/tabs/tab_explorar.dart b/lib/tabs/tab_explorar.dart index a6b2732..1b0f90d 100644 --- a/lib/tabs/tab_explorar.dart +++ b/lib/tabs/tab_explorar.dart @@ -32,6 +32,8 @@ class TabExplorar extends StatefulWidget { } class _TabExplorarState extends State { + static const double TAM_CARD = 220; + /// Inicialización del estado, se comprueba que haya conexión a Internet @override void initState() { @@ -44,7 +46,7 @@ class _TabExplorarState extends State { return ListView( children: [ Container( - height: 210, + height: TAM_CARD, child: Card( semanticContainer: true, clipBehavior: Clip.antiAliasWithSaveLayer, @@ -92,7 +94,7 @@ class _TabExplorarState extends State { ), ), Container( - height: 210, + height: TAM_CARD, child: Card( semanticContainer: true, clipBehavior: Clip.antiAliasWithSaveLayer, @@ -140,7 +142,7 @@ class _TabExplorarState extends State { ), ), Container( - height: 210, + height: TAM_CARD, child: Card( semanticContainer: true, clipBehavior: Clip.antiAliasWithSaveLayer, @@ -187,7 +189,7 @@ class _TabExplorarState extends State { ), ), Container( - height: 210, + height: TAM_CARD, child: Card( semanticContainer: true, clipBehavior: Clip.antiAliasWithSaveLayer, @@ -235,7 +237,7 @@ class _TabExplorarState extends State { ), ), Container( - height: 210, + height: TAM_CARD, child: Card( semanticContainer: true, clipBehavior: Clip.antiAliasWithSaveLayer, @@ -283,43 +285,41 @@ class _TabExplorarState extends State { ), ), Container( - height: 210, + height: TAM_CARD, child: Card( semanticContainer: true, clipBehavior: Clip.antiAliasWithSaveLayer, child: InkWell( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset( - 'assets/images/espacios_naturales.jpg', - fit: BoxFit.cover, - height: 110, - width: double.infinity, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - Strings.espaciosNaturales, - style: - TextStyle(fontSize: 16, fontWeight: FontWeight.bold), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/espacios_naturales.jpg', + fit: BoxFit.cover, + height: 110, + width: double.infinity, ), - ), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8), - child: Text( - "Conoce la Red de Espacios Naturales de Castilla y León con NaturCyL", - style: - TextStyle(fontSize: 16), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + Strings.espaciosNaturales, + style: TextStyle( + fontSize: 16, fontWeight: FontWeight.bold), + ), ), - ) - ], - ), - onTap: () { - launch( - "https://play.google.com/store/apps/details?id=es.davidpob99.naturcyl"); - } - ), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8), + child: Text( + "Conoce la Red de Espacios Naturales de Castilla y León con NaturCyL", + style: TextStyle(fontSize: 16), + ), + ) + ], + ), + onTap: () { + launch( + "https://play.google.com/store/apps/details?id=es.davidpob99.naturcyl"); + }), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), diff --git a/lib/utils.dart b/lib/utils.dart index 1a6b5d8..1d24b74 100644 --- a/lib/utils.dart +++ b/lib/utils.dart @@ -18,6 +18,7 @@ import 'dart:convert'; +import 'package:android_intent/android_intent.dart'; import 'package:csv/csv.dart'; import 'package:data_connection_checker/data_connection_checker.dart'; import 'package:flutter/cupertino.dart'; @@ -295,6 +296,16 @@ class Utils { } } + /// Apertura de una imagen en a través de un [AndroidIntent] según la + /// [urlImagen] + Future intentImagenUrl(String urlImagen) async { + final AndroidIntent intent = AndroidIntent( + action: 'action_view', + data: Uri.encodeFull(urlImagen), + type: 'image/*'); + await intent.launch(); + } + /// Widget para representar una descarga de datos en progreso. Consta de un /// [CircularProgressIndicator] y un texto de información Widget cargandoDatos() { diff --git a/lib/values/strings.dart b/lib/values/strings.dart index 595cd32..4eab0ab 100644 --- a/lib/values/strings.dart +++ b/lib/values/strings.dart @@ -20,7 +20,7 @@ class Strings { // App static const String nombreApp = "TurisCyL"; - static const String version = "Versión 1.0.0"; + static const String version = "Versión 1.0.1"; static const String explorar = "Explorar"; static const String listas = "Listas"; static const String nombreDb = "TurisCyL.db"; @@ -832,6 +832,30 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

android_intent

+

Copyright 2017 The Chromium Authors. All rights reserved.

+

Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met:

+
* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above
+  copyright notice, this list of conditions and the following
+  disclaimer in the documentation and/or other materials provided
+  with the distribution.
+* Neither the name of Google Inc. nor the names of its
+  contributors may be used to endorse or promote products derived
+  from this software without specific prior written permission.
+

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+

autocomplete_textfield

Copyright <2018> <@Felix McCuaig>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

diff --git a/lib/view_detalles.dart b/lib/view_detalles.dart index 42c7e3d..6af4f4a 100644 --- a/lib/view_detalles.dart +++ b/lib/view_detalles.dart @@ -152,7 +152,7 @@ class _VistaDetallesState extends State { onPressed: () { final Event event = Event( title: widget.elemento.nombre, - description: widget.elemento.descripcionApp, + description: widget.elemento.descripcion, location: widget.elemento.lugar, startDate: widget.elemento.fechaInicio, endDate: widget.elemento.fechaFin != null @@ -327,20 +327,25 @@ class _VistaDetallesState extends State { ), ), snapshot.data.urlFoto != null && snapshot.data.urlFoto != '' - ? Card( - semanticContainer: true, - clipBehavior: Clip.antiAliasWithSaveLayer, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - elevation: 5, - margin: EdgeInsets.all(10), - child: Container( - height: 200, - child: Image.network(snapshot.data.urlFoto, - fit: BoxFit.cover, width: double.infinity), - //child: Text("Funciona"), - ), + ? InkWell( + child: Card( + semanticContainer: true, + clipBehavior: Clip.antiAliasWithSaveLayer, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + elevation: 5, + margin: EdgeInsets.all(10), + child: Container( + height: 200, + child: Image.network(snapshot.data.urlFoto, + fit: BoxFit.cover, width: double.infinity), + //child: Text("Funciona"), + ), + ), + onTap: () { + Utils().intentImagenUrl(snapshot.data.urlFoto); + }, ) : Container(), ], @@ -399,8 +404,9 @@ class _VistaDetallesState extends State { width: 80.0, height: 80.0, point: widget.elemento.posicion, - builder: (ctx) => new Container( - child: Icon(Icons.place, color:Colores().primario), + builder: (ctx) => + new Container( + child: Icon(Icons.place, color: Colores().primario), ), ), ], @@ -409,23 +415,30 @@ class _VistaDetallesState extends State { ), ), ), - Card( - semanticContainer: true, - clipBehavior: Clip.antiAliasWithSaveLayer, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - elevation: 5, - margin: EdgeInsets.all(10), - child: Container( - height: 200, - child: widget.elemento.urlImagen != '' - ? Image.network(widget.elemento.urlImagen, - fit: BoxFit.cover, width: double.infinity) - : Image.network(widget.elemento.urlMiniatura, - fit: BoxFit.cover, width: double.infinity), - //child: Text("Funciona"), + InkWell( + child: Card( + semanticContainer: true, + clipBehavior: Clip.antiAliasWithSaveLayer, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + elevation: 5, + margin: EdgeInsets.all(10), + child: Container( + height: 200, + child: widget.elemento.urlImagen != '' + ? Image.network(widget.elemento.urlImagen, + fit: BoxFit.cover, width: double.infinity) + : Image.network(widget.elemento.urlMiniatura, + fit: BoxFit.cover, width: double.infinity), + //child: Text("Funciona"), + ), ), + onTap: () { + Utils().intentImagenUrl(widget.elemento.urlImagen != '' + ? widget.elemento.urlImagen + : widget.elemento.urlMiniatura); + }, ) ], ); @@ -5249,8 +5262,8 @@ class _VistaDetallesState extends State { style: TextStyle( color: Colores().dark, fontWeight: FontWeight.bold)), - widget.elemento.descripcionApp != null - ? Html(data: widget.elemento.descripcionApp) + widget.elemento.descripcion != null + ? Html(data: widget.elemento.descripcion) : Text(Strings.noDisponible), Text(Strings.horariosTarifas, style: TextStyle( @@ -5548,8 +5561,8 @@ class _VistaDetallesState extends State { style: TextStyle( color: Colores().dark, fontWeight: FontWeight.bold)), - widget.elemento.descripcionApp != '' - ? Text(widget.elemento.descripcionApp) + widget.elemento.descripcion != '' + ? Text(widget.elemento.descripcion) : Text(Strings.noDisponible), Text(Strings.infoAdicional, style: TextStyle( @@ -6170,8 +6183,8 @@ class _VistaDetallesState extends State { style: TextStyle( color: Colores().dark, fontWeight: FontWeight.bold)), - widget.elemento.descripcionApp != '' - ? Html(data: widget.elemento.descripcionApp) + widget.elemento.descripcion != '' + ? Html(data: widget.elemento.descripcion) : Text(Strings.noDisponible), Text(Strings.enlaceContenido, style: TextStyle( diff --git a/pubspec.lock b/pubspec.lock index b6e72cc..5f3b5ed 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -8,6 +8,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.4.0" + android_intent: + dependency: "direct main" + description: + name: android_intent + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.7+4" ansicolor: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 635072f..22e0cbf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 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: 1.0.0+160010000 +version: 1.0.1+160010001 environment: sdk: ">=2.7.0 <3.0.0" @@ -46,6 +46,7 @@ dependencies: data_connection_checker: ^0.3.4 introduction_screen: ^1.0.9 flutter_map_marker_popup: ^0.1.4 + android_intent: ^0.3.7+4 flutter_icons: android: true