Skip to content

Commit

Permalink
#62 캐시 이미지
Browse files Browse the repository at this point in the history
  • Loading branch information
jocy0412 committed Jul 29, 2022
1 parent 7b3e16d commit 314cf47
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 20 deletions.
18 changes: 18 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
4BCE26D59008E1B6FE992BA3 /* [CP] Embed Pods Frameworks */,
AEB74D8934B350C5724940BD /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -242,6 +243,23 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
AEB74D8934B350C5724940BD /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
D806BDEBC4A55324AB86E109 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
7 changes: 4 additions & 3 deletions lib/screens/contacts/contacts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'dart:convert'; // json decode 등등 관리
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:nemo_flutter/screens/mypage/profile_page.dart';
import '../../models/contacts/user.dart';
// import '../../tests/contacts/preferences.dart';
Expand Down Expand Up @@ -228,11 +229,11 @@ class _ContactsPageState extends State<ContactsPage> {
border: Border(
right: BorderSide(color: Colors.black)),
),
child: Image.network(
friendsData[friends[i]].imagePath,
child: Image(
image: CachedNetworkImageProvider(
friendsData[friends[i]].imagePath),
width: 155,
height: 180,
// alignment: Alignment(-1, -0.7),
fit: BoxFit.cover,
),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/screens/mypage/profile_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:dio/dio.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:cached_network_image/cached_network_image.dart';

const BASE_URL = 'http://34.64.217.3:3000/static/';

Expand Down Expand Up @@ -354,9 +355,8 @@ class _ProfilePageState extends State<ProfilePage> {
children: [
ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Image.network(
// user.image1,
user.image[i],
child: Image(
image: CachedNetworkImageProvider(user.image[i]),
width: 100,
height: 100,
fit: BoxFit.cover,
Expand Down
12 changes: 5 additions & 7 deletions lib/screens/sharing/sharing.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/physics.dart';
import 'dart:math';
import 'dart:typed_data';
import 'package:nearby_connections/nearby_connections.dart';
import 'package:permission_handler/permission_handler.dart';
// import 'package:nemo_flutter/screens/mypage/profile_page.dart';

import 'package:http/http.dart' as http;
import 'dart:convert';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
// import 'package:shared_preferences/shared_preferences.dart';
import 'package:cached_network_image/cached_network_image.dart';

import '../mypage/cardeditor.dart';
import '../../models/sharing/user.dart';
Expand Down Expand Up @@ -665,8 +662,9 @@ class _TookPageState extends State<TookPage> {
topLeft: Radius.circular(10.0),
topRight: Radius.circular(10.0),
),
child: Image.network(
'http://34.64.217.3:3000/static/${myDataFromJson.image}',
child: Image(
image: CachedNetworkImageProvider(
'http://34.64.217.3:3000/static/${myDataFromJson.image}'),
width: 300,
height: 240,
fit: BoxFit.fitWidth,
Expand Down
6 changes: 4 additions & 2 deletions lib/widgets/message/conversation_list.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
import '../../screens/message/chat_detail_page.dart';

class ConversationList extends StatefulWidget {
Expand Down Expand Up @@ -45,8 +46,9 @@ class _ConversationListState extends State<ConversationList> {
child: Row(
children: <Widget>[
CircleAvatar(
backgroundImage: NetworkImage(widget.friendImage),
// backgroundImage: AssetImage('${widget.imageUrl}'),
// backgroundImage: NetworkImage(widget.friendImage),
backgroundImage:
CachedNetworkImageProvider(widget.friendImage),
maxRadius: 30,
),
SizedBox(
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/mypage/profile_widget.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';

class ProfileWidget extends StatelessWidget {
final String imagePath;
Expand Down Expand Up @@ -29,7 +30,7 @@ class ProfileWidget extends StatelessWidget {
}

Widget buildImage() {
final image = NetworkImage(imagePath);
final image = CachedNetworkImageProvider(imagePath);

return ClipOval(
child: Material(
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies:
shared_preferences: ^2.0.11
blinking_text: ^1.0.2
socket_io_client: ^2.0.0

cached_network_image : ^3.2.1

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
Expand All @@ -50,13 +50,13 @@ dependencies:
ref: chan # branch name
permission_handler: ^10.0.0
sensors_plus: ^1.3.2
shimmer: ^2.0.0
shimmer: ^2.0.0
google_maps_flutter: ^2.1.9
geolocator: ^9.0.1
intl: ^0.17.0



# swipe: ^0.0.1
# flutter_nfc_reader:
# git:
Expand Down Expand Up @@ -118,7 +118,7 @@ flutter:
- family: Gamja
fonts:
- asset: assets/fonts/GamjaFlower-Regular.ttf

- family: Dohyun
fonts:
- asset: assets/fonts/dohyun.ttf
Expand Down

0 comments on commit 314cf47

Please sign in to comment.