-
Notifications
You must be signed in to change notification settings - Fork 72
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
Refactor top bar and navigation control widgets #31
Conversation
d6193fd
to
8120fc1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/// width of the leading widget. Similarly, if there is no trailing widget and | ||
/// there is a leading widget, then the width of the leading widget is used as the | ||
/// width of the trailing widget. | ||
class WoltNavigationToolbar extends StatelessWidget { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ulusoyca
Is this any different than https://github.com/TahaTesser/flutter/blob/master/packages/flutter/lib/src/widgets/navigation_toolbar.dart?
if isn't different or customized in any way, we should use NavigationToolbar
directly instead of copying the source code and maintaining it.
If you need to call it WoltNavigationToolbar
and not NavigationToolbar
, we can return NavigationToolbar
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TahaTesser As mentioned in here, the NavigationToolBar doesn't center the middle in case the leading or trailing is missing. Here is the change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense if we've modifications.
import 'package:wolt_modal_sheet/src/content/components/current/current_main_content_animated_builder.dart'; | ||
import 'package:wolt_modal_sheet/src/content/components/current/current_sab_animated_builder.dart'; | ||
import 'package:wolt_modal_sheet/src/content/components/current/current_top_bar_animated_builder.dart'; | ||
import 'package:wolt_modal_sheet/src/content/components/current/current_top_bar_controls_animated_builder.dart'; | ||
import 'package:wolt_modal_sheet/src/content/components/current/current_navigation_toolbar_animated_builder.dart'; | ||
import 'package:wolt_modal_sheet/src/content/components/outgoing/outgoing_main_content_animated_builder.dart'; | ||
import 'package:wolt_modal_sheet/src/content/components/outgoing/outgoing_sab_animated_builder.dart'; | ||
import 'package:wolt_modal_sheet/src/content/components/outgoing/outgoing_top_bar_animated_builder.dart'; | ||
import 'package:wolt_modal_sheet/src/content/components/outgoing/outgoing_top_bar_controls_animated_builder.dart'; | ||
import 'package:wolt_modal_sheet/src/content/components/outgoing/outgoing_navigation_toolbar_animated_builder.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future we should streamline the imports, this is getting very long and wide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should have access to create a card in this board. https://github.com/orgs/woltapp/projects/1/views/1 Can you elaborate your suggestion or specs in the board as card or issue so that someone else can contribute?
Summary
This PR significantly changes the API from top bar and navigation bar aspects.
Changes
Option to set top bar always visible
isTopBarLayerAlwaysVisible
field to WoltModalSheetPage. (Requested in make topBarTitle visible all the time #21)Example use:
isTopBarALwaysVisible.mov
Layering on z axis
Optional top bar layer
WoltModalSheetPage.hasTopBarLayer
is set to false, top bar layer is never shown.no_top_bar.mov
WoltNavigationToolbar
WoltNavigationToolbar
for internal use which accomodates the navigation control widgets as leading and trailing. The top bar title also sits in themiddle
ofWoltNavigationToolbar
widget. This widget modifies the Flutter SDK'sNavigationToolBar
in a way that it ensures a symmetric layout of widgets in the absence of either a leading or trailing widget, which makes for a visually balanced UI.Leading and trailing navigation control widgets
closeButton
andbackButton
fields ofWoltModalSheet
astrailingNavBarWidget
andleadingNavBarWidget
to indicate them more generic use.