diff --git a/packages/image_picker/image_picker_android/example/lib/main.dart b/packages/image_picker/image_picker_android/example/lib/main.dart index 8218f2d5ae2..c28c7729df9 100755 --- a/packages/image_picker/image_picker_android/example/lib/main.dart +++ b/packages/image_picker/image_picker_android/example/lib/main.dart @@ -336,7 +336,8 @@ class _MyHomePageState extends State { appBar: AppBar( title: Text(widget.title!), ), - body: Center( + body: Align( + alignment: Alignment.topCenter, child: !kIsWeb && defaultTargetPlatform == TargetPlatform.android ? FutureBuilder( future: retrieveLostData(), @@ -372,7 +373,7 @@ class _MyHomePageState extends State { children: [ Semantics( label: 'image_picker_example_from_gallery', - child: FloatingActionButton( + child: FloatingActionButton.extended( key: const Key('image_picker_example_from_gallery'), onPressed: () { _isVideo = false; @@ -380,12 +381,13 @@ class _MyHomePageState extends State { }, 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( @@ -397,12 +399,13 @@ class _MyHomePageState extends State { }, 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( @@ -413,12 +416,13 @@ class _MyHomePageState extends State { }, 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( @@ -429,24 +433,26 @@ class _MyHomePageState extends State { }, 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; @@ -454,12 +460,13 @@ class _MyHomePageState extends State { }, 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; @@ -467,7 +474,8 @@ class _MyHomePageState extends State { }, heroTag: 'video1', tooltip: 'Take a Video', - child: const Icon(Icons.videocam), + label: const Text('Take a Video'), + icon: const Icon(Icons.videocam), ), ), ], diff --git a/packages/image_picker/image_picker_ios/example/lib/main.dart b/packages/image_picker/image_picker_ios/example/lib/main.dart index 28d0ea2540e..e91b87e60d6 100755 --- a/packages/image_picker/image_picker_ios/example/lib/main.dart +++ b/packages/image_picker/image_picker_ios/example/lib/main.dart @@ -284,15 +284,17 @@ class _MyHomePageState extends State { appBar: AppBar( title: Text(widget.title!), ), - body: Center( + body: Align( + alignment: Alignment.topCenter, child: _handlePreview(), ), floatingActionButton: Column( mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, children: [ Semantics( label: 'image_picker_example_from_gallery', - child: FloatingActionButton( + child: FloatingActionButton.extended( key: const Key('image_picker_example_from_gallery'), onPressed: () { _isVideo = false; @@ -300,12 +302,13 @@ class _MyHomePageState extends State { }, 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( @@ -317,12 +320,13 @@ class _MyHomePageState extends State { }, 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( @@ -333,12 +337,13 @@ class _MyHomePageState extends State { }, 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( @@ -349,24 +354,26 @@ class _MyHomePageState extends State { }, 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; @@ -374,12 +381,13 @@ class _MyHomePageState extends State { }, 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; @@ -387,7 +395,8 @@ class _MyHomePageState extends State { }, heroTag: 'video1', tooltip: 'Take a Video', - child: const Icon(Icons.videocam), + label: const Text('Take a Video'), + icon: const Icon(Icons.videocam), ), ), ], diff --git a/packages/image_picker/image_picker_linux/example/lib/main.dart b/packages/image_picker/image_picker_linux/example/lib/main.dart index 8f4887095c1..acec8f8b360 100644 --- a/packages/image_picker/image_picker_linux/example/lib/main.dart +++ b/packages/image_picker/image_picker_linux/example/lib/main.dart @@ -277,7 +277,8 @@ class _MyHomePageState extends State { appBar: AppBar( title: Text(widget.title!), ), - body: Center( + body: Align( + alignment: Alignment.topCenter, child: _handlePreview(), ), floatingActionButton: Column( @@ -285,7 +286,7 @@ class _MyHomePageState extends State { children: [ Semantics( label: 'image_picker_example_from_gallery', - child: FloatingActionButton( + child: FloatingActionButton.extended( key: const Key('image_picker_example_from_gallery'), onPressed: () { _isVideo = false; @@ -293,12 +294,13 @@ class _MyHomePageState extends State { }, 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( @@ -310,12 +312,13 @@ class _MyHomePageState extends State { }, 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( @@ -326,12 +329,13 @@ class _MyHomePageState extends State { }, 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( @@ -342,25 +346,27 @@ class _MyHomePageState extends State { }, 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), ), ), if (_picker.supportsImageSource(ImageSource.camera)) 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; @@ -368,13 +374,14 @@ class _MyHomePageState extends State { }, 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), ), ), if (_picker.supportsImageSource(ImageSource.camera)) Padding( padding: const EdgeInsets.only(top: 16.0), - child: FloatingActionButton( + child: FloatingActionButton.extended( backgroundColor: Colors.red, onPressed: () { _isVideo = true; @@ -382,7 +389,8 @@ class _MyHomePageState extends State { }, heroTag: 'video1', tooltip: 'Take a Video', - child: const Icon(Icons.videocam), + label: const Text('Take a Video'), + icon: const Icon(Icons.videocam), ), ), ], diff --git a/packages/image_picker/image_picker_macos/example/lib/main.dart b/packages/image_picker/image_picker_macos/example/lib/main.dart index 8f4887095c1..acec8f8b360 100644 --- a/packages/image_picker/image_picker_macos/example/lib/main.dart +++ b/packages/image_picker/image_picker_macos/example/lib/main.dart @@ -277,7 +277,8 @@ class _MyHomePageState extends State { appBar: AppBar( title: Text(widget.title!), ), - body: Center( + body: Align( + alignment: Alignment.topCenter, child: _handlePreview(), ), floatingActionButton: Column( @@ -285,7 +286,7 @@ class _MyHomePageState extends State { children: [ Semantics( label: 'image_picker_example_from_gallery', - child: FloatingActionButton( + child: FloatingActionButton.extended( key: const Key('image_picker_example_from_gallery'), onPressed: () { _isVideo = false; @@ -293,12 +294,13 @@ class _MyHomePageState extends State { }, 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( @@ -310,12 +312,13 @@ class _MyHomePageState extends State { }, 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( @@ -326,12 +329,13 @@ class _MyHomePageState extends State { }, 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( @@ -342,25 +346,27 @@ class _MyHomePageState extends State { }, 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), ), ), if (_picker.supportsImageSource(ImageSource.camera)) 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; @@ -368,13 +374,14 @@ class _MyHomePageState extends State { }, 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), ), ), if (_picker.supportsImageSource(ImageSource.camera)) Padding( padding: const EdgeInsets.only(top: 16.0), - child: FloatingActionButton( + child: FloatingActionButton.extended( backgroundColor: Colors.red, onPressed: () { _isVideo = true; @@ -382,7 +389,8 @@ class _MyHomePageState extends State { }, heroTag: 'video1', tooltip: 'Take a Video', - child: const Icon(Icons.videocam), + label: const Text('Take a Video'), + icon: const Icon(Icons.videocam), ), ), ], diff --git a/packages/image_picker/image_picker_windows/example/lib/main.dart b/packages/image_picker/image_picker_windows/example/lib/main.dart index 8f4887095c1..acec8f8b360 100644 --- a/packages/image_picker/image_picker_windows/example/lib/main.dart +++ b/packages/image_picker/image_picker_windows/example/lib/main.dart @@ -277,7 +277,8 @@ class _MyHomePageState extends State { appBar: AppBar( title: Text(widget.title!), ), - body: Center( + body: Align( + alignment: Alignment.topCenter, child: _handlePreview(), ), floatingActionButton: Column( @@ -285,7 +286,7 @@ class _MyHomePageState extends State { children: [ Semantics( label: 'image_picker_example_from_gallery', - child: FloatingActionButton( + child: FloatingActionButton.extended( key: const Key('image_picker_example_from_gallery'), onPressed: () { _isVideo = false; @@ -293,12 +294,13 @@ class _MyHomePageState extends State { }, 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( @@ -310,12 +312,13 @@ class _MyHomePageState extends State { }, 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( @@ -326,12 +329,13 @@ class _MyHomePageState extends State { }, 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( @@ -342,25 +346,27 @@ class _MyHomePageState extends State { }, 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), ), ), if (_picker.supportsImageSource(ImageSource.camera)) 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; @@ -368,13 +374,14 @@ class _MyHomePageState extends State { }, 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), ), ), if (_picker.supportsImageSource(ImageSource.camera)) Padding( padding: const EdgeInsets.only(top: 16.0), - child: FloatingActionButton( + child: FloatingActionButton.extended( backgroundColor: Colors.red, onPressed: () { _isVideo = true; @@ -382,7 +389,8 @@ class _MyHomePageState extends State { }, heroTag: 'video1', tooltip: 'Take a Video', - child: const Icon(Icons.videocam), + label: const Text('Take a Video'), + icon: const Icon(Icons.videocam), ), ), ],