Add Custom Settings Bottom Sheet without needing existing code changes#268
Add Custom Settings Bottom Sheet without needing existing code changes#268wolfe719 wants to merge 9 commits intoFrezyx:masterfrom
Conversation
|
Hello @wolfe719 ! |
Sync with Talker Master branch
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
Sample uses gradle-8.0-all.zip in gradle-wrapper.properties Different cached modules get pulled into each project Need to start back with original sample app source code from upstream All these to rename sample app with custom settings Replace shop_app code to match Frezyx/talker shop_app_example Updated pubspec.lock
|
Updated to remove conflicts with base branch. Just want to make your review that much easier. Note that I moved your example app down one directory level, and added a second sample app, this one with a custom settings view. So now you have two example apps: examples/shop_app - used to be shop_app_example |
Frezyx
left a comment
There was a problem hiding this comment.
@wolfe719 Hello! Thank you so much for this contribution and for your donation! ❤️
But you have changed a lot of things in the core code of the library in order to make it possible to add custom settings.
Also calling talker.notifyListeners() outside of the package leads to this waring:
The member 'notifyListeners' can only be used within instance members of subclasses of 'package:flutter/src/foundation/change_notifier.dart'.
Ability to implement your custom settings in TalkerScreen is really needed.
But it needs to be made much easier.
I suggest opening a new pull request or refining this one to ensure that the changes impact the minimum amount of code possible.
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: