Code Monkey home page Code Monkey logo

Comments (10)

lcuis avatar lcuis commented on September 3, 2024

Hi @agustin-garcia ,

Thank you very much for your message!

I am not familiar with this icon. Is it possible that it doesn't come from the search_choices plugin?

Here are the icons from the plugin:

dynamic icon = const Icon(Icons.arrow_drop_down),

Icons.arrow_drop_down

Icon clearIcon = const Icon(Icons.clear),

Icons.clear

dynamic icon = const Icon(Icons.arrow_drop_down),

Icons.arrow_drop_down

Icon clearIcon = const Icon(Icons.clear),

Icons.clear

this.clearIcon = const Icon(Icons.clear),

Icons.clear

icon: Icon(Icons.close),

Icons.close


Icons.search


Icons.search


Icons.close


Icons.check_box

: Icons.check_box_outline_blank,

Icons.check_box_outline_blank

widget.rightToLeft ? Icons.chevron_right : Icons.chevron_left,

Icons.chevron_right and Icons.chevron_left

widget.rightToLeft ? Icons.chevron_left : Icons.chevron_right,

Icons.chevron_right and Icons.chevron_left

icon: Icon(Icons.repeat),

Icons.repeat

? Icons.filter
: filters.value!.length == 1
? Icons.filter_1
: filters.value!.length == 2
? Icons.filter_2
: filters.value!.length == 3
? Icons.filter_3
: filters.value!.length == 4
? Icons.filter_4
: filters.value!.length == 5
? Icons.filter_5
: filters.value!.length == 6
? Icons.filter_6
: filters.value!.length == 7
? Icons.filter_7
: filters.value!.length == 8
? Icons.filter_8
: filters.value!.length == 9
? Icons.filter_9
: Icons.filter_9_plus_sharp,

Icons.filter, Icons.filter_1, Icons.filter_2, ..., Icons.filter_9, Icons.filter_9_plus_sharp


Icons.check


Icons.check


Icons.clear


Icons.sort


Icons.clear

orderAsc.value ?? true ? Icons.arrow_upward : Icons.arrow_downward,

Icons.arrow_upward and Icons.arrow_downward

Some of those icons can easily be customized while for some others, it would require some additional custom code.

However, this list doesn't seem to contain the icon in your screenshot. Sorry about that.

Do you have some code you can share with me so that I can try to find the reason for this icon to appear?

from search_choices.

agustin-garcia avatar agustin-garcia commented on September 3, 2024

Hi @Icuis,
Thanks much for the prompt response, this is the icon that whe pressed, by default calls the "futureSearchFn" function, hence I'd say is internally defined into SearchOptions

Thanks again

from search_choices.

lcuis avatar lcuis commented on September 3, 2024

Hi @agustin-garcia ,

Thanks for the clarification.

If this is the icon clicked to perform the search, the icon is Icons.search as defined in either one of those lines depending on whether the language in use is RTL or not:

They can be changed with the help of the searchInputDecoration parameter which by default takes the following form:

InputDecoration(
      prefixIcon: Icon(
        Icons.search,
        size: 24,
      ),
      contentPadding: EdgeInsets.symmetric(vertical: 12),
    )

I hope this will solve your issue.

from search_choices.

agustin-garcia avatar agustin-garcia commented on September 3, 2024

Hi again,
Thanks again for you prompt response and sorry because I haven't been able to explain myself.

By following the "Single dialog paged future" example, what I'm trying to modify is the icon encircled in red.
image

I tried your suggestion, but it does insert an icon inside the actual TextField component.

I'm adding an extract of the code from your "Single dialog paged future" example:

SearchChoices.single( value: selectedValueSingleDialogPagedFuture, hint: kIsWeb ? "Example not for web" : "Select one capital", searchHint: "Search capitals", onChanged: kIsWeb ? null : (value) { setState(() { selectedValueSingleDialogPagedFuture = value; }); }, isExpanded: true, itemsPerPage: 10, currentPage: currentPage, selectedValueWidgetFn: (item) { return (...); }, futureSearchFn: (String? keyword, String? orderBy, bool? orderAsc, List<Tuple2<String, String>>? filters, int? pageNb) async { String filtersString = ""; int i = 1; filters?.forEach((element) { ... }); ... return (Tuple2<List<DropdownMenuItem>, int>(results, nbResults)); }, futureSearchOrderOptions: { .. }, futureSearchFilterOptions: { "continent": const { "icon": Text("Continent"), "exclusive": true, "values": [ ... ] }, "population": { "icon": Wrap(children: const [Icon(Icons.people), Text("Population")]), ... }, }, closeButton: (selectedItemsDone, doneContext) { return Row( ... ); }, )

from search_choices.

lcuis avatar lcuis commented on September 3, 2024

Oh, I see now. Sorry, I misunderstood earlier.

These are the future search filter buttons as defined here:

? Icons.filter
: filters.value!.length == 1
? Icons.filter_1
: filters.value!.length == 2
? Icons.filter_2
: filters.value!.length == 3
? Icons.filter_3
: filters.value!.length == 4
? Icons.filter_4
: filters.value!.length == 5
? Icons.filter_5
: filters.value!.length == 6
? Icons.filter_6
: filters.value!.length == 7
? Icons.filter_7
: filters.value!.length == 8
? Icons.filter_8
: filters.value!.length == 9
? Icons.filter_9
: Icons.filter_9_plus_sharp,

Sadly, those cannot easily be customized at the moment. Sorry about that.

Here are the options I see:

  1. Wait for someone (maybe me) to implement this flexibility.
  2. Propose a PR to implement this flexibility.
  3. Inherit and change this part of the code.

from search_choices.

agustin-garcia avatar agustin-garcia commented on September 3, 2024

Excellent, I'm glad we are aligned now.
I'll try to do it by myself.

I'm very grateful for your time and explanation.
I'll make sure to get a cup of coffee for you guys, for this wonderful job you've done here.

from search_choices.

lcuis avatar lcuis commented on September 3, 2024

Thanks a lot for your message and the coffee, that's very sweet of you!

Don't hesitate to reach for help here. I'll be more than happy to assist if I can.

from search_choices.

lcuis avatar lcuis commented on September 3, 2024

Hello @agustin-garcia ,

Release 2.2.3 of the plugin now contains an example use of the new buildFutureFilterOrOrderButton parameter within example Single dialog paged future delayed. This parameter allows the customization of the future filter and order icons. A simpler example can be found below:

        buildFutureFilterOrOrderButton: ({
          required BuildContext context,
          required bool filter,
          required Function onPressed,
          int? nbFilters,
          bool? orderAsc,
          String? orderBy,
        }) {
            return (SizedBox(
              height: 25,
              width: 48,
              child: (ElevatedButton(
                child: Icon(
                  filter?Icons.filter_alt:Icons.sort_by_alpha
                ),
                onPressed: () {
                  onPressed();
                },
              )),
            ));
        },

Providing this result:

image

I hope you will find this useful.

from search_choices.

agustin-garcia avatar agustin-garcia commented on September 3, 2024

Hi @lcuis,
Sorry for the late response, I just tried and effectively I can select a different set of Icons which allows me to give more context to the user.
Thanks so much for the effort and the follow up.

Keep up with the good work :-)

from search_choices.

lcuis avatar lcuis commented on September 3, 2024

Hi @agustin-garcia ,

No worries for the delay.

Thank you very much for your confirmation and your message!

from search_choices.

Related Issues (20)

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.