Giter Club home page Giter Club logo

form_builder_image_picker's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

form_builder_image_picker's Issues

Upgrade for flutter 2.0 and form_builder 5.0.0

Because every version of form_builder_image_picker depends on flutter_form_builder ^4.2.0 and project depends on flutter_form_builder ^5.0.0, form_builder_image_picker is forbidden.
So, because project depends on form_builder_image_picker ^0.1.2, version solving failed.

How to convert XFile to MultipartFile

I'm using form_builder_image_picker with Dio, which is a package that handles HTTP request.
I'm wondering if there's any better way to case the XFile value given by form_builder_image_picker to MultipartFile (provided by Dio).
I tried to accomplish this by using the valueTransformer as follows.

valueTransformer: (images) async {
  if (images != null) {
    var multipartFile = [];
    for (final image in images) {
      multipartFile.add(await MultipartFile.fromFile(image.path));
    }
    return multipartFile;
  }
},

However, since valueTransformer does not wait for future. I'll get List<Future> in the end.
Does anyone have some advice?

Can't access attributes such as path from the XFile

Environment

Package version:

Flutter doctor
[✓] Flutter (Channel stable, 3.0.5, on Mac OS X 10.14.6 18G103 darwin-x64, locale en-ID)
    • Flutter version 3.0.5 at /Users/leinheart1688/Developer/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (5 weeks ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/leinheart1688/Library/Android/sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • Java binary at: /Applications/Programming/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Programming/Xcode.app/Contents/Developer
    ✗ Flutter requires Xcode 13 or higher.
      Download the latest version or update via the Mac App Store.
    ! CocoaPods 1.10.0 out of date (1.11.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Programming/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[✓] VS Code (version 1.70.1)
    • VS Code at /Applications/Programming/Visual Studio Code.app/Contents
    • Flutter extension version 3.46.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • Mac OS X 10.14.6 18G103 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 104.0.5112.101

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.
Code sample
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final _formKey = GlobalKey<FormBuilderState>();

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  @override
  Widget build(BuildContext context) {
    
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: FormBuilder(
        key: _formKey,
        child: Column(
          
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            FormBuilderImagePicker(name: 'photo'),
            ElevatedButton(
               child: const Text('Submit'),
               onPressed: () async {
                  print(_formKey.currentState!.fields['photo']?.value);
                  XFile file = _formKey.currentState!.fields['photo']?.value;
                  print(file.path);
               }
          ],
        ),
      ),
    );
  }
}

Description

Expected behavior:
Printing out the path of the images that has been chose from android phone gallery.
I need the path of the image so I can upload the image to my server.

Current behavior:
Printing out error

I/flutter (30228): [Instance of 'XFile']
E/flutter (30228): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: type 'List<dynamic>' is not a subtype of type 'XFile'
E/flutter (30228): #0      _CreateMaintenancePageState.build.<anonymous closure> (package:maintenance_flutter_3/views/create_maintenance_page.dart:417:37)
E/flutter (30228): #1      _CreateMaintenancePageState.build.<anonymous closure> (package:maintenance_flutter_3/views/create_maintenance_page.dart:386:40)
E/flutter (30228): #2      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:1005:21)
E/flutter (30228): #3      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:198:24)
E/flutter (30228): #4      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:613:11)
E/flutter (30228): #5      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:298:5)
E/flutter (30228): #6      BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:269:7)
E/flutter (30228): #7      GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:157:27)
E/flutter (30228): #8      GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:449:20)
E/flutter (30228): #9      GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:425:22)
E/flutter (30228): #10     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:329:11)
E/flutter (30228): #11     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:380:7)
E/flutter (30228): #12     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:344:5)
E/flutter (30228): #13     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:302:7)
E/flutter (30228): #14     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:285:7)
E/flutter (30228): #15     _rootRunUnary (dart:async/zone.dart:1442:13)
E/flutter (30228): #16     _CustomZone.runUnary (dart:async/zone.dart:1335:19)
E/flutter (30228): #17     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
E/flutter (30228): #18     _invoke1 (dart:ui/hooks.dart:170:10)
E/flutter (30228): #19     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:331:7)
E/flutter (30228): #20     _dispatchPointerDataPacket (dart:ui/hooks.dart:94:31)

Steps to reproduce

  1. Install the app directly to my Android Phone
  2. Pick Image from gallery
  3. Press Submit Button

Unable to install latest version of FormBuilderImagePicker

Environment

Package version:

Flutter doctor
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.5 21G72 darwin-x64, locale en-US)
    • Flutter version 3.0.5 at /Users/expertkid/fvm/versions/3.0.5
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (5 weeks ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/expertkid/Library/Android/sdk
    • Platform android-33, build-tools 32.0.0
    • ANDROID_HOME = /Users/expertkid/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.70.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.46.0

[✓] Connected device (3 available)
    • M2102J20SG (mobile) • 6f68371c • android-arm64  • Android 12 (API 31)
    • macOS (desktop)     • macos    • darwin-x64     • macOS 12.5 21G72 darwin-x64
    • Chrome (web)        • chrome   • web-javascript • Google Chrome 104.0.5112.79
    ! Error: nitv’s iPhone is not connected. Xcode will continue when nitv’s iPhone is connected. (code -13)
    ! Error: Suman’s iPhone is not connected. Xcode will continue when Suman’s iPhone is connected. (code -13)
    ! Error: iPhone 7 is not connected. Xcode will continue when iPhone 7 is connected. (code -13)

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

pubspec.dev
name: app
description: Write your flutter project description here.

# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.0.1+1

environment:
  sdk: ">=2.17.5 <3.0.0"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

  # localization
  intl: ^0.17.0

  # firebase
  firebase_core: ^1.12.0
  firebase_analytics: ^9.3.0
  firebase_auth: ^3.6.2
  cloud_firestore: ^3.4.3
  cloud_functions: ^3.3.3
  firebase_messaging: ^12.0.1
  firebase_storage: ^10.3.4
  firebase_crashlytics: ^2.5.3
  firebase_dynamic_links: ^4.1.1
  firebase_in_app_messaging: ^0.6.0+9
  firebase_app_installations: ^0.1.0+8
  firebase_performance: ^0.8.0+7
  firebase_database: ^9.1.0
  firebase_remote_config: ^2.0.2

  # social logins
  google_sign_in: ^5.4.0
  flutter_facebook_auth: ^4.4.0
  sign_in_with_apple: ^4.1.0

  # crypto - for apple sign in
  crypto: ^3.0.1

  # local notifications
  flutter_local_notifications: ^9.7.0

  # annotations
  freezed_annotation: ^2.1.0
  json_annotation: ^4.6.0

  # Equatable
  equatable: ^2.0.3

  # bloc
  flutter_bloc: ^8.0.1
  hydrated_bloc: ^8.1.0

  # auto routes
  auto_route: ^4.2.1

  # dio
  dio: ^4.0.4
  dio_cache_interceptor: ^3.2.6
  dio_cache_interceptor_hive_store: ^3.1.1

  # hive
  hive: ^2.1.0
  hive_flutter: ^1.1.0

  # functional programming
  dartz: ^0.10.1

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2

  # responsive ui builder
  responsive_builder: ^0.4.2

  # widgets
  smooth_page_indicator: ^1.0.0+2
  carousel_slider: ^4.1.1
  flutter_staggered_grid_view: ^0.6.2
  cached_network_image: ^3.2.1
  webview_flutter: ^3.0.4
  shimmer: ^2.0.0

  # native splash screens
  flutter_native_splash: ^2.2.7

  # url launcher
  url_launcher: ^6.1.5

  # media players
  video_player: ^2.4.5
  audioplayers: ^1.0.1

  # svg support
  flutter_svg: ^1.1.1+1

  # permissions
  permission_handler: ^10.0.0

  # secure local storage
  flutter_secure_storage: ^5.0.2

  # dependency_injections
  get_it: ^7.2.0
  injectable: ^1.5.3

  # plus packages
  package_info_plus: ^1.4.2
  device_info_plus: ^4.0.0

  # connectivity test
  internet_connection_checker: ^0.0.1+4

  # location
  geolocator: ^9.0.1

  # device preview
  device_preview: ^1.1.0

  # payments
  flutter_stripe: ^4.0.0
  pay: ^1.0.10
  in_app_purchase: ^3.0.6

  # fonts
  google_fonts: ^3.0.1

  # forms
  flutter_form_builder: ^7.5.0
  form_builder_validators: ^8.3.0
  form_builder_image_picker: ^3.1.0

  # input formatters
  flutter_multi_formatter: ^2.6.0

  # maths
  vector_math: ^2.1.2

  # async
  async: ^2.8.2




dev_dependencies:
  flutter_test:
    sdk: flutter
  integration_test:
    sdk: flutter

  # test
  test: ^1.20.2

  # bloc test
  bloc_test: ^9.0.3

  # mocktail
  mocktail: ^0.3.0

  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^2.0.1

  # freezed
  freezed: ^2.1.0+1

  # json serialization
  json_serializable: ^6.3.1

  # generators
  injectable_generator: ^1.5.4
  auto_route_generator: ^4.2.0

  # build runner
  build_runner: ^2.1.8



# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:
  generate: true

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  assets:
    - assets/images/
    - assets/images/splash/
    - assets/images/splash-v31/
    - assets/images/logos/
    - assets/svgs/
    - assets/svgs/logos/
    - assets/svgs/icons/
    - fonts/poppins/
    - fonts/proxima-nova/
    - configs/

  fonts:
    - family: "Proxinova"
      fonts:
        - asset: fonts/proxima-nova/proximanova-black.otf
          weight: 900
        - asset: fonts/proxima-nova/proximanova-blackit.otf
          style: italic
          weight: 900
        - asset: fonts/proxima-nova/proximanova-bold.otf
          weight: 700
        - asset: fonts/proxima-nova/proximanova-boldit.otf
          weight: 700
          style: italic
        - asset: fonts/proxima-nova/proximanova-extrabold.otf
          weight: 800
        - asset: fonts/proxima-nova/proximanova-extraboldit.otf
          weight: 800
          style: italic
        - asset: fonts/proxima-nova/proximanova-light.otf
          weight: 300
        - asset: fonts/proxima-nova/proximanova-lightit.otf
          weight: 300
          style: italic
        - asset: fonts/proxima-nova/proximanova-medium.otf
          weight: 500
        - asset: fonts/proxima-nova/proximanova-mediumit.otf
          weight: 500
          style: italic
        - asset: fonts/proxima-nova/proximanova-regular.otf
        - asset: fonts/proxima-nova/proximanova-regularit.otf
          style: italic
        - asset: fonts/proxima-nova/proximanova-semibold.otf
          weight: 600
        - asset: fonts/proxima-nova/proximanova-semiboldit.otf
          weight: 600
          style: italic
        - asset: fonts/proxima-nova/proximanova-thin.otf
          weight: 100
        - asset: fonts/proxima-nova/proximanova-thinit.otf
          weight: 100
          style: italic




  # To add assets to your application, add an assets section, like this:
  # assets:
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

Description

Expected behavior:
Expected the package to install.

Current behavior:

Because every version of integration_test from sdk depends on async 2.8.2 and form_builder_image_picker >=3.0.0 depends on async ^2.9.0, integration_test from sdk is incompatible with form_builder_image_picker >=3.0.0.
So, because app depends on both form_builder_image_picker ^3.0.0 and integration_test from sdk, version solving failed.
pub get failed (1; So, because app depends on both form_builder_image_picker ^3.0.0 and integration_test from sdk, version solving failed.)

It's not just the integration test. All test packages give the same error.

Steps to reproduce

  1. Copy pubspec.yaml
  2. Hit pub get

Field customization

Environment

Package version: ^3.1.0

Description

What you'd like to happen: I would like to be able to customize the icon that appears in the form field (i.e. change Icons.camera_enhance to another icon, as well as customize the background color separately from the icon color ✨

Cant use previewBuilder parameters

Is there an existing issue for this?

  • I have searched the existing issues

Package/Plugin version

4.0.0

Platforms

  • Android
  • iOS
  • Linux
  • MacOS
  • Web
  • Windows

Flutter doctor

Minimal code example

Current Behavior

Expected Behavior

Steps To Reproduce

Aditional information

The named parameter 'previewBuilder' isn't defined. (Documentation) Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'previewBuilder'.

Allow only camera or galery

Hi!

Great plugin! I suggest only a option to allow select only from camera or from gallery (or both) ;-)

Regard's!

[Field name or General]: <Crop>

Is there an existing issue for this?

  • I have searched the existing issues

Package/Plugin version

4.0.0

What you'd like to happen

please support cropping the image after picking .

Alternatives you've considered

No response

Aditional information

No response

Directly open camera or gallery if only one of them is set as `availableImageSources`

Is there an existing issue for this?

  • I have searched the existing issues

Package/Plugin version

4.0.0

What you'd like to happen

#40 added the ability to control the image source by setting the `availableImageSources` option. If there's only one option set in it, for example:


availableImageSources = [ImageSourceOption.gallery]


the bottom sheet is displayed even though there's only one action to take. Directly opening the gallery in this case would a better flow.

Alternatives you've considered

No response

Aditional information

No response

Save image with URL link (Integration with Appwrite.io)

Describe your question

I am building a create/edit form for custom data type using flutter + appwrite. The field is displayed fine but I believe there could be an easier way to get the image file object, path, filename on selection. Below is my code to get the file object. Please let me know if there's a better way to get it.

FormBuilderImagePicker(
                  key: _imageFormKey,
                  name: 'photo',
                  decoration: const InputDecoration(labelText: "Pick Photo"),
                  maxImages: 1,
                  previewAutoSizeWidth: true,
                  fit: BoxFit.cover,
                  onSaved: (val) {
                    try {
                      selectedImg = val?.first;
                      // selectedImg = File(selectedImg.path);
                    } catch (e) {
                      logger.severe(e);
                    }
                  },
                ),

Another issue that I am still facing is to store the file (with filename to appwrite) and add image url to data object.

FormButtons(
                  formKey: _editTestformKey,
                  saveButtonLabel: 'Update',
                  resetButtonLabel: 'Reset',
                  saveAction: () async {
                    String? url;
                    if (selectedImg != null) {
                      logger.info("img: ${selectedImg?.path}");
                      url = await DataLayer.instance
                          .uploadImageToStorage(selectedImg!);
                      logger.info("url: $url");
                    }

                    Test test = Test(
                      name: _editTestformKey.currentState!.value['name'],
                      id: testData.id,
                      url: url,
                    );

                    await DataLayer.instance.updateDocumentById(
                        collectionId: DBCollection.testRef,
                        documentId: test.id,
                        data: test.toMap());
                  },
                ),

Code to upload to Appwrite

Future<String> uploadImageToStorage(XFile file) async {
    List<int> fileBytes = await file.readAsBytes();
    logger.info(fileBytes.length);
    logger.info(file.path);

    final uploadedImage = await _storage.createFile(
      bucketId: imagesBucket,
      fileId: ID.unique(),
      file: InputFile(
          path: file.path,
          bytes: fileBytes,
          filename: file.path
              .split('.')
              .last), //TODO: for mob use this instead- InputFile(path: file.path),
    );
    logger.info(uploadedImage.name);
    logger.info(imageUrl(uploadedImage.$id));
    return imageUrl(uploadedImage.$id);
  }

Data Document Screenshot
image

Storage screenshot
image

Although image is uploaded to appwrite but data document isn't updated with url. Can you please suggest if there's a better way to upload an image (with image name) & save its URL. Thanks

error with maxImage when set value more than 1 [only IOS]

hi , i got a problem with this package only on IOS when i set maxImages value more than 1 when i choose a image and then i got an error output like this :
Unhandled Exception: type 'String' is not a subtype of type 'List<dynamic>?' in type cast
any idea , pls share , thank in advance

Please upgrade

Please upgrade the package to support the latest version of Image_picker.

Add minimal validation workflow

Environment

Package version: N/A

Description

What you'd like to happen:
Has a minimal workflow with Github actions to verify code

  • Analyze static code
  • Build example
  • Check broken links

Alternatives you've considered:
Copy from phone_number repo

App crashes

The plugin works fine in my samsung note 8 with Android 8.0.0.

Although the same plugin crashes on my TECNO S2, Android version 8.1.0.

I think its some kind of memory issue because as soon as i click on the app and choose one of the options, lets say i choose "Camera", the terminal shows the following:
Service protocol connection closed.
[ +1 ms] Lost connection to device.
[ +5 ms] executing: /Users/shabinabarde/Library/Android/sdk/platform-tools/adb -s 03473258BQ000491 forward --list
[ +13 ms] Exit code 0 from: /Users/shabinabarde/Library/Android/sdk/platform-tools/adb -s 03473258BQ000491 forward --list
[ ] 03473258BQ000491 tcp:51935 tcp:40346
[ +2 ms] executing: /Users/shabinabarde/Library/Android/sdk/platform-tools/adb -s 03473258BQ000491 forward --remove tcp:51935
[ +20 ms] DevFS: Deleting filesystem on the device (file:///data/user/0/com.example.testforflutter2/code_cache/testforflutter2RYLGOW/testforflutter2/)
[ +255 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed
[ +2 ms] executing: /Users/shabinabarde/Library/Android/sdk/platform-tools/adb -s 03473258BQ000491 forward --list
[ +14 ms] Exit code 0 from: /Users/shabinabarde/Library/Android/sdk/platform-tools/adb -s 03473258BQ000491 forward --list
[ +6 ms] "flutter run" took 288,425ms.
[ +266 ms] ensureAnalyticsSent: 259ms
[ +2 ms] Running shutdown hooks
[ ] Shutdown hooks complete
[ ] exiting with code 0

And then as soon as i click a picture, the app restarts from the very beginning!

Upgrade requirements to use image_picker 1.0.0

Is there an existing issue for this?

  • I have searched the existing issues

Package/Plugin version

4.0.0

What you'd like to happen

I would like to update the plugin image_picker to version 1.0.0 but this is what I get when trying to use it.

Because form_builder_image_picker 4.0.0 depends on image_picker ^0.8.7+4 and no versions of form_builder_image_picker match >4.0.0 <5.0.0, form_builder_image_picker ^4.0.0 requires image_picker ^0.8.7+4.
So, because myworkapp depends on both form_builder_image_picker ^4.0.0 and image_picker ^1.0.0, version solving failed.

Would appreciate if this plugin could work with the requirements bump.

Thank you.

Alternatives you've considered

No response

Aditional information

No response

Desktop support

Similar to flutter-form-builder-ecosystem/form_builder_file_picker#57, opening image on desktop platforms should be as easy as having file picker.

I'd love to have image cropping as well (as it seems to be a most common operation when dealing with files upload), but the first step is to make it work for desktop.

What's needed to be done to make it work on desktop?

when using many form_builder_image_picker in one column it didn't work one of them

Environment

Package version:
^3.1.0

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.19044.2364], locale en-US)
Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.1)
[√] VS Code (version 1.74.2)
[√] Connected device (3 available)
[√] HTTP Host Availability

Code sample
    return FormBuilderImagePicker(
      // onChanged: (value) {
      //   setState(() {});
      // },
      // showDecoration: true,
      maxImages: 1,
      // previewAutoSizeWidth: true,
      name: name,
      decoration: InputDecoration(labelText: label),
      validator: FormBuilderValidators.compose([
        FormBuilderValidators.required(errorText: "Field is empty"),
      ]),
    );

Description

Expected behavior:

Current behavior:

Steps to reproduce

  1. This
  2. Than that
  3. Then

Images

Stacktrace/Logcat

Scrolling not working

Is there an existing issue for this?

  • I have searched the existing issues

Package/Plugin version

4.0.0

Flutter doctor

[√] Flutter (Channel stable, 3.10.0, on Microsoft Windows [Version 10.0.22000.1696], locale en-GB)
• Flutter version 3.10.0 on channel stable at C:\Users\demad\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 84a1e904f4 (7 days ago), 2023-05-09 07:41:44 -0700
• Engine revision d44b5a94c9
• Dart version 3.0.0
• DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at C:\Users\demad\AppData\Local\Android\sdk
• Platform android-33, build-tools 33.0.2
• Java binary at:
C:\Users\demad\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\222.4459.24.2221.9971841\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.0.5)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.0.32112.339
• Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[√] Android Studio (version 2022.2)
• Android Studio at C:\Users\demad\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\222.4459.24.2221.9971841
• Flutter plugin version 73.0.2
• Dart plugin version 222.4582
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[√] IntelliJ IDEA Ultimate Edition (version 2023.1)
• IntelliJ at C:\Users\demad\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\231.8770.65
• Flutter plugin version 73.1.1
• Dart plugin version 231.9065

[√] VS Code (version 1.78.1)
• VS Code at C:\Users\demad\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.46.0

[√] Connected device (4 available)
• moto g 6 plus (mobile) • ZY32389KCQ • android-arm64 • Android 9 (API 28)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.1696]
• Chrome (web) • chrome • web-javascript • Google Chrome 113.0.5672.93
• Edge (web) • edge • web-javascript • Microsoft Edge 112.0.1722.58

[√] Network resources
• All expected network resources are available.

• No issues found!

Minimal code example

Code sample

Current Behavior

When adding multiple images, the scrolling is not working as intended. It locks the scroll to the last 2 images thus not being able to scroll and see the other images added.

Expected Behavior

Horizontal smooth scroll

Steps To Reproduce

Not sure

Aditional information

No response

initialValue types

Hello, I see that initialValue must be File, String or Uint8List and this is perfect, but I don't understand why Uint8List is just valid in case of web apps. It could be a case of use in android or ios. Anyways when someone is developing an app could be helpful know in what case which type is correct.

How to turn off auto scroll?

When I operate a FormBuilderImagePicker in SingleChildScrollView, the picker will scroll to the top, how do I turn off this function?

[Image Cropping]: Adding Image crop support

Is there an existing issue for this?

  • I have searched the existing issues

Package/Plugin version

4.0.0

What you'd like to happen

Requesting to Add Image Cropping functionality after image selection, if image is cropped then while form submission, the cropped image should be include for upload image to server.

Alternatives you've considered

https://pub.dev/packages/croppy, package would be great deal, for the cropping functionality

Aditional information

image

Dependency Error for form_builder_image_picker

Dear Team, I am using flutter_form_builder: ^6.0.1. I also want to use Form Builder Image Picker. However I get a dependency error since Image Picker depends on a much older version of flutter form builder. Similarly Form Builder Image Picker depends on a much older version of Image Picker. Can you please help by upgrading the Form Builder Image Picker, Form Builder File Picker, Form Builder Phone Number to the latest versions of the dependencies. Thanks a lot for your help in advance.

Regards, Kannan Govindan

Container decoration

can you able to give more customization on the preview container and it would be better if we customize the bottom sheet or choose between dialog or sheet

Execution failed for task ':app:lintVitalRelease'

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:lintVitalRelease'.

Could not resolve all artifacts for configuration ':image_picker_android:debugUnitTestRuntimeClasspath'.
Failed to transform bcprov-jdk15on-1.68.jar (org.bouncycastle:bcprov-jdk15on:1.68) to match attributes {artifactType=processed-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: C:\Users\Taufiqsejati.gradle\caches\modules-2\files-2.1\org.bouncycastle\bcprov-jdk15on\1.68\46a080368d38b428d237a59458f9bc915222894d\bcprov-jdk15on-1.68.jar.
> Failed to transform 'C:\Users\Taufiqsejati.gradle\caches\modules-2\files-2.1\org.bouncycastle\bcprov-jdk15on\1.68\46a080368d38b428d237a59458f9bc915222894d\bcprov-jdk15on-1.68.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 59. (Run with --stacktrace for more details.)
- Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
- If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3m 6s
Running Gradle task 'assembleRelease'... 188.3s
Gradle task assembleRelease failed with exit code 1

Unable to use "prefferedCameraDevice" as i want to use only front camera.

Is there an existing issue for this?

  • I have searched the existing issues

Package/Plugin version

4.0.0

Platforms

  • Android
  • iOS
  • Linux
  • MacOS
  • Web
  • Windows

Flutter doctor

Flutter doctor
[✓] Flutter (Channel stable, 3.10.5, on macOS 14.0 23A344 darwin-arm64, locale en-IN)
    • Flutter version 3.10.5 on channel stable at /Users/lelafeitsolutions/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (4 months ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/lelafeitsolutions/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS and macOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.75.1)
    • VS Code at /Users/lelafeitsolutions/Downloads/Visual Studio Code.app/Contents
    • Flutter extension version 3.74.0

[✓] Connected device (3 available)
    • CPH2487 (mobile) • d61e2731 • android-arm64  • Android 13 (API 33)
    • macOS (desktop)  • macos    • darwin-arm64   • macOS 14.0 23A344 darwin-arm64
    • Chrome (web)     • chrome   • web-javascript • Google Chrome 118.0.5993.96

[✓] Network resources
    • All expected network resources are available.


Minimal code example

Code sample
 SizedBox(
                    width: 400,
                    height: 100,
                    child: FormBuilderImagePicker(
                      name: 'photo',
                      preferredCameraDevice: CameraDevice.front,
                      availableImageSources: const [ImageSourceOption.camera],
                      validator: FormBuilderValidators.compose([
                        FormBuilderValidators.required(),
                      ]),
                      backgroundColor: Helper.primary,
                      iconColor: Colors.white,
                      decoration: const InputDecoration(
                        labelText: 'Capture Photo',
                        labelStyle: TextStyle(color: Colors.white),
                      ),
                      maxImages: 1,
                      onSaved: (newValue) {
                        if (newValue != null && newValue.length == 1) {
                          formNotifier.setPhoto(newValue.first);
                        }
                      },
                    ),
                  ),

Current Behavior

i am still getting rear camera which i dont want.

Expected Behavior

i want to get only front camera or atleast when user opens the camera, it should be front one

Steps To Reproduce

simply use my code snippet

Aditional information

No response

Web Support

What would be the best way of adding web support ?

Input file element visible in UI

Environment

Package version: 3.1.0

Flutter doctor
[√] Flutter (Channel stable, 3.3.2, on Microsoft Windows [Versi¢n 10.0.22621.521], locale ca-ES)
    • Flutter version 3.3.2 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e3c29ec00c (3 weeks ago), 2022-09-14 08:46:55 -0500
    • Engine revision a4ff2c53d8
    • Dart version 2.18.1
    • DevTools version 2.15.0

Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at C:\Users\victo\AppData\Local\Android\sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.2)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.1.32319.34
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)

[√] VS Code (version 1.71.2)
    • VS Code at C:\Users\victo\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.21.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Versi¢n 10.0.22621.521]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 105.0.5195.127
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 102.0.1245.33

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
Code sample
    return Container(
      padding: const EdgeInsets.all(8.0),
      height: height,
      width: width,
      child: FormBuilderImagePicker(
        key: const Key('donorForm_photo'),
        name: 'photo',
        initialValue: [photo],
        maxImages: 1,
        fit: BoxFit.cover,
        previewAutoSizeWidth: true,
        previewHeight: height,
        validator: FormBuilderValidators.required(),
        decoration: CustomInputs.formInputDecoration(
          label: AppLocalizations.of(context)!.photo,
        ),
      ),
    );

Description

When using the plugin, the input file element is not hidden.

Current behavior:

The HTML code is:

	<flt-image-picker-inputs id="__image_picker_web-file-input">
		<input type="file" accept="image/*" multiple="">
	</flt-image-picker-inputs>

and, in my case, the result is:

image

Expected behavior:

If the HTML code is changed adding hidden:

	<flt-image-picker-inputs id="__image_picker_web-file-input" hidden>
		<input type="file" accept="image/*" multiple="">
	</flt-image-picker-inputs>

then the result would be:

image

getting filename and filetype from a value return type Uint8list

Hi, I use this to upload an image using flutter web, i have trouble in getting the correct filename and the type of image, after I upload the file to fire storage, with a just supplied filename, the type is application/octet-stream. What's the proper way of uploading an image to firestorage with the filename and image type like ('image/jpeg') ?

code
` FormBuilderImagePicker(
name: 'myimage',
maxImages: 1,
onChanged: (value) {
if (value != null) {
var selectedImg = value.first;
imageFilename = GetIt.I
.get()
.uploadImage(selectedImg);
}
},
onSaved: (value) {
vacancy.workRelatedImage = imageFilename;
},
),

`
what's inside my ImageRepository is this

` String uploadImage(img) {
File file = File.fromRawPath(img);
String fileName = basename(file.path);

String path = 'my_images/' + fileName;

return path;
`

the return path doesn't give me the correct filename. It returns special characters.

Any idea how to achieve this?

Spanish Language Support

Is there an existing issue for this?

  • I have searched the existing issues

Package/Plugin version

0.8.7+5

What you'd like to happen

Get text  like camera and gallery   translated.  support for i10n

Alternatives you've considered

No response

Aditional information

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.