Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/config smart select tile #20

Closed

Conversation

heypran
Copy link

@heypran heypran commented Aug 27, 2020

Changes (fixes 19)

  • Add style config for smart select tile

Test

  • Verified by using on personal project

Sample code

 SmartSelectTileConfig ssTileCnfig = new SmartSelectTileConfig(
      style: new SmartSelectTileStyle(
          textStyle: TextStyle(
              color: MyTheme.paragraph,
              fontFamily: prefService.fontPrefs.value != null
                  ? prefService.fontPrefs.value
                  : 'Clem')));

SmartSelect<String>.single(
            //choiceType: SmartSelectChoiceType.chips,
            modalType: SmartSelectModalType.bottomSheet,
            modalConfig: modalConfig,
            tileConfig: ssTileCnfig,
            title: 'Fonts',
            value: preferences['font'] ?? 'flutter',
            options: availableFonts,
            trailing: StrokeIcon(icon: Icons.font_download),
            onChange: (val) => setState(() => changeFont(val))),

@heypran
Copy link
Author

heypran commented Sep 2, 2020

Hi @davigmacode , can you please review this PR.

@davigmacode
Copy link
Owner

davigmacode commented Sep 30, 2020

Hi @heypran, Thanks for contributing to SmartSelect, I really appreciate it.

I apologize for this long response, I have reviewed your code, I thought it would be too complex to add the tile configuration directly into the SmartSelect class, please check at the latest 4.x.x version, all the tile configuration has been moved to S2Tile class.

// usage example
SmartSelect<T>.single(
  ...,
  ...,
  tileBuilder: (context, state) {
    return S2Tile(
      title: state.titleWidget,
      value: state.valueDisplay,
      onTap: state.showModal,
    );
  },
);

// usage example from state
SmartSelect<T>.multiple(
  ...,
  ...,
  tileBuilder: (context, state) {
    return S2Tile.fromState(state);
  },
);

I will close this pull request without merging it, hope you will understand, Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

how to change font size for title
3 participants