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

Featuer/image pick #73

Closed
wants to merge 2 commits into from
Closed
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
6 changes: 6 additions & 0 deletions packages/mottai_flutter_app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ PODS:
- AppAuth/Core (~> 1.6)
- GTMSessionFetcher/Core (< 3.0, >= 1.5)
- GTMSessionFetcher/Core (2.3.0)
- image_picker_ios (0.0.1):
- Flutter
- libwebp (1.2.4):
- libwebp/demux (= 1.2.4)
- libwebp/mux (= 1.2.4)
Expand Down Expand Up @@ -194,6 +196,7 @@ DEPENDENCIES:
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`)
Expand Down Expand Up @@ -255,6 +258,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/google_maps_flutter_ios/ios"
google_sign_in_ios:
:path: ".symlinks/plugins/google_sign_in_ios/ios"
image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
Expand Down Expand Up @@ -302,6 +307,7 @@ SPEC CHECKSUMS:
GoogleUtilities: 9aa0ad5a7bc171f8bae016300bfcfa3fb8425749
GTMAppAuth: 0ff230db599948a9ad7470ca667337803b3fc4dd
GTMSessionFetcher: 3a63d75eecd6aa32c2fc79f578064e1214dfdec2
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
Expand Down
4 changes: 4 additions & 0 deletions packages/mottai_flutter_app/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo Library Access Warning</string>
<key>NSCameraUsageDescription</key>
<string>Camera Library Access Warning</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// ignore_for_file: avoid_catches_without_on_clauses

import 'dart:io';

import 'package:image_picker/image_picker.dart';

enum PickType {
camera,
gallery,
}

final ImagePicker _picker = ImagePicker();

///一枚のみ選択する場合
///写真を撮影するか選択するかはenumのPickTypeで渡す
Future<File?> fetchSingleImage(PickType pickType) async {
try {
final _imageFile = await _picker.pickImage(
source: pickType == PickType.camera
? ImageSource.camera
: ImageSource.gallery,
);
return _imageFile == null ? null : File(_imageFile.path);
} catch (e) {
return null;
}
}

///複数選択する場合
Future<List<File>> fetchMultipleImage() async {
try {
final _imageFiles = await _picker.pickMultiImage();
return _imageFiles.map((e) => File(e.path)).toList();
} catch (e) {
return [];
}
}
96 changes: 96 additions & 0 deletions packages/mottai_flutter_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.1.4"
file_selector_linux:
dependency: transitive
description:
name: file_selector_linux
sha256: "770eb1ab057b5ae4326d1c24cc57710758b9a46026349d021d6311bd27580046"
url: "https://pub.dev"
source: hosted
version: "0.9.2"
file_selector_macos:
dependency: transitive
description:
name: file_selector_macos
sha256: "4ada532862917bf16e3adb3891fe3a5917a58bae03293e497082203a80909412"
url: "https://pub.dev"
source: hosted
version: "0.9.3+1"
file_selector_platform_interface:
dependency: transitive
description:
name: file_selector_platform_interface
sha256: "412705a646a0ae90f33f37acfae6a0f7cbc02222d6cd34e479421c3e74d3853c"
url: "https://pub.dev"
source: hosted
version: "2.6.0"
file_selector_windows:
dependency: transitive
description:
name: file_selector_windows
sha256: "1372760c6b389842b77156203308940558a2817360154084368608413835fc26"
url: "https://pub.dev"
source: hosted
version: "0.9.3"
firebase_auth:
dependency: "direct main"
description:
Expand Down Expand Up @@ -798,6 +830,70 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.0.2"
image_picker:
dependency: "direct main"
description:
name: image_picker
sha256: "6296e98782726d37f59663f0727d0e978eee1ced1ffed45ccaba591786a7f7b3"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
image_picker_android:
dependency: transitive
description:
name: image_picker_android
sha256: "8179b54039b50eee561676232304f487602e2950ffb3e8995ed9034d6505ca34"
url: "https://pub.dev"
source: hosted
version: "0.8.7+4"
image_picker_for_web:
dependency: transitive
description:
name: image_picker_for_web
sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
image_picker_ios:
dependency: transitive
description:
name: image_picker_ios
sha256: b3e2f21feb28b24dd73a35d7ad6e83f568337c70afab5eabac876e23803f264b
url: "https://pub.dev"
source: hosted
version: "0.8.8"
image_picker_linux:
dependency: transitive
description:
name: image_picker_linux
sha256: "02cbc21fe1706b97942b575966e5fbbeaac535e76deef70d3a242e4afb857831"
url: "https://pub.dev"
source: hosted
version: "0.2.1"
image_picker_macos:
dependency: transitive
description:
name: image_picker_macos
sha256: cee2aa86c56780c13af2c77b5f2f72973464db204569e1ba2dd744459a065af4
url: "https://pub.dev"
source: hosted
version: "0.2.1"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
sha256: c1134543ae2187e85299996d21c526b2f403854994026d575ae4cf30d7bb2a32
url: "https://pub.dev"
source: hosted
version: "2.9.0"
image_picker_windows:
dependency: transitive
description:
name: image_picker_windows
sha256: c3066601ea42113922232c7b7b3330a2d86f029f685bba99d82c30e799914952
url: "https://pub.dev"
source: hosted
version: "0.2.1"
intl:
dependency: "direct main"
description:
Expand Down
1 change: 1 addition & 0 deletions packages/mottai_flutter_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies:
google_sign_in: ^6.1.4
hooks_riverpod: ^2.3.6
intl: ^0.18.1
image_picker: ^1.0.1
package_info_plus: ^4.0.2
rxdart: ^0.27.7
sign_in_button: ^3.2.0
Expand Down