public TabBarTheme copyWith( Decoration indicator = null, TabBarIndicatorSize?indicatorSize = null, Color labelColor = null, EdgeInsetsGeometry labelPadding = null, TextStyle labelStyle = null, Color unselectedLabelColor = null, TextStyle unselectedLabelStyle = null ) { return(new TabBarTheme( indicator: indicator ?? this.indicator, indicatorSize: indicatorSize ?? this.indicatorSize, labelColor: labelColor ?? this.labelColor, labelPadding: labelPadding ?? this.labelPadding, labelStyle: labelStyle ?? this.labelStyle, unselectedLabelColor: unselectedLabelColor ?? this.unselectedLabelColor, unselectedLabelStyle: unselectedLabelStyle ?? this.unselectedLabelStyle)); }
public GridView( Key key = null, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController controller = null, bool?primary = null, ScrollPhysics physics = null, bool shrinkWrap = false, EdgeInsetsGeometry padding = null, float?maxCrossAxisExtent = null, float mainAxisSpacing = 0.0f, float crossAxisSpacing = 0.0f, float childAspectRatio = 1.0f, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, List <Widget> children = null, DragStartBehavior dragStartBehavior = DragStartBehavior.start ) : base( key: key, scrollDirection: scrollDirection, reverse: reverse, controller: controller, primary: primary, physics: physics, shrinkWrap: shrinkWrap, padding: padding, dragStartBehavior: dragStartBehavior ) { gridDelegate = new SliverGridDelegateWithMaxCrossAxisExtent( maxCrossAxisExtent: maxCrossAxisExtent ?? 0, mainAxisSpacing: mainAxisSpacing, crossAxisSpacing: crossAxisSpacing, childAspectRatio: childAspectRatio ); childrenDelegate = new SliverChildListDelegate( children ?? new List <Widget> { }, addAutomaticKeepAlives: addAutomaticKeepAlives, addRepaintBoundaries: addRepaintBoundaries ); }
public ExpandIcon( Key key = null, bool isExpanded = false, float size = 24.0f, ValueChanged <bool> onPressed = null, EdgeInsetsGeometry padding = null, Color color = null, Color disabledColor = null, Color expandedColor = null ) : base(key: key) { this.isExpanded = isExpanded; this.size = size; this.onPressed = onPressed; this.padding = padding ?? EdgeInsets.all(8.0f); this.color = color; this.disabledColor = disabledColor; this.expandedColor = expandedColor; }
public Card( Key key = null, Color color = null, Color shadowColor = null, float?elevation = null, ShapeBorder shape = null, bool borderOnForeground = true, EdgeInsetsGeometry margin = null, Clip?clipBehavior = null, Widget child = null) : base(key: key) { D.assert(elevation == null || elevation >= 0.0f); this.color = color; this.shadowColor = shadowColor; this.elevation = elevation; this.shape = shape; this.borderOnForeground = borderOnForeground; this.margin = margin; this.clipBehavior = clipBehavior; this.child = child; }
public Ink( Key key = null, EdgeInsetsGeometry padding = null, Color color = null, Decoration decoration = null, float?width = null, float?height = null, Widget child = null) : base(key: key) { D.assert(padding == null || padding.isNonNegative); D.assert(decoration == null || decoration.debugAssertIsValid()); D.assert(color == null || decoration == null, () => "Cannot provide both a color and a decoration\n" + "The color argument is just a shorthand for \"decoration: new BoxDecoration(color: color)\"."); decoration = decoration ?? (color != null ? new BoxDecoration(color: color) : null); this.padding = padding; this.width = width; this.height = height; this.child = child; this.decoration = decoration; }
public IconButton( Key key = null, float iconSize = 24.0f, VisualDensity visualDensity = null, EdgeInsetsGeometry padding = null, AlignmentGeometry alignment = null, Widget icon = null, Color color = null, Color focusColor = null, Color hoverColor = null, Color highlightColor = null, Color splashColor = null, Color disabledColor = null, VoidCallback onPressed = null, FocusNode focusNode = null, bool autofocus = false, string tooltip = null, bool?enableFeedback = true, BoxConstraints constraints = null ) : base(key: key) { D.assert(icon != null); this.iconSize = iconSize; this.visualDensity = visualDensity; this.padding = padding ?? EdgeInsets.all(8.0f); this.alignment = alignment ?? Alignment.center; this.icon = icon; this.color = color; this.focusColor = focusColor; this.hoverColor = hoverColor; this.highlightColor = highlightColor; this.splashColor = splashColor; this.disabledColor = disabledColor; this.onPressed = onPressed; this.focusNode = focusNode; this.autofocus = autofocus; this.tooltip = tooltip; this.enableFeedback = enableFeedback; this.constraints = constraints; }
public static GridView count( Key key = null, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController controller = null, bool?primary = null, ScrollPhysics physics = null, bool shrinkWrap = false, EdgeInsetsGeometry padding = null, int?crossAxisCount = null, float mainAxisSpacing = 0.0f, float crossAxisSpacing = 0.0f, float childAspectRatio = 1.0f, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, float?cacheExtent = null, List <Widget> children = null, DragStartBehavior dragStartBehavior = DragStartBehavior.start ) { return(new GridView( key: key, scrollDirection: scrollDirection, reverse: reverse, controller: controller, primary: primary, physics: physics, shrinkWrap: shrinkWrap, padding: padding, crossAxisCount: crossAxisCount, mainAxisSpacing: mainAxisSpacing, crossAxisSpacing: crossAxisSpacing, childAspectRatio: childAspectRatio, addAutomaticKeepAlives: addAutomaticKeepAlives, addRepaintBoundaries: addRepaintBoundaries, cacheExtent: cacheExtent, children: children, dragStartBehavior: dragStartBehavior )); }
ListView( Key key = null, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController controller = null, bool?primary = null, ScrollPhysics physics = null, bool shrinkWrap = false, EdgeInsetsGeometry padding = null, float?itemExtent = null, IndexedWidgetBuilder itemBuilder = null, int?itemCount = null, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, float?cacheExtent = null, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual ) : base(key: key, scrollDirection: scrollDirection, reverse: reverse, controller: controller, primary: primary, physics: physics, shrinkWrap: shrinkWrap, padding: padding, cacheExtent: cacheExtent, dragStartBehavior: dragStartBehavior, keyboardDismissBehavior: keyboardDismissBehavior ) { D.assert(itemCount == null || itemCount >= 0); this.itemExtent = itemExtent; childrenDelegate = new SliverChildBuilderDelegate( itemBuilder, childCount: itemCount, addAutomaticKeepAlives: addAutomaticKeepAlives, addRepaintBoundaries: addRepaintBoundaries ); }
public AnimatedContainer( Key key = null, AlignmentGeometry alignment = null, EdgeInsetsGeometry padding = null, Color color = null, Decoration decoration = null, Decoration foregroundDecoration = null, float?width = null, float?height = null, BoxConstraints constraints = null, EdgeInsetsGeometry margin = null, Matrix4 transform = null, Widget child = null, Curve curve = null, TimeSpan?duration = null, VoidCallback onEnd = null ) : base(key: key, curve: curve ?? Curves.linear, duration: duration, onEnd: onEnd) { D.assert(duration != null); D.assert(margin == null || margin.isNonNegative); D.assert(padding == null || padding.isNonNegative); D.assert(decoration == null || decoration.debugAssertIsValid()); D.assert(constraints == null || constraints.debugAssertIsValid()); D.assert(color == null || decoration == null, () => "Cannot provide both a color and a decoration\n" + "The color argument is just a shorthand for \"decoration: new BoxDecoration(backgroundColor: color)\"."); this.alignment = alignment; this.padding = padding; this.foregroundDecoration = foregroundDecoration; this.margin = margin; this.transform = transform; this.child = child; this.decoration = decoration ?? (color != null ? new BoxDecoration(color: color) : null); this.constraints = (width != null || height != null) ? constraints?.tighten(width: width, height: height) ?? BoxConstraints.tightFor(width: width, height: height) : constraints; }
public Container( Key key = null, AlignmentGeometry alignment = null, EdgeInsetsGeometry padding = null, Color color = null, Decoration decoration = null, Decoration foregroundDecoration = null, float?width = null, float?height = null, BoxConstraints constraints = null, EdgeInsetsGeometry margin = null, Matrix4 transform = null, Widget child = null, Clip clipBehavior = Clip.none ) : base(key: key) { D.assert(margin == null || margin.isNonNegative); D.assert(padding == null || padding.isNonNegative); D.assert(decoration == null || decoration.debugAssertIsValid()); D.assert(constraints == null || constraints.debugAssertIsValid()); D.assert(color == null || decoration == null, () => "Cannot provide both a color and a decoration\n" + "The color argument is just a shorthand for \"decoration: new BoxDecoration(color: color)\"." ); D.assert(clipBehavior != null); this.alignment = alignment; this.padding = padding; this.foregroundDecoration = foregroundDecoration; this.color = color; this.decoration = decoration;// ?? (color != null ? new BoxDecoration(color) : null); this.constraints = (width != null || height != null) ? (constraints != null ? constraints.tighten(width, height) : BoxConstraints.tightFor(width, height)) : constraints; this.margin = margin; this.transform = transform; this.child = child; this.clipBehavior = clipBehavior; }
public AlertDialog( Key key = null, Widget title = null, EdgeInsetsGeometry titlePadding = null, TextStyle titleTextStyle = null, Widget content = null, EdgeInsetsGeometry contentPadding = null, TextStyle contentTextStyle = null, List <Widget> actions = null, EdgeInsetsGeometry actionsPadding = null, VerticalDirection actionsOverflowDirection = VerticalDirection.up, float actionsOverflowButtonSpacing = 0, EdgeInsetsGeometry buttonPadding = null, Color backgroundColor = null, float?elevation = null, EdgeInsets insetPadding = null, Clip clipBehavior = Clip.none, ShapeBorder shape = null, bool scrollable = false ) : base(key: key) { this.title = title; this.titlePadding = titlePadding; this.titleTextStyle = titleTextStyle; this.content = content; this.contentPadding = contentPadding ?? EdgeInsets.fromLTRB(24.0f, 20.0f, 24.0f, 24.0f); this.contentTextStyle = contentTextStyle; this.actions = actions; this.actionsPadding = actionsPadding ?? EdgeInsets.zero; this.actionsOverflowDirection = actionsOverflowDirection; this.actionsOverflowButtonSpacing = actionsOverflowButtonSpacing; this.buttonPadding = buttonPadding; this.backgroundColor = backgroundColor; this.elevation = elevation; this.insetPadding = insetPadding ?? material_._defaultInsetPadding; this.clipBehavior = clipBehavior; this.shape = shape; this.scrollable = scrollable; }
public SwitchListTile( Key key = null, bool?value = null, ValueChanged <bool?> onChanged = null, Color activeColor = null, Color activeTrackColor = null, Color inactiveThumbColor = null, Color inactiveTrackColor = null, ImageProvider activeThumbImage = null, ImageProvider inactiveThumbImage = null, Widget title = null, Widget subtitle = null, bool isThreeLine = false, bool?dense = null, EdgeInsetsGeometry contentPadding = null, Widget secondary = null, bool selected = false, _SwitchListTileType _switchListTileType = _SwitchListTileType.material ) : base(key: key) { D.assert(value != null); D.assert(!isThreeLine || subtitle != null); this.value = value.Value; this.onChanged = onChanged; this.activeColor = activeColor; this.activeTrackColor = activeTrackColor; this.inactiveThumbColor = inactiveThumbColor; this.inactiveTrackColor = inactiveTrackColor; this.activeThumbImage = activeThumbImage; this.inactiveThumbImage = inactiveThumbImage; this.title = title; this.subtitle = subtitle; this.isThreeLine = isThreeLine; this.dense = dense; this.contentPadding = contentPadding; this.secondary = secondary; this.selected = selected; this._switchListTileType = _switchListTileType; }
protected override List <Widget> buildSlivers(BuildContext context) { Widget sliver = buildChildLayout(context); EdgeInsetsGeometry effectivePadding = padding; if (padding == null) { MediaQueryData mediaQuery = MediaQuery.of(context, nullOk: true); if (mediaQuery != null) { EdgeInsets mediaQueryHorizontalPadding = mediaQuery.padding.copyWith(top: 0.0f, bottom: 0.0f); EdgeInsets mediaQueryVerticalPadding = mediaQuery.padding.copyWith(left: 0.0f, right: 0.0f); effectivePadding = scrollDirection == Axis.vertical ? mediaQueryVerticalPadding : mediaQueryHorizontalPadding; sliver = new MediaQuery( data: mediaQuery.copyWith( padding: scrollDirection == Axis.vertical ? mediaQueryHorizontalPadding : mediaQueryVerticalPadding ), child: sliver ); } } if (effectivePadding != null) { sliver = new SliverPadding(padding: effectivePadding, sliver: sliver); } return(new List <Widget> { sliver }); }
public static ButtonTheme bar( Key key = null, ButtonTextTheme textTheme = ButtonTextTheme.accent, float minWidth = 64.0f, float height = 36.0f, EdgeInsetsGeometry padding = null, ShapeBorder shape = null, bool alignedDropdown = false, Color buttonColor = null, Color disabledColor = null, Color focusColor = null, Color hoverColor = null, Color highlightColor = null, Color splashColor = null, ColorScheme colorScheme = null, Widget child = null, ButtonBarLayoutBehavior layoutBehavior = ButtonBarLayoutBehavior.padded ) { D.assert(minWidth >= 0.0); D.assert(height >= 0.0); return(new ButtonTheme(key, new ButtonThemeData( textTheme: textTheme, minWidth: minWidth, height: height, padding: padding ?? EdgeInsets.symmetric(horizontal: 8.0f), shape: shape, alignedDropdown: alignedDropdown, layoutBehavior: layoutBehavior, buttonColor: buttonColor, disabledColor: disabledColor, focusColor: focusColor, hoverColor: hoverColor, highlightColor: highlightColor, splashColor: splashColor, colorScheme: colorScheme ), child)); }
public ButtonTheme( Key key = null, ButtonTextTheme textTheme = ButtonTextTheme.normal, ButtonBarLayoutBehavior layoutBehavior = ButtonBarLayoutBehavior.padded, float minWidth = 88.0f, float height = 36.0f, EdgeInsetsGeometry padding = null, ShapeBorder shape = null, bool alignedDropdown = false, Color buttonColor = null, Color disabledColor = null, Color focusColor = null, Color hoverColor = null, Color highlightColor = null, Color splashColor = null, ColorScheme colorScheme = null, MaterialTapTargetSize?materialTapTargetSize = null, Widget child = null) : base(key: key, child: child) { D.assert(minWidth >= 0.0); D.assert(height >= 0.0); data = new ButtonThemeData( textTheme: textTheme, minWidth: minWidth, height: height, padding: padding, shape: shape, alignedDropdown: alignedDropdown, layoutBehavior: layoutBehavior, buttonColor: buttonColor, disabledColor: disabledColor, focusColor: focusColor, hoverColor: hoverColor, highlightColor: highlightColor, splashColor: splashColor, colorScheme: colorScheme, materialTapTargetSize: materialTapTargetSize); }
public ChipThemeData copyWith( Color backgroundColor = null, Color deleteIconColor = null, Color disabledColor = null, Color selectedColor = null, Color secondarySelectedColor = null, Color shadowColor = null, Color selectedShadowColor = null, Color checkmarkColor = null, EdgeInsetsGeometry labelPadding = null, EdgeInsetsGeometry padding = null, ShapeBorder shape = null, TextStyle labelStyle = null, TextStyle secondaryLabelStyle = null, Brightness?brightness = null, float?elevation = null, float?pressElevation = null ) { return(new ChipThemeData( backgroundColor: backgroundColor ?? this.backgroundColor, deleteIconColor: deleteIconColor ?? this.deleteIconColor, disabledColor: disabledColor ?? this.disabledColor, selectedColor: selectedColor ?? this.selectedColor, secondarySelectedColor: secondarySelectedColor ?? this.secondarySelectedColor, shadowColor: shadowColor ?? this.shadowColor, selectedShadowColor: selectedShadowColor ?? this.selectedShadowColor, checkmarkColor: checkmarkColor ?? this.checkmarkColor, labelPadding: labelPadding ?? this.labelPadding, padding: padding ?? this.padding, shape: shape ?? this.shape, labelStyle: labelStyle ?? this.labelStyle, secondaryLabelStyle: secondaryLabelStyle ?? this.secondaryLabelStyle, brightness: brightness ?? this.brightness, elevation: elevation ?? this.elevation, pressElevation: pressElevation ?? this.pressElevation )); }
public static ListView builder( Key key = null, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController controller = null, bool?primary = null, ScrollPhysics physics = null, bool shrinkWrap = false, EdgeInsetsGeometry padding = null, float?itemExtent = null, IndexedWidgetBuilder itemBuilder = null, int?itemCount = null, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, float?cacheExtent = null, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual ) { return(new ListView( key: key, scrollDirection: scrollDirection, reverse: reverse, controller: controller, primary: primary, physics: physics, shrinkWrap: shrinkWrap, padding: padding, cacheExtent: cacheExtent, itemExtent: itemExtent, itemBuilder: itemBuilder, itemCount: itemCount, addAutomaticKeepAlives: addAutomaticKeepAlives, addRepaintBoundaries: addRepaintBoundaries, dragStartBehavior: dragStartBehavior, keyboardDismissBehavior: keyboardDismissBehavior )); }
public PopupMenuButton( Key key = null, PopupMenuItemBuilder <T> itemBuilder = null, T initialValue = default, PopupMenuItemSelected <T> onSelected = null, PopupMenuCanceled onCanceled = null, string tooltip = null, float?elevation = null, EdgeInsetsGeometry padding = null, Widget child = null, Icon icon = null, Offset offset = null, bool enabled = true, ShapeBorder shape = null, Color color = null, bool captureInheritedThemes = true ) : base(key: key) { offset = offset ?? Offset.zero; D.assert(itemBuilder != null); D.assert(offset != null); D.assert(!(child != null && icon != null), () => "You can only pass [child] or [icon], not both."); this.itemBuilder = itemBuilder; this.initialValue = initialValue; this.onSelected = onSelected; this.onCanceled = onCanceled; this.tooltip = tooltip; this.elevation = elevation; this.padding = padding ?? EdgeInsets.all(8.0f); this.child = child; this.icon = icon; this.offset = offset; this.enabled = enabled; this.shape = shape; this.color = color; this.captureInheritedThemes = captureInheritedThemes; }
public static Ink image( Key key = null, EdgeInsetsGeometry padding = null, ImageProvider image = null, ImageErrorListener onImageError = null, ColorFilter colorFilter = null, BoxFit?fit = null, AlignmentGeometry alignment = null, Rect centerSlice = null, ImageRepeat repeat = ImageRepeat.noRepeat, float?width = null, float?height = null, Widget child = null ) { D.assert(padding == null || padding.isNonNegative); D.assert(image != null); alignment = alignment ?? Alignment.center; Decoration decoration = new BoxDecoration( image: new DecorationImage( image: image, onError: onImageError, colorFilter: colorFilter, fit: fit, alignment: alignment, centerSlice: centerSlice, repeat: repeat) ); return(new Ink( key: key, padding: padding, decoration: decoration, width: width, height: height, child: child)); }
public UserAccountsDrawerHeader( Key key = null, Decoration decoration = null, EdgeInsetsGeometry margin = null, Widget currentAccountPicture = null, List <Widget> otherAccountsPictures = null, Widget accountName = null, Widget accountEmail = null, VoidCallback onDetailsPressed = null, Color arrowColor = null ) : base(key: key) { D.assert(accountName != null); D.assert(accountEmail != null); this.decoration = decoration; this.margin = margin ?? EdgeInsets.only(bottom: 8.0f); this.arrowColor = arrowColor ?? Colors.white; this.currentAccountPicture = currentAccountPicture; this.otherAccountsPictures = otherAccountsPictures; this.accountName = accountName; this.accountEmail = accountEmail; this.onDetailsPressed = onDetailsPressed; }
public CupertinoButton( Key key = null, Widget child = null, EdgeInsetsGeometry padding = null, Color color = null, Color disabledColor = null, float minSize = 44.0f, float pressedOpacity = 0.4f, BorderRadius borderRadius = null, VoidCallback onPressed = null ) : base(key: key) { D.assert((pressedOpacity >= 0.0 && pressedOpacity <= 1.0)); _filled = false; this.child = child; this.onPressed = onPressed; this.padding = padding; this.color = color; this.disabledColor = disabledColor ?? CupertinoColors.quaternarySystemFill; this.minSize = minSize; this.pressedOpacity = pressedOpacity; this.borderRadius = borderRadius ?? BorderRadius.all(Radius.circular(8.0f)); }
public MaterialBanner( Key key = null, Widget content = null, TextStyle contentTextStyle = null, List <Widget> actions = null, Widget leading = null, Color backgroundColor = null, EdgeInsetsGeometry padding = null, EdgeInsetsGeometry leadingPadding = null, bool forceActionsBelow = false ) : base(key: key) { D.assert(content != null); D.assert(actions != null); this.content = content; this.contentTextStyle = contentTextStyle; this.actions = actions; this.leading = leading; this.backgroundColor = backgroundColor; this.padding = padding; this.leadingPadding = leadingPadding; this.forceActionsBelow = forceActionsBelow; }
public AnimatedList( Key key = null, AnimatedListItemBuilder itemBuilder = null, int initialItemCount = 0, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController controller = null, bool?primary = null, ScrollPhysics physics = null, bool shrinkWrap = false, EdgeInsetsGeometry padding = null) : base(key: key) { D.assert(itemBuilder != null); D.assert(initialItemCount >= 0); this.itemBuilder = itemBuilder; this.initialItemCount = initialItemCount; this.scrollDirection = scrollDirection; this.reverse = reverse; this.controller = controller; this.primary = primary; this.physics = physics; this.shrinkWrap = shrinkWrap; this.padding = padding; }
public CupertinoSlidingSegmentedControl( Key key = null, Dictionary <T, Widget> children = null, ValueChanged <T> onValueChanged = null, T groupValue = default, Color thumbColor = null, EdgeInsetsGeometry padding = null, Color backgroundColor = null ) : base(key: key) { D.assert(children != null); D.assert(children.Count >= 2); D.assert(onValueChanged != null); D.assert( groupValue == null || children.Keys.Contains(groupValue), () => "The groupValue must be either null or one of the keys in the children map." ); this.children = children; this.onValueChanged = onValueChanged; this.groupValue = groupValue; this.thumbColor = thumbColor ?? CupertinoSlidingSegmentedControlsUtils._kThumbColor; this.padding = padding ?? CupertinoSlidingSegmentedControlsUtils._kHorizontalItemPadding; this.backgroundColor = backgroundColor ?? CupertinoColors.tertiarySystemFill; }
public TooltipThemeData( float?height = null, EdgeInsetsGeometry padding = null, EdgeInsetsGeometry margin = null, float?verticalOffset = null, bool?preferBelow = null, bool?excludeFromSemantics = null, Decoration decoration = null, TextStyle textStyle = null, TimeSpan?waitDuration = null, TimeSpan?showDuration = null ) { this.height = height; this.padding = padding; this.margin = margin; this.verticalOffset = verticalOffset; this.preferBelow = preferBelow; this.excludeFromSemantics = excludeFromSemantics; this.decoration = decoration; this.textStyle = textStyle; this.waitDuration = waitDuration; this.showDuration = showDuration; }
public ButtonBarThemeData( MainAxisAlignment?alignment = null, MainAxisSize?mainAxisSize = null, ButtonTextTheme?buttonTextTheme = null, float?buttonMinWidth = null, float?buttonHeight = null, EdgeInsetsGeometry buttonPadding = null, bool?buttonAlignedDropdown = null, ButtonBarLayoutBehavior?layoutBehavior = null, VerticalDirection?overflowDirection = null ) { D.assert(buttonMinWidth == null || buttonMinWidth >= 0.0f); D.assert(buttonHeight == null || buttonHeight >= 0.0f); this.alignment = alignment; this.mainAxisSize = mainAxisSize; this.buttonTextTheme = buttonTextTheme; this.buttonMinWidth = buttonMinWidth; this.buttonHeight = buttonHeight; this.buttonPadding = buttonPadding; this.buttonAlignedDropdown = buttonAlignedDropdown; this.layoutBehavior = layoutBehavior; this.overflowDirection = overflowDirection; }
public ButtonBarThemeData copyWith( MainAxisAlignment?alignment, MainAxisSize?mainAxisSize, ButtonTextTheme?buttonTextTheme, float?buttonMinWidth, float?buttonHeight, EdgeInsetsGeometry buttonPadding, bool?buttonAlignedDropdown, ButtonBarLayoutBehavior?layoutBehavior, VerticalDirection?overflowDirection ) { return(new ButtonBarThemeData( alignment: alignment ?? this.alignment, mainAxisSize: mainAxisSize ?? this.mainAxisSize, buttonTextTheme: buttonTextTheme ?? this.buttonTextTheme, buttonMinWidth: buttonMinWidth ?? this.buttonMinWidth, buttonHeight: buttonHeight ?? this.buttonHeight, buttonPadding: buttonPadding ?? this.buttonPadding, buttonAlignedDropdown: buttonAlignedDropdown ?? this.buttonAlignedDropdown, layoutBehavior: layoutBehavior ?? this.layoutBehavior, overflowDirection: overflowDirection ?? this.overflowDirection )); }
public ButtonThemeData( ButtonTextTheme textTheme = ButtonTextTheme.normal, float minWidth = 88.0f, float height = 36.0f, EdgeInsetsGeometry padding = null, ShapeBorder shape = null, ButtonBarLayoutBehavior layoutBehavior = ButtonBarLayoutBehavior.padded, bool alignedDropdown = false, Color buttonColor = null, Color disabledColor = null, Color focusColor = null, Color hoverColor = null, Color highlightColor = null, Color splashColor = null, ColorScheme colorScheme = null, MaterialTapTargetSize?materialTapTargetSize = null ) { D.assert(minWidth >= 0.0); D.assert(height >= 0.0); this.textTheme = textTheme; this.minWidth = minWidth; this.height = height; this.layoutBehavior = layoutBehavior; this.alignedDropdown = alignedDropdown; this.colorScheme = colorScheme; _buttonColor = buttonColor; _disabledColor = disabledColor; _focusColor = focusColor; _hoverColor = hoverColor; _highlightColor = highlightColor; _splashColor = splashColor; _padding = padding; _shape = shape; _materialTapTargetSize = materialTapTargetSize; }
public static ListView seperated( Key key = null, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController controller = null, bool?primary = null, ScrollPhysics physics = null, bool shrinkWrap = false, EdgeInsetsGeometry padding = null, IndexedWidgetBuilder itemBuilder = null, IndexedWidgetBuilder separatorBuilder = null, int itemCount = 0, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, float?cacheExtent = null, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual ) { return(new ListView( key, scrollDirection, reverse, controller, primary, physics, shrinkWrap, padding, itemBuilder, separatorBuilder, itemCount, addAutomaticKeepAlives, addRepaintBoundaries, cacheExtent, keyboardDismissBehavior: keyboardDismissBehavior )); }
public override Widget build(BuildContext context) { return(new LayoutBuilder( builder: (BuildContext _context, BoxConstraints constraints) => { FlexibleSpaceBarSettings settings = _context.dependOnInheritedWidgetOfExactType <FlexibleSpaceBarSettings>(); D.assert(settings != null, () => "A FlexibleSpaceBar must be wrapped in the widget returned by FlexibleSpaceBar.createSettings()."); List <Widget> children = new List <Widget>(); float deltaExtent = settings.maxExtent.Value - settings.minExtent.Value; float t = (1.0f - (settings.currentExtent.Value - settings.minExtent.Value) / deltaExtent) .clamp(0.0f, 1.0f); if (widget.background != null) { float fadeStart = Mathf.Max(0.0f, 1.0f - material_.kToolbarHeight / deltaExtent); float fadeEnd = 1.0f; D.assert(fadeStart <= fadeEnd); float opacity = 1.0f - new Interval(fadeStart, fadeEnd).transform(t); if (opacity > 0.0f) { float height = settings.maxExtent ?? 0; if (widget.stretchModes.Contains(StretchMode.zoomBackground) && constraints.maxHeight > height) { height = constraints.maxHeight; } children.Add(new Positioned( top: _getCollapsePadding(t, settings), left: 0.0f, right: 0.0f, height: height, child: new Opacity( opacity: opacity, child: widget.background) ) ); if (widget.stretchModes.Contains(StretchMode.blurBackground) && constraints.maxHeight > settings.maxExtent) { float blurAmount = (constraints.maxHeight - settings.maxExtent) / 10 ?? 0; children.Add(Positioned.fill( child: new BackdropFilter( child: new Container( color: Colors.transparent ), filter: ui.ImageFilter.blur( sigmaX: blurAmount, sigmaY: blurAmount ) ) )); } } } Widget title = null; if (widget.title != null) { switch (Application.platform) { case RuntimePlatform.IPhonePlayer: title = widget.title; break; default: title = widget.title; break; } } if (widget.stretchModes.Contains(StretchMode.fadeTitle) && constraints.maxHeight > settings.maxExtent) { float stretchOpacity = 1 - (((constraints.maxHeight - settings.maxExtent) / 100)?.clamp(0.0f, 1.0f) ?? 0); title = new Opacity( opacity: stretchOpacity, child: title ); } ThemeData theme = Theme.of(_context); float toolbarOpacity = settings.toolbarOpacity.Value; if (toolbarOpacity > 0.0f) { TextStyle titleStyle = theme.primaryTextTheme.title; titleStyle = titleStyle.copyWith( color: titleStyle.color.withOpacity(toolbarOpacity)); bool effectiveCenterTitle = _getEffectiveCenterTitle(theme).Value; EdgeInsetsGeometry padding = widget.titlePadding ?? EdgeInsets.only( left: effectiveCenterTitle ? 0.0f : 72.0f, bottom: 16.0f ); float scaleValue = new FloatTween(begin: 1.5f, end: 1.0f).lerp(t); Matrix4 scaleTransform = Matrix4.diagonal3Values(scaleValue, scaleValue, 1); Alignment titleAlignment = _getTitleAlignment(effectiveCenterTitle); children.Add(new Container( padding: padding, child: new Transform( alignment: titleAlignment, transform: scaleTransform, child: new Align( alignment: titleAlignment, child: new DefaultTextStyle( style: titleStyle, child: new LayoutBuilder( builder: (BuildContext __context, BoxConstraints _constraints) => { return new Container( width: _constraints.maxWidth / scaleValue, alignment: titleAlignment, child: title ); } ) ) ) ) ) ); } return new ClipRect( child: new Stack( children: children) ); } )); }