Skip to content

Commit

Permalink
Arreglados fallos menores y añadida posibilidad de pulsar en las imág…
Browse files Browse the repository at this point in the history
…enes
  • Loading branch information
davidpob99 committed Sep 23, 2020
1 parent f659a4c commit 3fb18ba
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 79 deletions.
2 changes: 0 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ class MyHomePage extends StatefulWidget {
_MyHomePageState createState() => _MyHomePageState();
}



const List<Choice> choices = const <Choice>[
const Choice(title: Strings.ayuda, icon: Icons.help),
const Choice(title: Strings.acercaDe, icon: Icons.info),
Expand Down
72 changes: 36 additions & 36 deletions lib/tabs/tab_explorar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class TabExplorar extends StatefulWidget {
}

class _TabExplorarState extends State<TabExplorar> {
static const double TAM_CARD = 220;

/// Inicialización del estado, se comprueba que haya conexión a Internet
@override
void initState() {
Expand All @@ -44,7 +46,7 @@ class _TabExplorarState extends State<TabExplorar> {
return ListView(
children: [
Container(
height: 210,
height: TAM_CARD,
child: Card(
semanticContainer: true,
clipBehavior: Clip.antiAliasWithSaveLayer,
Expand Down Expand Up @@ -92,7 +94,7 @@ class _TabExplorarState extends State<TabExplorar> {
),
),
Container(
height: 210,
height: TAM_CARD,
child: Card(
semanticContainer: true,
clipBehavior: Clip.antiAliasWithSaveLayer,
Expand Down Expand Up @@ -140,7 +142,7 @@ class _TabExplorarState extends State<TabExplorar> {
),
),
Container(
height: 210,
height: TAM_CARD,
child: Card(
semanticContainer: true,
clipBehavior: Clip.antiAliasWithSaveLayer,
Expand Down Expand Up @@ -187,7 +189,7 @@ class _TabExplorarState extends State<TabExplorar> {
),
),
Container(
height: 210,
height: TAM_CARD,
child: Card(
semanticContainer: true,
clipBehavior: Clip.antiAliasWithSaveLayer,
Expand Down Expand Up @@ -235,7 +237,7 @@ class _TabExplorarState extends State<TabExplorar> {
),
),
Container(
height: 210,
height: TAM_CARD,
child: Card(
semanticContainer: true,
clipBehavior: Clip.antiAliasWithSaveLayer,
Expand Down Expand Up @@ -283,43 +285,41 @@ class _TabExplorarState extends State<TabExplorar> {
),
),
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),
),
Expand Down
11 changes: 11 additions & 0 deletions lib/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -295,6 +296,16 @@ class Utils {
}
}

/// Apertura de una imagen en a través de un [AndroidIntent] según la
/// [urlImagen]
Future<void> 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() {
Expand Down
26 changes: 25 additions & 1 deletion lib/values/strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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.</p>
<h3>android_intent</h3>
<p>Copyright 2017 The Chromium Authors. All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:</p>
<pre><code>* Redistributions <span class="hljs-keyword">of</span> source code must retain <span class="hljs-keyword">the</span> above copyright
notice, this list <span class="hljs-keyword">of</span> conditions <span class="hljs-keyword">and</span> <span class="hljs-keyword">the</span> following disclaimer.
* Redistributions <span class="hljs-keyword">in</span> binary form must reproduce <span class="hljs-keyword">the</span> above
copyright notice, this list <span class="hljs-keyword">of</span> conditions <span class="hljs-keyword">and</span> <span class="hljs-keyword">the</span> following
disclaimer <span class="hljs-keyword">in</span> <span class="hljs-keyword">the</span> documentation <span class="hljs-keyword">and</span>/<span class="hljs-keyword">or</span> other materials provided
<span class="hljs-keyword">with</span> <span class="hljs-keyword">the</span> distribution.
* Neither <span class="hljs-keyword">the</span> name <span class="hljs-keyword">of</span> Google Inc. nor <span class="hljs-keyword">the</span> names <span class="hljs-keyword">of</span> its
contributors may be used <span class="hljs-built_in">to</span> endorse <span class="hljs-keyword">or</span> promote products derived
<span class="hljs-built_in">from</span> this software <span class="hljs-keyword">without</span> specific prior written permission.
</code></pre><p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; 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.</p>
<h3>autocomplete_textfield</h3>
<p>Copyright <2018> &lt;@Felix McCuaig&gt;</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &quot;Software&quot;), 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:</p>
Expand Down
91 changes: 52 additions & 39 deletions lib/view_detalles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class _VistaDetallesState extends State<VistaDetalles> {
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
Expand Down Expand Up @@ -327,20 +327,25 @@ class _VistaDetallesState extends State<VistaDetalles> {
),
),
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(),
],
Expand Down Expand Up @@ -399,8 +404,9 @@ class _VistaDetallesState extends State<VistaDetalles> {
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),
),
),
],
Expand All @@ -409,23 +415,30 @@ class _VistaDetallesState extends State<VistaDetalles> {
),
),
),
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);
},
)
],
);
Expand Down Expand Up @@ -5249,8 +5262,8 @@ class _VistaDetallesState extends State<VistaDetalles> {
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(
Expand Down Expand Up @@ -5548,8 +5561,8 @@ class _VistaDetallesState extends State<VistaDetalles> {
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(
Expand Down Expand Up @@ -6170,8 +6183,8 @@ class _VistaDetallesState extends State<VistaDetalles> {
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(
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3fb18ba

Please sign in to comment.