Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions packages/image_picker/image_picker_ios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT

* Use FloatingActionButton.extended in iOS example to add descriptive labels for each action.
* Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.

## 0.8.12+2
Expand Down
39 changes: 24 additions & 15 deletions packages/image_picker/image_picker_ios/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,28 +284,31 @@ class _MyHomePageState extends State<MyHomePage> {
appBar: AppBar(
title: Text(widget.title!),
),
body: Center(
body: Align(
alignment: Alignment.topCenter,
child: _handlePreview(),
),
floatingActionButton: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Semantics(
label: 'image_picker_example_from_gallery',
child: FloatingActionButton(
child: FloatingActionButton.extended(
key: const Key('image_picker_example_from_gallery'),
onPressed: () {
_isVideo = false;
_onImageButtonPressed(ImageSource.gallery, context: context);
},
heroTag: 'image0',
tooltip: 'Pick Image from gallery',
child: const Icon(Icons.photo),
label: const Text('Pick Image from gallery'),
icon: const Icon(Icons.photo),
),
),
Padding(
padding: const EdgeInsets.only(top: 16.0),
child: FloatingActionButton(
child: FloatingActionButton.extended(
onPressed: () {
_isVideo = false;
_onImageButtonPressed(
Expand All @@ -317,12 +320,13 @@ class _MyHomePageState extends State<MyHomePage> {
},
heroTag: 'multipleMedia',
tooltip: 'Pick Multiple Media from gallery',
child: const Icon(Icons.photo_library),
label: const Text('Pick Multiple Media from gallery'),
icon: const Icon(Icons.photo_library),
),
),
Padding(
padding: const EdgeInsets.only(top: 16.0),
child: FloatingActionButton(
child: FloatingActionButton.extended(
onPressed: () {
_isVideo = false;
_onImageButtonPressed(
Expand All @@ -333,12 +337,13 @@ class _MyHomePageState extends State<MyHomePage> {
},
heroTag: 'media',
tooltip: 'Pick Single Media from gallery',
child: const Icon(Icons.photo_library),
label: const Text('Pick Single Media from gallery'),
icon: const Icon(Icons.photo_library),
),
),
Padding(
padding: const EdgeInsets.only(top: 16.0),
child: FloatingActionButton(
child: FloatingActionButton.extended(
onPressed: () {
_isVideo = false;
_onImageButtonPressed(
Expand All @@ -349,45 +354,49 @@ class _MyHomePageState extends State<MyHomePage> {
},
heroTag: 'image1',
tooltip: 'Pick Multiple Image from gallery',
child: const Icon(Icons.photo_library),
label: const Text('Pick Multiple Image from gallery'),
icon: const Icon(Icons.photo_library),
),
),
Padding(
padding: const EdgeInsets.only(top: 16.0),
child: FloatingActionButton(
child: FloatingActionButton.extended(
onPressed: () {
_isVideo = false;
_onImageButtonPressed(ImageSource.camera, context: context);
},
heroTag: 'image2',
tooltip: 'Take a Photo',
child: const Icon(Icons.camera_alt),
label: const Text('Take a Photo'),
icon: const Icon(Icons.camera_alt),
),
),
Padding(
padding: const EdgeInsets.only(top: 16.0),
child: FloatingActionButton(
child: FloatingActionButton.extended(
backgroundColor: Colors.red,
onPressed: () {
_isVideo = true;
_onImageButtonPressed(ImageSource.gallery, context: context);
},
heroTag: 'video0',
tooltip: 'Pick Video from gallery',
child: const Icon(Icons.video_library),
label: const Text('Pick Video from gallery'),
icon: const Icon(Icons.video_library),
),
),
Padding(
padding: const EdgeInsets.only(top: 16.0),
child: FloatingActionButton(
child: FloatingActionButton.extended(
backgroundColor: Colors.red,
onPressed: () {
_isVideo = true;
_onImageButtonPressed(ImageSource.camera, context: context);
},
heroTag: 'video1',
tooltip: 'Take a Video',
child: const Icon(Icons.videocam),
label: const Text('Take a Video'),
icon: const Icon(Icons.videocam),
),
),
],
Expand Down