Skip to content

Commit

Permalink
fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jwson-automation committed Aug 31, 2024
2 parents 17fa38e + b8cc023 commit 1d32c9a
Show file tree
Hide file tree
Showing 24 changed files with 456 additions and 352 deletions.
29 changes: 23 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ROOT := $(shell git rev-parse --show-toplevel)

# Detect operating system
ifeq ($(OS), Windows_NT)
DETECTED_OS := Windows
Expand All @@ -12,10 +11,23 @@ else
FLUTTER := $(shell which flutter)
endif
endif

# Define the default target to call all necessary targets
all: init analyze apply format buildRunner

# Define the init target to initialize the project
first : create init analyze buildRunner env
setting : init buildRunner
lint : analyze apply format

# Define the init target
create:
@echo "Create ios and android floder..."
ifeq ($(DETECTED_OS), Windows)
@flutter create .
else
@$(FLUTTER) create .
endif

# Define the init target
init:
@echo "Initializing Flutter project..."
Expand All @@ -24,7 +36,6 @@ ifeq ($(DETECTED_OS), Windows)
else
@$(FLUTTER) pub get
endif

# Define the analyze target
analyze:
@echo "Analyzing Flutter project..."
Expand All @@ -33,7 +44,6 @@ ifeq ($(DETECTED_OS), Windows)
else
-@$(FLUTTER) analyze
endif

# Define the apply target
apply:
@echo "Applying dart fixes..."
Expand All @@ -42,7 +52,6 @@ ifeq ($(DETECTED_OS), Windows)
else
@dart fix --apply
endif

# Define the apply target
format:
@echo "format dart fixes..."
Expand All @@ -51,7 +60,6 @@ ifeq ($(DETECTED_OS), Windows)
else
@dart format .
endif

# Define the buildRunner target
buildRunner:
@echo "Freezed Running build runner..."
Expand All @@ -61,3 +69,12 @@ else
@$(FLUTTER) pub run build_runner build --delete-conflicting-outputs
endif

# Define the env target for Unix-like systems
env:
ifeq ($(DETECTED_OS), Windows)
@echo "Using PowerShell script to create .env file."
@powershell -ExecutionPolicy Bypass -File generate_env.ps1
else
@echo "Using bash script to create .env file."
@bash generate_env.sh
endif
Binary file added assets/launcher_icon/kimberry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions generate_env.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# PowerShell 스크립트로 .env 파일 생성

# 현재 작업 중인 디렉터리 경로 가져오기
$TargetDir = Get-Location

# .env 파일 내용
$envContent = @"
# please replace 'your_api_key_here' with your actual API key
GOOGLE_API_KEY=your_api_key_here
GPT_API_KEY=your_api_key_here
# Other environment variables can be added here
"@

# .env 파일 생성
$envFilePath = Join-Path -Path $TargetDir -ChildPath ".env"
Write-Output "Creating .env file at: $envFilePath"

# UTF-8 인코딩으로 파일 생성
$envContent | Out-File -FilePath $envFilePath -Encoding utf8
5 changes: 5 additions & 0 deletions generate_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# .env 파일 생성
echo "# please replace 'your_api_key_here' with your actual API key" > ".env"
echo "GOOGLE_API_KEY=your_api_key_here" >> ".env"
echo "GPT_API_KEY=your_api_key_here" >> ".env"
echo "# Other environment variables can be added here" >> ".env"
46 changes: 46 additions & 0 deletions integration_test/app_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:blueberry_flutter_template/firebase_options.dart';
import 'package:blueberry_flutter_template/model/PetProfileModel.dart';
import 'package:blueberry_flutter_template/model/PostModel.dart';
import 'package:blueberry_flutter_template/model/UserModel.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down Expand Up @@ -39,5 +41,49 @@ void main() {
// Then: 매핑된 데이터 검증
expect(fetchedData, isNotNull, reason: 'fetchedData는 null이 아니어야 합니다.');
});

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

// Given: 컬렉션 이름 설정
collectionName = 'users';

// When: 첫 번째 문서 가져오기 및 fromJson 매핑
final querySnapshot =
await firestore.collection(collectionName).limit(1).get();

if (querySnapshot.docs.isNotEmpty) {
final data = querySnapshot.docs.first.data();
fetchedData = UserModel.fromJson(data);
} else {
throw Exception('$collectionName 컬렉션 안에 다큐먼트가 존재하지 않습니다');
}

// Then: 매핑된 데이터 검증
expect(fetchedData, isNotNull, reason: 'fetchedData는 null이 아니어야 합니다.');
});

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

// Given: 컬렉션 이름 설정
collectionName = 'posts';

// When: 첫 번째 문서 가져오기 및 fromJson 매핑
final querySnapshot =
await firestore.collection(collectionName).limit(1).get();

if (querySnapshot.docs.isNotEmpty) {
final data = querySnapshot.docs.first.data();
fetchedPost = PostModel.fromJson(data);
} else {
throw Exception('$collectionName 컬렉션 안에 다큐먼트가 존재하지 않습니다');
}

// Then: 매핑된 데이터 검증
expect(fetchedPost, isNotNull, reason: 'fetchedPost는 null이 아니어야 합니다.');
});
});
}
5 changes: 1 addition & 4 deletions lib/feature/match/MatchScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import 'widget/MatchProfileListWidget.dart';
import 'widget/MatchFilterWidget.dart';

/// MatchScreen - 프로필 스와이프 매칭 화면
///
/// 주요 구성 요소:
/// - SwipeCardWidget: 프로필 카드를 스와이프할 수 있는 위젯
/// - SwipeButtonWidget: 수동으로 좌/우 스와이프를 할 수 있는 버튼
/// 완성 8월 18일 상현
class MatchScreen extends StatelessWidget {
static const String name = 'MatchScreen';
Expand Down
3 changes: 3 additions & 0 deletions lib/feature/match/ProfileScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import 'package:flutter/material.dart';
import 'package:blueberry_flutter_template/model/PetProfileModel.dart';
import '../../utils/AppStrings.dart';

/// ProfileScreen - ProfileDetail 스크린으로 대체할 임시 화면
/// 완성 8월 18일 상현
class ProfileScreen extends StatelessWidget {
final PetProfileModel petProfile;

Expand Down
Loading

0 comments on commit 1d32c9a

Please sign in to comment.