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

[Breaking change] Language Picker API Improvements #10

Closed
7 tasks done
StanevPrime opened this issue Mar 5, 2023 · 0 comments · Fixed by #36
Closed
7 tasks done

[Breaking change] Language Picker API Improvements #10

StanevPrime opened this issue Mar 5, 2023 · 0 comments · Fixed by #36
Assignees

Comments

@StanevPrime
Copy link
Member

StanevPrime commented Mar 5, 2023

As a developer I want to have an ease to use API of the чshowChangeLanguageBottomSheetч so that I can integrate that component with a minimal effort.

ACs

  • All icons to be moved from the widget constructor to the theme extension
  • Add an item builder closure
  • Update the documentation
    • Add an example with the minimal configuration
    • Add an example with the full configuration
    • Add example of the LanguageService implementation (similar to this doc)
  • Update the package version as well as the CHANGELOG

Current API

void showChangeLanguageBottomSheet({
  required BuildContext context,
  Widget Function(ErrorModel?)? errorBuilder,
  required Widget Function(BuildContext)? headerBuilder,
  dynamic iconRight,
  LanguagePickerConfiguration configuration = const LanguagePickerConfiguration(),
  final MessagePanelState messageState = MessagePanelState.important,
  dynamic errorPanelIcon,
})

Improved API

void showChangeLanguageBottomSheet({
  required BuildContext context,
  required Function(LanguageModel language) onChanged,
  required Function(LanguageModel language) translate,
  required LanguageService service,
  Widget Function(BuildContext)? headerBuilder,
  Widget Function(ErrorModel?)? errorBuilder,
  Widget Function(SelectedLanguageModel model, bool loading)? itemBuilder,
  LanguagePickerConfiguration configuration = const LanguagePickerConfiguration(),
  MessagePanelState messageState = MessagePanelState.important,
})

Theme extension

 ...
  dynamic iconRight,
  dynamic errorPanelIcon,
@StanislavPrime StanislavPrime linked a pull request Mar 21, 2023 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Published
Development

Successfully merging a pull request may close this issue.

2 participants