Ejemplo n.º 1
0
        public SliverAppBar(
            Key key        = null,
            Widget leading = null,
            bool automaticallyImplyLeading = true,
            Widget title                   = null,
            List <Widget> actions          = null,
            Widget flexibleSpace           = null,
            PreferredSizeWidget bottom     = null,
            float?elevation                = null,
            bool forceElevated             = false,
            Color backgroundColor          = null,
            Brightness?brightness          = null,
            IconThemeData iconTheme        = null,
            IconThemeData actionsIconTheme = null,
            TextTheme textTheme            = null,
            bool primary                   = true,
            bool?centerTitle               = null,
            float titleSpacing             = NavigationToolbar.kMiddleSpacing,
            float?expandedHeight           = null,
            bool floating                  = false,
            bool pinned  = false,
            bool snap    = false,
            bool stretch = false,
            float stretchTriggerOffset     = 100.0f,
            AsyncCallback onStretchTrigger = null,
            ShapeBorder shape = null
            ) : base(key: key)
        {
            D.assert(floating || !snap, () => "The 'snap' argument only makes sense for floating app bars.");
            D.assert(stretchTriggerOffset > 0.0);

            this.leading = leading;
            this.automaticallyImplyLeading = true;
            this.title                = title;
            this.actions              = actions;
            this.flexibleSpace        = flexibleSpace;
            this.bottom               = bottom;
            this.elevation            = elevation;
            this.forceElevated        = forceElevated;
            this.backgroundColor      = backgroundColor;
            this.brightness           = brightness;
            this.iconTheme            = iconTheme;
            this.actionsIconTheme     = actionsIconTheme;
            this.textTheme            = textTheme;
            this.primary              = primary;
            this.centerTitle          = centerTitle;
            this.titleSpacing         = NavigationToolbar.kMiddleSpacing;
            this.expandedHeight       = expandedHeight;
            this.floating             = floating;
            this.pinned               = pinned;
            this.snap                 = snap;
            this.stretch              = stretch;
            this.stretchTriggerOffset = stretchTriggerOffset;
            this.onStretchTrigger     = onStretchTrigger;
            this.shape                = shape;
        }
Ejemplo n.º 2
0
 public _SliverAppBarDelegate(
     Widget leading,
     bool automaticallyImplyLeading,
     Widget title,
     List <Widget> actions,
     Widget flexibleSpace,
     PreferredSizeWidget bottom,
     float?elevation,
     bool forceElevated,
     Color backgroundColor,
     Brightness?brightness,
     IconThemeData iconTheme,
     IconThemeData actionsIconTheme,
     TextTheme textTheme,
     bool primary,
     bool?centerTitle,
     float titleSpacing,
     float?expandedHeight,
     float?collapsedHeight,
     float?topPadding,
     bool floating,
     bool pinned,
     FloatingHeaderSnapConfiguration snapConfiguration,
     OverScrollHeaderStretchConfiguration stretchConfiguration,
     ShapeBorder shape
     )
 {
     D.assert(primary || topPadding == 0.0);
     this.leading = leading;
     this.automaticallyImplyLeading = automaticallyImplyLeading;
     this.title                = title;
     this.actions              = actions;
     this.flexibleSpace        = flexibleSpace;
     this.bottom               = bottom;
     this.elevation            = elevation;
     this.forceElevated        = forceElevated;
     this.backgroundColor      = backgroundColor;
     this.brightness           = brightness;
     this.iconTheme            = iconTheme;
     this.actionsIconTheme     = actionsIconTheme;
     this.textTheme            = textTheme;
     this.primary              = primary;
     this.centerTitle          = centerTitle;
     this.titleSpacing         = titleSpacing;
     this.expandedHeight       = expandedHeight;
     this.collapsedHeight      = collapsedHeight;
     this.topPadding           = topPadding;
     this.floating             = floating;
     this.pinned               = pinned;
     this.snapConfiguration    = snapConfiguration;
     _bottomHeight             = bottom?.preferredSize?.height ?? 0.0f;
     this.snapConfiguration    = snapConfiguration;
     this.stretchConfiguration = stretchConfiguration;
 }
Ejemplo n.º 3
0
 public AppBar(
     Key key        = null,
     Widget leading = null,
     bool automaticallyImplyLeading = true,
     Widget title                   = null,
     List <Widget> actions          = null,
     Widget flexibleSpace           = null,
     PreferredSizeWidget bottom     = null,
     float?elevation                = null,
     ShapeBorder shape              = null,
     Color backgroundColor          = null,
     Brightness?brightness          = null,
     IconThemeData iconTheme        = null,
     IconThemeData actionsIconTheme = null,
     TextTheme textTheme            = null,
     bool primary                   = true,
     bool?centerTitle               = null,
     float titleSpacing             = NavigationToolbar.kMiddleSpacing,
     float toolbarOpacity           = 1.0f,
     float bottomOpacity            = 1.0f
     ) : base(key: key)
 {
     D.assert(elevation == null || elevation >= 0.0);
     this.leading = leading;
     this.automaticallyImplyLeading = automaticallyImplyLeading;
     this.title            = title;
     this.actions          = actions;
     this.flexibleSpace    = flexibleSpace;
     this.bottom           = bottom;
     this.elevation        = elevation;
     this.shape            = shape;
     this.backgroundColor  = backgroundColor;
     this.brightness       = brightness;
     this.iconTheme        = iconTheme;
     this.actionsIconTheme = actionsIconTheme;
     this.textTheme        = textTheme;
     this.primary          = primary;
     this.centerTitle      = centerTitle;
     this.titleSpacing     = titleSpacing;
     this.toolbarOpacity   = toolbarOpacity;
     this.bottomOpacity    = bottomOpacity;
     preferredSize         = Size.fromHeight(material_.kToolbarHeight + (bottom?.preferredSize?.height ?? 0.0f));
 }