Skip to content

Commit

Permalink
Revert back to local images
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Nguyen committed Jul 20, 2020
1 parent ad51980 commit 323a025
Show file tree
Hide file tree
Showing 20 changed files with 11 additions and 13 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ The Web version is *very* much not well supported.

1. Embedded Youtube videos don't work (see the [flutter_widget_from_html](https://pub.dev/packages/flutter_widget_from_html) package).

2. Cached network images don't work (see the [cached_network_image](https://pub.dev/packages/cached_network_image) package).
2. ~~Cached network images don't work (see the [cached_network_image](https://pub.dev/packages/cached_network_image) package).~~

- **Update 2020-07-19**: Reverting back to local images to fix this.

3. The most useful thing about the Web version is to share the app with others using a link.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/data/Member.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Member {
}

String getImagePath() {
return 'http://cdn.iz-one.co.kr/images/oneiric-diary/v/official-photo-4-${this.stageName.toLowerCase()}.jpg';
return 'assets/images/oneiric-diary/official-photo-4-${this.stageName.toLowerCase()}.jpg';
}

String getHeightInFeetInches() {
Expand Down
6 changes: 2 additions & 4 deletions lib/pages/AboutPage.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:izoneapp/generated/l10n.dart';
import 'package:izoneapp/pages/ViewPicturePage.dart';
Expand All @@ -9,8 +8,7 @@ class AboutPage extends StatelessWidget {
final PageController pageController;

Widget _izonePicture(BuildContext context) {
const imagePath =
'http://cdn.iz-one.co.kr/images/oneiric-diary/v/official-photo-4-izone.jpg';
const imagePath = 'assets/images/oneiric-diary/official-photo-4-izone.jpg';
return GestureDetector(
onTap: () {
Navigator.push(
Expand All @@ -24,7 +22,7 @@ class AboutPage extends StatelessWidget {
},
child: Hero(
tag: imagePath,
child: CachedNetworkImage(imageUrl: imagePath),
child: Image.asset(imagePath),
),
);
}
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/ProfilePage.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:izoneapp/pages/ViewPicturePage.dart';
import '../data/Member.dart';
Expand Down Expand Up @@ -29,7 +28,7 @@ class ProfilePage extends StatelessWidget {
child: ClipRRect(
borderRadius: BorderRadius.circular(32.0),
child: Image(
image: CachedNetworkImageProvider(member.getImagePath()),
image: AssetImage(member.getImagePath()),
fit: BoxFit.cover,
height: height,
),
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/ViewPicturePage.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:photo_view/photo_view.dart';

Expand All @@ -16,7 +15,7 @@ class ViewPicturePage extends StatelessWidget {
child: Scaffold(
body: Center(
child: PhotoView(
imageProvider: CachedNetworkImageProvider(memberImagePath),
imageProvider: AssetImage(memberImagePath),
heroAttributes: PhotoViewHeroAttributes(
tag: memberImagePath,
),
Expand Down
3 changes: 1 addition & 2 deletions lib/widgets/MemberTile.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:izoneapp/data/Member.dart';
import 'package:izoneapp/pages/ProfilePage.dart';
Expand Down Expand Up @@ -33,7 +32,7 @@ class MemberTile extends StatelessWidget {
child: ClipRRect(
borderRadius: BorderRadius.circular(12.0),
child: Image(
image: CachedNetworkImageProvider(member.getImagePath()),
image: AssetImage(member.getImagePath()),
fit: BoxFit.cover,
),
),
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies:
intl: ^0.16.1
intl_translation: ^0.17.10
flutter_widget_from_html: ^0.4.2
cached_network_image: ^2.2.0+1
# cached_network_image: ^2.2.0+1

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
Expand Down Expand Up @@ -61,6 +61,7 @@ flutter:
- assets/izone.json
- assets/icons/
- assets/launcher_round.png
- assets/images/oneiric-diary/
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
Expand Down

0 comments on commit 323a025

Please sign in to comment.