Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/#198 picture crop screen complementary feature #210

Merged
merged 5 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Binary file not shown.
Binary file removed android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Binary file not shown.
Binary file removed android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions lib/core/di/di_setup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import 'package:weaco/domain/user/use_case/get_profile_image_list_use_case.dart'
import 'package:weaco/domain/user/use_case/sign_up_use_case.dart';
import 'package:weaco/presentation/common/user_provider.dart';
import 'package:weaco/presentation/my_page/view_model/my_page_view_model.dart';
import 'package:weaco/presentation/ootd_post/camera_view_model.dart';
import 'package:weaco/presentation/ootd_post/view_model/camera_view_model.dart';
import 'package:weaco/presentation/sign_up/view_model/sign_up_view_model.dart';
import 'package:weaco/domain/feed/use_case/save_edit_feed_use_case.dart';
import 'package:weaco/domain/file/use_case/get_image_use_case.dart';
import 'package:weaco/domain/file/use_case/save_image_use_case.dart';
import 'package:weaco/domain/user/use_case/sign_in_use_case.dart';
import 'package:weaco/domain/weather/use_case/get_daily_location_weather_use_case.dart';
import 'package:weaco/presentation/ootd_post/ootd_post_view_model.dart';
import 'package:weaco/presentation/ootd_post/picture_crop/picutre_crop_view_model.dart';
import 'package:weaco/presentation/ootd_post/view_model/ootd_post_view_model.dart';
import 'package:weaco/presentation/ootd_post/view_model/picutre_crop_view_model.dart';
import 'package:weaco/domain/feed/use_case/get_user_page_feeds_use_case.dart';
import 'package:weaco/domain/user/use_case/get_user_profile_use_case.dart';
import 'package:weaco/presentation/user_page/view_model/user_page_view_model.dart';
Expand Down
12 changes: 6 additions & 6 deletions lib/core/go_router/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import 'package:weaco/presentation/my_page/screen/my_page_screen.dart';
import 'package:weaco/presentation/my_page/view_model/my_page_view_model.dart';
import 'package:weaco/presentation/ootd_feed/view/ootd_feed_screen.dart';
import 'package:weaco/presentation/ootd_feed/view_model/ootd_feed_view_model.dart';
import 'package:weaco/presentation/ootd_post/ootd_post_view_model.dart';
import 'package:weaco/presentation/ootd_post/picture_crop/picutre_crop_view_model.dart';
import 'package:weaco/presentation/ootd_post/screen/camera_screen.dart';
import 'package:weaco/presentation/ootd_post/view_model/ootd_post_view_model.dart';
import 'package:weaco/presentation/ootd_post/view_model/picutre_crop_view_model.dart';
import 'package:weaco/presentation/home/screen/home_screen.dart';
import 'package:weaco/presentation/home/view_model/home_screen_view_model.dart';
import 'package:weaco/presentation/ooted_search/screen/ootd_search_screen.dart';
Expand All @@ -24,10 +25,9 @@ import 'package:weaco/presentation/settings/screen/app_setting_screen.dart';
import 'package:weaco/presentation/settings/view_model/app_setting_view_model.dart';
import 'package:weaco/presentation/ootd_feed_detail/view/ootd_feed_detail.dart';
import 'package:weaco/presentation/ootd_feed_detail/view_model/ootd_detail_view_model.dart';
import 'package:weaco/presentation/ootd_post/camera_screen.dart';
import 'package:weaco/presentation/ootd_post/camera_view_model.dart';
import 'package:weaco/presentation/ootd_post/ootd_post_screen.dart';
import 'package:weaco/presentation/ootd_post/picture_crop/picture_crop_screen.dart';
import 'package:weaco/presentation/ootd_post/view_model/camera_view_model.dart';
import 'package:weaco/presentation/ootd_post/screen/ootd_post_screen.dart';
import 'package:weaco/presentation/ootd_post/screen/picture_crop_screen.dart';
import 'package:weaco/presentation/main/screen/main_screen.dart';
import 'package:weaco/presentation/sign_in/screen/sign_in_screen.dart';
import 'package:weaco/presentation/sign_in/view_model/sign_in_view_model.dart';
Expand Down
3 changes: 2 additions & 1 deletion lib/presentation/main/screen/main_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import 'package:weaco/presentation/my_page/screen/my_page_screen.dart';
import 'package:weaco/presentation/navigation_bar/bottom_navigation_widget.dart';
import 'package:weaco/presentation/ootd_feed/view/ootd_feed_screen.dart';
import 'package:weaco/presentation/ootd_feed/view_model/ootd_feed_view_model.dart';
import 'package:weaco/presentation/ootd_post/camera_view_model.dart';
import 'package:weaco/presentation/ooted_search/screen/ootd_search_screen.dart';

import '../../ootd_post/view_model/camera_view_model.dart';

class MainScreen extends StatefulWidget {
const MainScreen({super.key});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:image_picker/image_picker.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:weaco/core/go_router/router_static.dart';
import 'package:weaco/presentation/ootd_post/camera_view_model.dart';
import 'package:weaco/presentation/ootd_post/view_model/camera_view_model.dart';

class CameraScreen extends StatelessWidget {
const CameraScreen({super.key});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:weaco/core/enum/season_code.dart';
import 'package:weaco/core/enum/weather_code.dart';
import 'package:weaco/core/go_router/router_static.dart';
import 'package:weaco/domain/feed/model/feed.dart';
import 'package:weaco/presentation/ootd_post/ootd_post_view_model.dart';
import 'package:weaco/presentation/ootd_post/view_model/ootd_post_view_model.dart';

class OotdPostScreen extends StatefulWidget {
final Feed? feed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import 'package:flutter/material.dart';
import 'package:image_cropper/image_cropper.dart';
import 'package:provider/provider.dart';
import 'package:weaco/core/go_router/router_static.dart';
import 'package:weaco/presentation/ootd_post/picture_crop/picutre_crop_view_model.dart';
import 'package:weaco/presentation/common/enum/exception_alert.dart';
import 'package:weaco/presentation/common/util/alert_util.dart';
import 'package:weaco/presentation/ootd_post/view_model/picutre_crop_view_model.dart';

class PictureCropScreen extends StatefulWidget {
final String sourcePath;
Expand Down Expand Up @@ -38,15 +40,19 @@ class _PictureCropScreenState extends State<PictureCropScreen> {
aspectRatio: const CropAspectRatio(ratioX: 9, ratioY: 16),
uiSettings: [
AndroidUiSettings(
toolbarColor: Colors.deepOrange,
toolbarWidgetColor: Colors.white,
toolbarTitle: '이미지 자르기',
toolbarColor: Colors.white,
toolbarWidgetColor: const Color(0xFFFC8800),
initAspectRatio: CropAspectRatioPreset.ratio16x9,
lockAspectRatio: true, // 비율 고정
),
IOSUiSettings(
title: '이미지 자르기',
doneButtonTitle: '확인',
cancelButtonTitle: '취소',
minimumAspectRatio: 1.0, // 비율 고정
rotateButtonsHidden: true,
resetButtonHidden: true,
aspectRatioPickerButtonHidden: true,
),
],
Expand All @@ -72,16 +78,14 @@ class _PictureCropScreenState extends State<PictureCropScreen> {

await viewModel.saveCroppedImage(file: File(_croppedFile!.path));

if (viewModel.status.isSuccess) {
if (mounted) {
if (mounted) {
if (viewModel.status.isSuccess) {
RouterStatic.goToOotdPost(context);
}
} else if (viewModel.status.isError) {
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('잠시 후 다시 시도해 주시기 바랍니다.'),
),
} else if (viewModel.status.isError) {
AlertUtil.showAlert(
context: context,
exceptionAlert: ExceptionAlert.snackBar,
message: '다시 시도해 주세요.',
);
}
}
Expand Down