Skip to content

Commit

Permalink
릴리스 브랜치에 머지 및 충돌 해결 (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphanoJack authored Aug 18, 2024
2 parents 78defe1 + da83832 commit 0fdba8d
Show file tree
Hide file tree
Showing 33 changed files with 841 additions and 200 deletions.
6 changes: 3 additions & 3 deletions integration_test/app_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:blueberry_flutter_template/firebase_options.dart';
import 'package:blueberry_flutter_template/model/DogProfileModel.dart';
import 'package:blueberry_flutter_template/model/PetProfileModel.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter_test/flutter_test.dart';
Expand All @@ -20,7 +20,7 @@ void main() {

test('pet 컬렉션이 있을 때, 첫 번째 문서를 가져와 fromJson 메서드로 매핑하면, 오류 없이 매핑된다',
() async {
DogProfileModel? fetchedData;
PetProfileModel? fetchedData;

// Given: 컬렉션 이름 설정
collectionName = 'pet';
Expand All @@ -31,7 +31,7 @@ void main() {

if (querySnapshot.docs.isNotEmpty) {
final data = querySnapshot.docs.first.data();
fetchedData = DogProfileModel.fromJson(data);
fetchedData = PetProfileModel.fromJson(data);
} else {
throw Exception('$collectionName 컬렉션 안에 다큐먼트가 존재하지 않습니다');
}
Expand Down
4 changes: 1 addition & 3 deletions lib/core/TopScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:blueberry_flutter_template/feature/match/MatchScreen.dart';
import 'package:blueberry_flutter_template/feature/post/PostScreen.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';

import '../utils/AppStringEnglish.dart';

Expand All @@ -17,7 +16,6 @@ import '../utils/AppStringEnglish.dart';
final selectedIndexProvider = StateProvider<int>((ref) => 0);


final List<Widget> pages = [
const PostScreen(),
const MatchScreen(),
Expand Down Expand Up @@ -64,7 +62,7 @@ class TopScreen extends ConsumerWidget {
],
currentIndex: selectedIndex,
onTap: (index) =>
ref.read(selectedIndexProvider.notifier).state = index,
ref.read(selectedIndexProvider.notifier).state = index,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import 'package:flutter/material.dart';

import 'widget/FriendsListWidget.dart';
import 'widget/FriendsListViewWidget.dart';

/// FriendsListScreen - 완성 되었습니다
/// 8월 15일 상현
class FriendsListScreen extends StatelessWidget {
static const String name = 'FriendsListScreen';
Expand All @@ -15,7 +18,7 @@ class FriendsListScreen extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(child: FriendsListWidget()),
Expanded(child: FriendsListViewWidget()),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import '../../../model/FriendModel.dart';
final friendsListProvider = StreamProvider<List<FriendModel>>((ref) {
final firestore = FirebaseFirestore.instance;

const userId = '4D22soWrX1aoGcuQ0GpAtNYDiYN2'; // 임시 유저 UUID
const userId = 'eztqDqrvEXDc8nqnnrB8'; // 로그인을 가정한 임시 유저 ID

return firestore
.collection('users')
.collection('users_test')
.doc(userId)
.collection('friends')
.snapshots()
Expand All @@ -27,15 +27,15 @@ final friendsListProvider = StreamProvider<List<FriendModel>>((ref) {
});
});

// // 친구목록 이미지 URL을 제공하는 Provider
// final friendsListImageProvider = FutureProvider.family<String, String>((ref, imageName) async {
// final ref = FirebaseStorage.instance.ref('friends-profile/$imageName');
// return await ref.getDownloadURL();
// });

/// 이미지 URL을 제공하는 공용 Provider
final imageProvider =
FutureProvider.family<String, String>((ref, imagePath) async {
final ref = FirebaseStorage.instance.ref(imagePath);
// 친구목록 이미지 URL을 제공하는 Provider
final friendsListImageProvider =
FutureProvider.family<String, String>((ref, imageName) async {
final ref = FirebaseStorage.instance.ref('friends-profile/$imageName');
return await ref.getDownloadURL();
});

// /// 이미지 URL을 제공하는 공용 Provider
// final imageProvider = FutureProvider.family<String, String>((ref, imagePath) async {
// final ref = FirebaseStorage.instance.ref(imagePath);
// return await ref.getDownloadURL();
// });
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import 'package:go_router/go_router.dart';

import '../../../model/FriendModel.dart';
import '../../../utils/AppStrings.dart';
import '../../user_report/provider/ReportModalSheet.dart';
import '../../userreport/provider/UserReportBottomSheetWidget.dart';
import 'BottomSheetButtonWidget.dart';

class FriendBottomSheet extends StatelessWidget {
class FriendBottomSheetWidget extends StatelessWidget {
final FriendModel friend;
final String imageUrl;

const FriendBottomSheet(
const FriendBottomSheetWidget(
{super.key, required this.friend, required this.imageUrl});

@override
Expand Down Expand Up @@ -89,7 +89,8 @@ class FriendBottomSheet extends StatelessWidget {
borderRadius:
BorderRadius.vertical(top: Radius.circular(25.0)),
),
builder: (context) => ReportModalSheet(friend: friend),
builder: (context) =>
UserReportBottomSheetWidget(friend: friend),
);
},
text: AppStrings.reportButton,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import '../../../model/FriendModel.dart';
import '../provider/FriendsListProvider.dart';
import 'FriendBottomSheet.dart';
import 'FriendListItemWidget.dart';

class FriendsListWidget extends ConsumerWidget {
const FriendsListWidget({super.key});
class FriendsListViewWidget extends ConsumerWidget {
const FriendsListViewWidget({super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
Expand All @@ -22,27 +22,19 @@ class FriendsListWidget extends ConsumerWidget {
itemCount: friends.length,
itemBuilder: (context, index) {
final friend = friends[index];
final friendListImageUrl = ref
.watch(imageProvider('friends-profile/${friend.imageName}'));
final friendListImageUrl =
ref.watch(friendsListImageProvider(friend.imageName));

return friendListImageUrl.when(
data: (imageUrl) {
return FriendListItemWidget(
friend: friend,
imageUrl: imageUrl,
onTap: () {
showModalBottomSheet(
FriendBottomSheetLauncher.show(
context: context,
isScrollControlled: true,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(25.0),
),
),
builder: (context) => FriendBottomSheet(
friend: friend,
imageUrl: imageUrl,
),
friend: friend,
imageUrl: imageUrl,
);
},
);
Expand All @@ -61,3 +53,25 @@ class FriendsListWidget extends ConsumerWidget {
);
}
}

class FriendBottomSheetLauncher {
static void show({
required BuildContext context,
required FriendModel friend,
required String imageUrl,
}) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(25.0),
),
),
builder: (context) => FriendBottomSheetWidget(
friend: friend,
imageUrl: imageUrl,
),
);
}
}
32 changes: 30 additions & 2 deletions lib/feature/match/MatchScreen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import '../../utils/AppStrings.dart';
import 'package:google_fonts/google_fonts.dart';
import 'widget/MatchProfileListWidget.dart';
import 'widget/MatchFilterWidget.dart';

/// MatchScreen - 프로필 스와이프 매칭 화면
///
Expand All @@ -12,10 +13,37 @@ class MatchScreen extends StatelessWidget {
static const String name = 'MatchScreen';
const MatchScreen({super.key});

void _showFilterBottomSheet(BuildContext context) {
showModalBottomSheet(
context: context,
builder: (BuildContext context) {
return const MatchFilterWidget();
},
);
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text(AppStrings.matchScreenTitle)),
appBar: AppBar(
title: Text(
'Petting',
style: GoogleFonts.lobster(
textStyle: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
),
actions: [
IconButton(
icon: const Icon(Icons.filter_list),
onPressed: () {
_showFilterBottomSheet(context);
},
),
],
),
body: const Padding(
padding: EdgeInsets.only(bottom: 36.0),
child: Center(
Expand Down
Loading

0 comments on commit 0fdba8d

Please sign in to comment.