Skip to content

Commit 3fb18ba

Browse files
committed
Arreglados fallos menores y añadida posibilidad de pulsar en las imágenes
1 parent f659a4c commit 3fb18ba

7 files changed

+133
-79
lines changed

lib/main.dart

-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ class MyHomePage extends StatefulWidget {
9494
_MyHomePageState createState() => _MyHomePageState();
9595
}
9696

97-
98-
9997
const List<Choice> choices = const <Choice>[
10098
const Choice(title: Strings.ayuda, icon: Icons.help),
10199
const Choice(title: Strings.acercaDe, icon: Icons.info),

lib/tabs/tab_explorar.dart

+36-36
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ class TabExplorar extends StatefulWidget {
3232
}
3333

3434
class _TabExplorarState extends State<TabExplorar> {
35+
static const double TAM_CARD = 220;
36+
3537
/// Inicialización del estado, se comprueba que haya conexión a Internet
3638
@override
3739
void initState() {
@@ -44,7 +46,7 @@ class _TabExplorarState extends State<TabExplorar> {
4446
return ListView(
4547
children: [
4648
Container(
47-
height: 210,
49+
height: TAM_CARD,
4850
child: Card(
4951
semanticContainer: true,
5052
clipBehavior: Clip.antiAliasWithSaveLayer,
@@ -92,7 +94,7 @@ class _TabExplorarState extends State<TabExplorar> {
9294
),
9395
),
9496
Container(
95-
height: 210,
97+
height: TAM_CARD,
9698
child: Card(
9799
semanticContainer: true,
98100
clipBehavior: Clip.antiAliasWithSaveLayer,
@@ -140,7 +142,7 @@ class _TabExplorarState extends State<TabExplorar> {
140142
),
141143
),
142144
Container(
143-
height: 210,
145+
height: TAM_CARD,
144146
child: Card(
145147
semanticContainer: true,
146148
clipBehavior: Clip.antiAliasWithSaveLayer,
@@ -187,7 +189,7 @@ class _TabExplorarState extends State<TabExplorar> {
187189
),
188190
),
189191
Container(
190-
height: 210,
192+
height: TAM_CARD,
191193
child: Card(
192194
semanticContainer: true,
193195
clipBehavior: Clip.antiAliasWithSaveLayer,
@@ -235,7 +237,7 @@ class _TabExplorarState extends State<TabExplorar> {
235237
),
236238
),
237239
Container(
238-
height: 210,
240+
height: TAM_CARD,
239241
child: Card(
240242
semanticContainer: true,
241243
clipBehavior: Clip.antiAliasWithSaveLayer,
@@ -283,43 +285,41 @@ class _TabExplorarState extends State<TabExplorar> {
283285
),
284286
),
285287
Container(
286-
height: 210,
288+
height: TAM_CARD,
287289
child: Card(
288290
semanticContainer: true,
289291
clipBehavior: Clip.antiAliasWithSaveLayer,
290292
child: InkWell(
291-
child: Column(
292-
crossAxisAlignment: CrossAxisAlignment.start,
293-
children: [
294-
Image.asset(
295-
'assets/images/espacios_naturales.jpg',
296-
fit: BoxFit.cover,
297-
height: 110,
298-
width: double.infinity,
299-
),
300-
Padding(
301-
padding: const EdgeInsets.all(8.0),
302-
child: Text(
303-
Strings.espaciosNaturales,
304-
style:
305-
TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
293+
child: Column(
294+
crossAxisAlignment: CrossAxisAlignment.start,
295+
children: [
296+
Image.asset(
297+
'assets/images/espacios_naturales.jpg',
298+
fit: BoxFit.cover,
299+
height: 110,
300+
width: double.infinity,
306301
),
307-
),
308-
Padding(
309-
padding: const EdgeInsets.only(left: 8.0, right: 8),
310-
child: Text(
311-
"Conoce la Red de Espacios Naturales de Castilla y León con NaturCyL",
312-
style:
313-
TextStyle(fontSize: 16),
302+
Padding(
303+
padding: const EdgeInsets.all(8.0),
304+
child: Text(
305+
Strings.espaciosNaturales,
306+
style: TextStyle(
307+
fontSize: 16, fontWeight: FontWeight.bold),
308+
),
314309
),
315-
)
316-
],
317-
),
318-
onTap: () {
319-
launch(
320-
"https://play.google.com/store/apps/details?id=es.davidpob99.naturcyl");
321-
}
322-
),
310+
Padding(
311+
padding: const EdgeInsets.only(left: 8.0, right: 8),
312+
child: Text(
313+
"Conoce la Red de Espacios Naturales de Castilla y León con NaturCyL",
314+
style: TextStyle(fontSize: 16),
315+
),
316+
)
317+
],
318+
),
319+
onTap: () {
320+
launch(
321+
"https://play.google.com/store/apps/details?id=es.davidpob99.naturcyl");
322+
}),
323323
shape: RoundedRectangleBorder(
324324
borderRadius: BorderRadius.circular(10.0),
325325
),

lib/utils.dart

+11
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import 'dart:convert';
2020

21+
import 'package:android_intent/android_intent.dart';
2122
import 'package:csv/csv.dart';
2223
import 'package:data_connection_checker/data_connection_checker.dart';
2324
import 'package:flutter/cupertino.dart';
@@ -295,6 +296,16 @@ class Utils {
295296
}
296297
}
297298

299+
/// Apertura de una imagen en a través de un [AndroidIntent] según la
300+
/// [urlImagen]
301+
Future<void> intentImagenUrl(String urlImagen) async {
302+
final AndroidIntent intent = AndroidIntent(
303+
action: 'action_view',
304+
data: Uri.encodeFull(urlImagen),
305+
type: 'image/*');
306+
await intent.launch();
307+
}
308+
298309
/// Widget para representar una descarga de datos en progreso. Consta de un
299310
/// [CircularProgressIndicator] y un texto de información
300311
Widget cargandoDatos() {

lib/values/strings.dart

+25-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class Strings {
2121
// App
2222
static const String nombreApp = "TurisCyL";
23-
static const String version = "Versión 1.0.0";
23+
static const String version = "Versión 1.0.1";
2424
static const String explorar = "Explorar";
2525
static const String listas = "Listas";
2626
static const String nombreDb = "TurisCyL.db";
@@ -832,6 +832,30 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
832832
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
833833
SOFTWARE.</p>
834834
835+
<h3>android_intent</h3>
836+
<p>Copyright 2017 The Chromium Authors. All rights reserved.</p>
837+
<p>Redistribution and use in source and binary forms, with or without modification,
838+
are permitted provided that the following conditions are met:</p>
839+
<pre><code>* Redistributions <span class="hljs-keyword">of</span> source code must retain <span class="hljs-keyword">the</span> above copyright
840+
notice, this list <span class="hljs-keyword">of</span> conditions <span class="hljs-keyword">and</span> <span class="hljs-keyword">the</span> following disclaimer.
841+
* Redistributions <span class="hljs-keyword">in</span> binary form must reproduce <span class="hljs-keyword">the</span> above
842+
copyright notice, this list <span class="hljs-keyword">of</span> conditions <span class="hljs-keyword">and</span> <span class="hljs-keyword">the</span> following
843+
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
844+
<span class="hljs-keyword">with</span> <span class="hljs-keyword">the</span> distribution.
845+
* 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
846+
contributors may be used <span class="hljs-built_in">to</span> endorse <span class="hljs-keyword">or</span> promote products derived
847+
<span class="hljs-built_in">from</span> this software <span class="hljs-keyword">without</span> specific prior written permission.
848+
</code></pre><p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND
849+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
850+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
851+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
852+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
853+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
854+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
855+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
856+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
857+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
858+
835859
<h3>autocomplete_textfield</h3>
836860
<p>Copyright <2018> &lt;@Felix McCuaig&gt;</p>
837861
<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>

lib/view_detalles.dart

+52-39
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class _VistaDetallesState extends State<VistaDetalles> {
152152
onPressed: () {
153153
final Event event = Event(
154154
title: widget.elemento.nombre,
155-
description: widget.elemento.descripcionApp,
155+
description: widget.elemento.descripcion,
156156
location: widget.elemento.lugar,
157157
startDate: widget.elemento.fechaInicio,
158158
endDate: widget.elemento.fechaFin != null
@@ -327,20 +327,25 @@ class _VistaDetallesState extends State<VistaDetalles> {
327327
),
328328
),
329329
snapshot.data.urlFoto != null && snapshot.data.urlFoto != ''
330-
? Card(
331-
semanticContainer: true,
332-
clipBehavior: Clip.antiAliasWithSaveLayer,
333-
shape: RoundedRectangleBorder(
334-
borderRadius: BorderRadius.circular(10.0),
335-
),
336-
elevation: 5,
337-
margin: EdgeInsets.all(10),
338-
child: Container(
339-
height: 200,
340-
child: Image.network(snapshot.data.urlFoto,
341-
fit: BoxFit.cover, width: double.infinity),
342-
//child: Text("Funciona"),
343-
),
330+
? InkWell(
331+
child: Card(
332+
semanticContainer: true,
333+
clipBehavior: Clip.antiAliasWithSaveLayer,
334+
shape: RoundedRectangleBorder(
335+
borderRadius: BorderRadius.circular(10.0),
336+
),
337+
elevation: 5,
338+
margin: EdgeInsets.all(10),
339+
child: Container(
340+
height: 200,
341+
child: Image.network(snapshot.data.urlFoto,
342+
fit: BoxFit.cover, width: double.infinity),
343+
//child: Text("Funciona"),
344+
),
345+
),
346+
onTap: () {
347+
Utils().intentImagenUrl(snapshot.data.urlFoto);
348+
},
344349
)
345350
: Container(),
346351
],
@@ -399,8 +404,9 @@ class _VistaDetallesState extends State<VistaDetalles> {
399404
width: 80.0,
400405
height: 80.0,
401406
point: widget.elemento.posicion,
402-
builder: (ctx) => new Container(
403-
child: Icon(Icons.place, color:Colores().primario),
407+
builder: (ctx) =>
408+
new Container(
409+
child: Icon(Icons.place, color: Colores().primario),
404410
),
405411
),
406412
],
@@ -409,23 +415,30 @@ class _VistaDetallesState extends State<VistaDetalles> {
409415
),
410416
),
411417
),
412-
Card(
413-
semanticContainer: true,
414-
clipBehavior: Clip.antiAliasWithSaveLayer,
415-
shape: RoundedRectangleBorder(
416-
borderRadius: BorderRadius.circular(10.0),
417-
),
418-
elevation: 5,
419-
margin: EdgeInsets.all(10),
420-
child: Container(
421-
height: 200,
422-
child: widget.elemento.urlImagen != ''
423-
? Image.network(widget.elemento.urlImagen,
424-
fit: BoxFit.cover, width: double.infinity)
425-
: Image.network(widget.elemento.urlMiniatura,
426-
fit: BoxFit.cover, width: double.infinity),
427-
//child: Text("Funciona"),
418+
InkWell(
419+
child: Card(
420+
semanticContainer: true,
421+
clipBehavior: Clip.antiAliasWithSaveLayer,
422+
shape: RoundedRectangleBorder(
423+
borderRadius: BorderRadius.circular(10.0),
424+
),
425+
elevation: 5,
426+
margin: EdgeInsets.all(10),
427+
child: Container(
428+
height: 200,
429+
child: widget.elemento.urlImagen != ''
430+
? Image.network(widget.elemento.urlImagen,
431+
fit: BoxFit.cover, width: double.infinity)
432+
: Image.network(widget.elemento.urlMiniatura,
433+
fit: BoxFit.cover, width: double.infinity),
434+
//child: Text("Funciona"),
435+
),
428436
),
437+
onTap: () {
438+
Utils().intentImagenUrl(widget.elemento.urlImagen != ''
439+
? widget.elemento.urlImagen
440+
: widget.elemento.urlMiniatura);
441+
},
429442
)
430443
],
431444
);
@@ -5249,8 +5262,8 @@ class _VistaDetallesState extends State<VistaDetalles> {
52495262
style: TextStyle(
52505263
color: Colores().dark,
52515264
fontWeight: FontWeight.bold)),
5252-
widget.elemento.descripcionApp != null
5253-
? Html(data: widget.elemento.descripcionApp)
5265+
widget.elemento.descripcion != null
5266+
? Html(data: widget.elemento.descripcion)
52545267
: Text(Strings.noDisponible),
52555268
Text(Strings.horariosTarifas,
52565269
style: TextStyle(
@@ -5548,8 +5561,8 @@ class _VistaDetallesState extends State<VistaDetalles> {
55485561
style: TextStyle(
55495562
color: Colores().dark,
55505563
fontWeight: FontWeight.bold)),
5551-
widget.elemento.descripcionApp != ''
5552-
? Text(widget.elemento.descripcionApp)
5564+
widget.elemento.descripcion != ''
5565+
? Text(widget.elemento.descripcion)
55535566
: Text(Strings.noDisponible),
55545567
Text(Strings.infoAdicional,
55555568
style: TextStyle(
@@ -6170,8 +6183,8 @@ class _VistaDetallesState extends State<VistaDetalles> {
61706183
style: TextStyle(
61716184
color: Colores().dark,
61726185
fontWeight: FontWeight.bold)),
6173-
widget.elemento.descripcionApp != ''
6174-
? Html(data: widget.elemento.descripcionApp)
6186+
widget.elemento.descripcion != ''
6187+
? Html(data: widget.elemento.descripcion)
61756188
: Text(Strings.noDisponible),
61766189
Text(Strings.enlaceContenido,
61776190
style: TextStyle(

pubspec.lock

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ packages:
88
url: "https://pub.dartlang.org"
99
source: hosted
1010
version: "1.4.0"
11+
android_intent:
12+
dependency: "direct main"
13+
description:
14+
name: android_intent
15+
url: "https://pub.dartlang.org"
16+
source: hosted
17+
version: "0.3.7+4"
1118
ansicolor:
1219
dependency: transitive
1320
description:

pubspec.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1515
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
1616
# Read more about iOS versioning at
1717
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18-
version: 1.0.0+160010000
18+
version: 1.0.1+160010001
1919

2020
environment:
2121
sdk: ">=2.7.0 <3.0.0"
@@ -46,6 +46,7 @@ dependencies:
4646
data_connection_checker: ^0.3.4
4747
introduction_screen: ^1.0.9
4848
flutter_map_marker_popup: ^0.1.4
49+
android_intent: ^0.3.7+4
4950

5051
flutter_icons:
5152
android: true

0 commit comments

Comments
 (0)