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

Add Custom Settings Bottom Sheet without needing existing code changes #268

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

wolfe719
Copy link

Add method for interested individuals to create custom settings bottom sheets.

This method does not require any code changes to existing projects.

An optional argument is added to the TalkerScreen() function, a settingsBottomSheetCreator function.

If set, the settingsBottomSheetCreator function is called to create a custom Bottom Sheet for settings.

An example project using this method is created - the sample custom settings BottomSheet creator has the three existing basic settings (Enabled, Use console logs, Use history), and adds two more:

  • Custom Bool that is enabled/disabled based upon the "Enabled" setting
  • Global Custom Bool that can be enabled/disabled without regard to the "Enabled" setting

Changed filenames:

base_card.dart -> talker_base_card.dart
data_card.dart -> talker_data_card.dart
snackbar.dart -> talker_snackbar_content.dart

Moved talker_flutter/lib/src/ui/talker_settings/widgets/talker_setting_card.dart to talker_flutter/lib/src/ui/talker_settings

Renamed class:
BaseBottomSheet -> TalkerBaseBottomSheet

New Exports:
talker_settings.dart
talker_base_card.dart
talker_base_bottom_sheet.dart
talker_data_card.dart
talker_snackbar_content.dart
… creation

If no creator passed into TalkerView - standard settings bottom sheet will be used

Need to pass the settings bottom sheet creator in through TalkerScreen class
This allows easy access to HTTP result’s status codes when logs are collapsed
Example of adding a Custom Settings Bottom Sheet, with custom booleans
@Frezyx Frezyx added enhancement New feature or request awaiting On the list for consideration or merge labels Nov 12, 2024
@Frezyx
Copy link
Owner

Frezyx commented Nov 12, 2024

Hello @wolfe719 !
Thank you for your contribution! ❤️
I have noticed a lot of changes. I will review it and provide feedback soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting On the list for consideration or merge enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants