-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from pet-sitter/45-유저-유저-프로필-이미지-등록-기능-구현
Feat: [회원가입] 유저 프로필을 포함하여 회원가입 진행 로직 구현
- Loading branch information
Showing
44 changed files
with
1,282 additions
and
176 deletions.
There are no files selected for viewing
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.
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import 'package:get_it/get_it.dart'; | ||
import 'package:pets_next_door_flutter/app/di/feature_di_interface.dart'; | ||
import 'package:pets_next_door_flutter/features/media/data/remote/media_remote_data_source_impl.dart'; | ||
import 'package:pets_next_door_flutter/features/media/media.dart'; | ||
import 'package:pets_next_door_flutter/features/media/repositories/media_repository_impl.dart'; | ||
|
||
final class MediaDependencyInjection extends FeatureDependencyInjection { | ||
@override | ||
Future<void> dataSources() async { | ||
GetIt.I.registerLazySingleton<MediaRemoteDataSource>( | ||
MediaRemoteDataSourceImpl.new, | ||
); | ||
} | ||
|
||
@override | ||
void repositories() { | ||
GetIt.I.registerLazySingleton<MediaRepository>( | ||
() => MediaRepositoryImpl( | ||
mediaRemoteDataSource, | ||
), | ||
); | ||
} | ||
|
||
@override | ||
void useCases() { | ||
GetIt.I | ||
..registerFactory<UploadImageUseCase>( | ||
() => UploadImageUseCase( | ||
mediaRepository, | ||
), | ||
); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
abstract class PNDSvgs { | ||
static const String mainIcon = 'assets/svgs/main_icon.svg'; | ||
static const String mainTitleIcon = 'assets/svgs/main_title_icon.svg'; | ||
static const String google = 'assets/svgs/login/google_icon.svg'; | ||
static const String kakao = 'assets/svgs/login/kakao_icon.svg'; | ||
static const String apple = 'assets/svgs/login/apple_icon.svg'; | ||
|
||
static const String home = 'assets/svgs/home/icon_home.svg'; | ||
static const String community = 'assets/svgs/home/icon_community.svg'; | ||
static const String chat = 'assets/svgs/home/icon_chat.svg'; | ||
static const String user = 'assets/svgs/home/icon_user.svg'; | ||
|
||
static const String catActive = 'assets/svgs/pet/cat_active.svg'; | ||
static const String dogActive = 'assets/svgs/pet/dog_active.svg'; | ||
static const String _basePath = 'assets/svgs/'; | ||
|
||
static const String _login = 'login/'; | ||
static const String google = _basePath + _login + 'google_icon.svg'; | ||
static const String kakao = _basePath + _login + 'kakao_icon.svg'; | ||
static const String apple = _basePath + _login + 'apple_icon.svg'; | ||
|
||
static const String _home = 'home/'; | ||
static const String home = _basePath + _home + 'icon_home.svg'; | ||
static const String community = _basePath + _home + 'icon_community.svg'; | ||
static const String chat = _basePath + _home + 'icon_chat.svg'; | ||
static const String user = _basePath + _home + 'icon_user.svg'; | ||
|
||
static const String _pet = 'pet/'; | ||
static const String catActive = _basePath + _pet + 'cat_active.svg'; | ||
static const String dogActive = _basePath + _pet + 'dog_active.svg'; | ||
|
||
static const String _common = 'common/'; | ||
static const String mainIcon = _basePath + _common + 'main_icon.svg'; | ||
static const String mainTitleIcon = | ||
_basePath + _common + 'main_title_icon.svg'; | ||
static const String image = _basePath + _common + 'icon_image.svg'; | ||
static const String plus = _basePath + _common + 'icon_plus.svg'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:pets_next_door_flutter/core/network_handling/exceptions/custom_exception.dart'; | ||
|
||
enum ImageFormat { | ||
png('jpeg'), | ||
jpeg('jpeg'); | ||
|
||
const ImageFormat(this.str); | ||
|
||
final str; | ||
|
||
factory ImageFormat.getByTypeStr({required String type}) { | ||
return ImageFormat.values.firstWhere( | ||
(element) => element.str == type, | ||
orElse: () => throw ParsingEnumException(), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_image_compress/flutter_image_compress.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
import 'package:image_picker/image_picker.dart'; | ||
import 'package:path_provider/path_provider.dart'; | ||
import 'package:pets_next_door_flutter/core/enums/image_format.enum.dart'; | ||
import 'package:pets_next_door_flutter/presentation/widgets/bottom_sheet/option_bottom_sheet.dart'; | ||
|
||
class ImagePickerService { | ||
ImagePickerService._(); | ||
|
||
final _imagePicker = ImagePicker(); | ||
|
||
static final ImagePickerService to = ImagePickerService._(); | ||
|
||
Future<File?> pickImage(ImageSource imageSource) async { | ||
XFile? imageXFile = await _imagePicker.pickImage(source: imageSource); | ||
|
||
if (imageXFile == null) return null; | ||
|
||
return File(imageXFile.path); | ||
} | ||
|
||
static Future<ImageSource?> showImageSourceOptions( | ||
BuildContext context) async { | ||
return showModalBottomSheet<ImageSource?>( | ||
context: context, | ||
builder: (context) => OptionListBottomSheet<ImageSource>( | ||
options: ImageSource.values.map((e) => e.name).toList(), | ||
onOptionTapped: (int option) { | ||
context.pop(ImageSource.values[option]); | ||
}, | ||
onCloseBtnTapped: () { | ||
context.pop(); | ||
}, | ||
leadingText: ''), | ||
); | ||
} | ||
|
||
static Future<File?> compressAndConvertFormat( | ||
File imageFile, { | ||
CompressFormat format = CompressFormat.png, | ||
int quality = 100, | ||
int? minWidth, | ||
int? minHeight, | ||
}) async { | ||
XFile? result; | ||
|
||
try { | ||
result = await FlutterImageCompress.compressAndGetFile( | ||
imageFile.path, | ||
'${(await getTemporaryDirectory()).path}/${DateTime.now().millisecondsSinceEpoch}.${format.name}', | ||
format: format, | ||
quality: quality, | ||
minWidth: minWidth ?? 1920, | ||
minHeight: minHeight ?? 1080, | ||
); | ||
|
||
if (result == null) return null; | ||
} on UnsupportedError catch (e) {} | ||
|
||
return File(result!.path); | ||
} | ||
|
||
static ImageFormat? getImageFormat(File file) { | ||
if (file.path.endsWith('.${ImageFormat.jpeg.str}') || | ||
file.path.endsWith('.jpg')) { | ||
return ImageFormat.jpeg; | ||
} else if (file.path.endsWith('.${ImageFormat.png.str}')) { | ||
return ImageFormat.png; | ||
} else { | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class AppSizeService { | ||
AppSizeService._(); | ||
|
||
late double statusBarHeight; // Safe Area 상단 Inset | ||
late double bottomInset; // Safe Area 하단 Inset | ||
late double screenWidth; // 디바이스 넓이 | ||
late double screenHeight; // 디바이스 높이 | ||
late double responsiveBottomInset; // 반응형 하단 Safe Area 하단 Inset | ||
|
||
// 비율로 처리했을 때 높이 넓이. (375 * 812) 기준 | ||
double ratioHeight(double givenHeight) => (givenHeight / 375) * 375; | ||
double rationWidth(double givenWidth) => (givenWidth / 812) * 812; | ||
|
||
// 초기화 구문 | ||
void init(BuildContext context) { | ||
final mediaQuery = MediaQuery.of(context); | ||
final bool isTablet = mediaQuery.size.width > 600; | ||
statusBarHeight = mediaQuery.padding.top; | ||
bottomInset = mediaQuery.padding.bottom; | ||
screenWidth = isTablet ? 375 : mediaQuery.size.width; | ||
screenHeight = isTablet ? 812 : mediaQuery.size.height; | ||
responsiveBottomInset = | ||
mediaQuery.padding.bottom == 0 ? 16 : mediaQuery.padding.bottom; | ||
} | ||
|
||
static final AppSizeService to = AppSizeService._(); | ||
} |
Empty file.
Oops, something went wrong.