esentis / multiple_search_selection

A highly customizable multiple selection widget with fuzzy search functionality.
https://pub.dev/packages/multiple_search_selection
BSD 3-Clause "New" or "Revised" License
12 stars 13 forks source link

Error: No named parameter with the name 'thumbVisibility'. #11

Closed galih9 closed 2 years ago

galih9 commented 2 years ago

Current Behavior

cannot run debug or build on android

Expected behavior/code

i tried to implement MultipleSearchSelection , and the dart formatter looks like having no issue this is the code

Container(
    margin: EdgeInsets.symmetric(vertical: 10),
    child: MultipleSearchSelection<TeamsData>(
      onTapShowedItem: () => Loggers.warning('onTapShowedItem'),
      items: _teamsData!,
      fieldToCheck: (c) {
        return c.username;
      },
      itemBuilder: (data) {
        return Padding(
          padding: const EdgeInsets.all(6.0),
          child: Container(
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(6),
              color: Colors.white,
            ),
            child: Padding(
              padding: const EdgeInsets.symmetric(
                vertical: 20.0,
                horizontal: 12,
              ),
              child: Text(data.username),
            ),
          ),
        );
      },
      pickedItemBuilder: (country) {
        return Container(
          decoration: BoxDecoration(
            color: Colors.white,
            border: Border.all(color: Colors.grey[400]!),
          ),
          child: Padding(
            padding: const EdgeInsets.all(8),
            child: Text(country.username),
          ),
        );
      },
      onPickedChange: (items) {
        print(items);
      },
    ),
  ),

Environment

[√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.22000.795], locale en-ID)
    • Flutter version 2.10.5 at C:\Users\galih\Projects\google\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5464c5bac7 (4 months ago), 2022-04-18 09:55:37 -0700
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.69.2)
    • VS Code at C:\Users\galih\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.44.0

[√] Connected device (4 available)
    • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Windows (desktop)           • windows       • windows-x64    • Microsoft Windows [Version 10.0.22000.795]
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 103.0.5060.134
    • Edge (web)                  • edge          • web-javascript • Microsoft Edge 102.0.1245.39

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

• No issues found!

Error Log

> Task :app:compileFlutterBuildDebug
../../google/flutter/.pub-cache/hosted/pub.dartlang.org/multiple_search_selection-2.1.0/lib/multiple_search_selection.dart:426:17: Error: No named parameter with the name 'thumbVisibility'.
                thumbVisibility: widget.showPickedItemScrollbar,
                ^^^^^^^^^^^^^^^
../../google/flutter/packages/flutter/lib/src/widgets/scrollbar.dart:865:9: Context: Found this candidate, but the arguments don't match.
  const RawScrollbar({
        ^^^^^^^^^^^^
../../google/flutter/.pub-cache/hosted/pub.dartlang.org/multiple_search_selection-2.1.0/lib/multiple_search_selection.dart:638:43: Error: No named parameter with the name 'thumbVisibility'.
                                          thumbVisibility:
                                          ^^^^^^^^^^^^^^^
../../google/flutter/packages/flutter/lib/src/widgets/scrollbar.dart:865:9: Context: Found this candidate, but the arguments don't match.
  const RawScrollbar({
        ^^^^^^^^^^^^
../../google/flutter/.pub-cache/hosted/pub.dartlang.org/multiple_search_selection-2.1.0/lib/multiple_search_selection.dart:911:17: Error: No named parameter with the name 'thumbVisibility'.
                thumbVisibility: widget.showShowedItemsScrollbar,
                ^^^^^^^^^^^^^^^
../../google/flutter/packages/flutter/lib/src/widgets/scrollbar.dart:865:9: Context: Found this candidate, but the arguments don't match.
  const RawScrollbar({
        ^^^^^^^^^^^^

> Task :app:compileFlutterBuildDebug FAILED                                                                                                                                         

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\galih\Projects\google\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.                                                                                                                          
> Process 'command 'C:\Users\galih\Projects\google\flutter\bin\flutter.bat'' finished with non-zero exit value 1                                                                    

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 25s
1 actionable task: 1 executed
galih9 commented 2 years ago

I think i know why, my flutter sdk version (2.12) is not supported by the package minimum sdk (2.16)

just in case in future someone had this issue, the solution is upgrade your sdk

https://pub.dev/packages/multiple_search_selection/versions

esentis commented 2 years ago

Hello there and thanks for taking the time to fill the issue ! https://pub.dev/packages/multiple_search_selection/changelog#105

Replaces deprecated isAlwaysShown with thumbVisibility for RawScrollBar

I see you are using Flutter version < 3.x.x that's why you are getting the error. isAlwaysShown was deprecated after v2.9.0-1.0.pre.

You can try upgrading your Flutter ?