Skip to content

Commit

Permalink
75 - Imagens Suaves
Browse files Browse the repository at this point in the history
  • Loading branch information
robertov8 committed Aug 22, 2018
1 parent 29e50b6 commit cc3aa6e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/ui/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:share/share.dart';
import 'package:transparent_image/transparent_image.dart';

import 'gif_page.dart';

Expand Down Expand Up @@ -53,8 +54,10 @@ class _HomePageState extends State<HomePage> {
itemBuilder: (context, index) {
if (_search == null || index < snapshot.data['data'].length) {
return GestureDetector(
child: Image.network(
snapshot.data['data'][index]['images']['fixed_height']['url'],
child: FadeInImage.memoryNetwork(
placeholder: kTransparentImage,
image: snapshot.data['data'][index]['images']['fixed_height']
['url'],
height: 300.0,
fit: BoxFit.cover,
),
Expand All @@ -66,7 +69,8 @@ class _HomePageState extends State<HomePage> {
GifPage(snapshot.data['data'][index])));
},
onLongPress: () {
Share.share(snapshot.data['data'][index]['images']['fixed_height']['url']);
Share.share(snapshot.data['data'][index]['images']['fixed_height']
['url']);
},
);
} else {
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.37"
transparent_image:
dependency: "direct main"
description:
name: transparent_image
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
typed_data:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
share: ^0.5.3
transparent_image: ^0.1.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit cc3aa6e

Please sign in to comment.