Ejemplo n.º 1
0
        public static ColorScheme fromSwatch(
            MaterialColor primarySwatch = null,
            Color primaryColorDark      = null,
            Color accentColor           = null,
            Color cardColor             = null,
            Color backgroundColor       = null,
            Color errorColor            = null,
            Brightness?brightness       = Brightness.light)
        {
            D.assert(brightness != null);
            primarySwatch = primarySwatch ?? Colors.blue;

            bool  isDark          = brightness == Brightness.dark;
            bool  primaryIsDark   = _brightnessFor(primarySwatch) == Brightness.dark;
            Color secondary       = accentColor ?? (isDark ? Colors.tealAccent[200] : primarySwatch);
            bool  secondaryIsDark = _brightnessFor(secondary) == Brightness.dark;

            return(new ColorScheme(
                       primary: primarySwatch,
                       primaryVariant: primaryColorDark ?? (isDark ? Colors.black : primarySwatch[700]),
                       secondary: secondary,
                       secondaryVariant: isDark ? Colors.tealAccent[700] : primarySwatch[700],
                       surface: cardColor ?? (isDark ? Colors.grey[800] : Colors.white),
                       background: backgroundColor ?? (isDark ? Colors.grey[700] : primarySwatch[200]),
                       error: errorColor ?? Colors.red[700],
                       onPrimary: primaryIsDark ? Colors.white : Colors.black,
                       onSecondary: secondaryIsDark ? Colors.white : Colors.black,
                       onSurface: isDark ? Colors.white : Colors.black,
                       onBackground: primaryIsDark ? Colors.white : Colors.black,
                       onError: isDark ? Colors.black : Colors.white,
                       brightness: brightness ?? Brightness.light
                       ));
        }
Ejemplo n.º 2
0
 public ColorScheme copyWith(
     Color primary          = null,
     Color primaryVariant   = null,
     Color secondary        = null,
     Color secondaryVariant = null,
     Color surface          = null,
     Color background       = null,
     Color error            = null,
     Color onPrimary        = null,
     Color onSecondary      = null,
     Color onSurface        = null,
     Color onBackground     = null,
     Color onError          = null,
     Brightness?brightness  = null)
 {
     return(new ColorScheme(
                primary: primary ?? this.primary,
                primaryVariant: primaryVariant ?? this.primaryVariant,
                secondary: secondary ?? this.secondary,
                secondaryVariant: secondaryVariant ?? this.secondaryVariant,
                surface: surface ?? this.surface,
                background: background ?? this.background,
                error: error ?? this.error,
                onPrimary: onPrimary ?? this.onPrimary,
                onSecondary: onSecondary ?? this.onSecondary,
                onSurface: onSurface ?? this.onSurface,
                onBackground: onBackground ?? this.onBackground,
                onError: onError ?? this.onError,
                brightness: brightness ?? this.brightness
                ));
 }
Ejemplo n.º 3
0
 public FlatButton(
     Key key = null,
     VoidCallback onPressed = null,
     ValueChanged <bool> onHighlightChanged = null,
     ButtonTextTheme?textTheme = null,
     Color textColor           = null,
     Color disabledTextColor   = null,
     Color color                = null,
     Color disabledColor        = null,
     Color highlightColor       = null,
     Color splashColor          = null,
     Brightness?colorBrightness = null,
     EdgeInsets padding         = null,
     ShapeBorder shape          = null,
     Clip?clipBehavior          = Clip.none,
     MaterialTapTargetSize?materialTapTargetSize = null,
     Widget child = null) : base(
         key: key,
         onPressed: onPressed,
         onHighlightChanged: onHighlightChanged,
         textTheme: textTheme,
         textColor: textColor,
         disabledTextColor: disabledTextColor,
         color: color,
         disabledColor: disabledColor,
         highlightColor: highlightColor,
         splashColor: splashColor,
         colorBrightness: colorBrightness,
         padding: padding,
         shape: shape,
         clipBehavior: clipBehavior,
         materialTapTargetSize: materialTapTargetSize,
         child: child)
 {
 }
Ejemplo n.º 4
0
 public ChipThemeData copyWith(
     Color backgroundColor         = null,
     Color deleteIconColor         = null,
     Color disabledColor           = null,
     Color selectedColor           = null,
     Color secondarySelectedColor  = null,
     EdgeInsets labelPadding       = null,
     EdgeInsets 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,
                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
                ));
 }
Ejemplo n.º 5
0
 public MediaQueryData copyWith(
     Size size = null,
     float?devicePixelRatio        = null,
     float?textScaleFactor         = null,
     Brightness?platformBrightness = null,
     EdgeInsets viewInsets         = null,
     EdgeInsets padding            = null,
     bool?alwaysUse24HourFormat    = null,
     bool?accessibleNavigation     = null,
     bool?invertColors             = null,
     bool?disableAnimations        = null,
     bool?boldText = null
     )
 {
     return(new MediaQueryData(
                size: size ?? this.size,
                devicePixelRatio: devicePixelRatio ?? this.devicePixelRatio,
                textScaleFactor: textScaleFactor ?? this.textScaleFactor,
                platformBrightness: platformBrightness ?? this.platformBrightness,
                viewInsets: viewInsets ?? this.viewInsets,
                padding: padding ?? this.padding,
                alwaysUse24HourFormat: alwaysUse24HourFormat ?? this.alwaysUse24HourFormat,
                accessibleNavigation: accessibleNavigation ?? this.accessibleNavigation,
                invertColors: invertColors ?? this.invertColors,
                disableAnimations: disableAnimations ?? this.disableAnimations,
                boldText: boldText ?? this.boldText
                ));
 }
Ejemplo n.º 6
0
 public _RaisedButtonWithIcon(
     Key key = null,
     VoidCallback onPressed = null,
     ValueChanged <bool> onHighlightChanged = null,
     ButtonTextTheme?textTheme = null,
     Color textColor           = null,
     Color disabledTextColor   = null,
     Color color                = null,
     Color disabledColor        = null,
     Color highlightColor       = null,
     Color splashColor          = null,
     Brightness?colorBrightness = null,
     double?elevation           = null,
     double?highlightElevation  = null,
     double?disabledElevation   = null,
     EdgeInsets padding         = null,
     ShapeBorder shape          = null,
     Clip?clipBehavior          = Clip.none,
     MaterialTapTargetSize?materialTapTargetSize = null,
     TimeSpan?animationDuration = null,
     Widget icon  = null,
     Widget label = null
     ) : base(
         key: key,
         onPressed: onPressed,
         onHighlightChanged: onHighlightChanged,
         textTheme: textTheme,
         textColor: textColor,
         disabledTextColor: disabledTextColor,
         color: color,
         disabledColor: disabledColor,
         highlightColor: highlightColor,
         splashColor: splashColor,
         colorBrightness: colorBrightness,
         elevation: elevation,
         highlightElevation: highlightElevation,
         disabledElevation: disabledElevation,
         padding: padding,
         shape: shape,
         clipBehavior: clipBehavior,
         materialTapTargetSize: materialTapTargetSize,
         animationDuration: animationDuration,
         child: new Row(
             mainAxisSize: MainAxisSize.min,
             children: new List <Widget> {
     icon,
     new SizedBox(width: 8.0),
     label
 }
             ))
 {
     D.assert(elevation == null || elevation >= 0.0);
     D.assert(highlightElevation == null || highlightElevation >= 0.0);
     D.assert(disabledElevation == null || disabledElevation >= 0.0);
     D.assert(icon != null);
     D.assert(label != null);
 }
Ejemplo n.º 7
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.º 8
0
 public _FlatButtonWithIcon(
     Key key = null,
     VoidCallback onPressed = null,
     ValueChanged <bool> onHighlightChanged = null,
     VoidCallback onLongPress  = null,
     ButtonTextTheme?textTheme = null,
     Color textColor           = null,
     Color disabledTextColor   = null,
     Color color                = null,
     Color disabledColor        = null,
     Color focusColor           = null,
     Color hoverColor           = null,
     Color highlightColor       = null,
     Color splashColor          = null,
     Brightness?colorBrightness = null,
     EdgeInsetsGeometry padding = null,
     ShapeBorder shape          = null,
     Clip clipBehavior          = Clip.none,
     FocusNode focusNode        = null,
     bool autofocus             = false,
     MaterialTapTargetSize?materialTapTargetSize = null,
     Widget icon  = null,
     Widget label = null) : base(
         key: key,
         onPressed: onPressed,
         onLongPress: onLongPress,
         onHighlightChanged: onHighlightChanged,
         textTheme: textTheme,
         textColor: textColor,
         disabledTextColor: disabledTextColor,
         color: color,
         disabledColor: disabledColor,
         focusColor: focusColor,
         hoverColor: hoverColor,
         highlightColor: highlightColor,
         splashColor: splashColor,
         colorBrightness: colorBrightness,
         padding: padding,
         shape: shape,
         clipBehavior: clipBehavior,
         focusNode: focusNode,
         autofocus: autofocus,
         materialTapTargetSize: materialTapTargetSize,
         child: new Row(
             mainAxisSize: MainAxisSize.min,
             children: new List <Widget> {
     icon,
     new SizedBox(width: 8.0f),
     label
 }
             ))
 {
     D.assert(icon != null);
     D.assert(label != null);
 }
Ejemplo n.º 9
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.º 10
0
        public static ChipThemeData fromDefaults(
            Brightness?brightness = null,
            Color primaryColor    = null,
            Color secondaryColor  = null,
            TextStyle labelStyle  = null
            )
        {
            D.assert(primaryColor != null || brightness != null,
                     "One of primaryColor or brightness must be specified");
            D.assert(primaryColor == null || brightness == null,
                     "Only one of primaryColor or brightness may be specified");
            D.assert(secondaryColor != null);
            D.assert(labelStyle != null);

            if (primaryColor != null)
            {
                brightness = ThemeData.estimateBrightnessForColor(primaryColor);
            }

            const int   backgroundAlpha = 0x1f; // 12%
            const int   deleteIconAlpha = 0xde; // 87%
            const int   disabledAlpha   = 0x0c; // 38% * 12% = 5%
            const int   selectAlpha     = 0x3d; // 12% + 12% = 24%
            const int   textLabelAlpha  = 0xde; // 87%
            ShapeBorder shape           = new StadiumBorder();
            EdgeInsets  labelPadding    = EdgeInsets.symmetric(horizontal: 8.0f);
            EdgeInsets  padding         = EdgeInsets.all(4.0f);

            primaryColor = primaryColor ?? (brightness == Brightness.light ? Colors.black : Colors.white);
            Color     backgroundColor        = primaryColor.withAlpha(backgroundAlpha);
            Color     deleteIconColor        = primaryColor.withAlpha(deleteIconAlpha);
            Color     disabledColor          = primaryColor.withAlpha(disabledAlpha);
            Color     selectedColor          = primaryColor.withAlpha(selectAlpha);
            Color     secondarySelectedColor = secondaryColor.withAlpha(selectAlpha);
            TextStyle secondaryLabelStyle    = labelStyle.copyWith(
                color: secondaryColor.withAlpha(textLabelAlpha)
                );

            labelStyle = labelStyle.copyWith(color: primaryColor.withAlpha(textLabelAlpha));

            return(new ChipThemeData(
                       backgroundColor: backgroundColor,
                       deleteIconColor: deleteIconColor,
                       disabledColor: disabledColor,
                       selectedColor: selectedColor,
                       secondarySelectedColor: secondarySelectedColor,
                       labelPadding: labelPadding,
                       padding: padding,
                       shape: shape,
                       labelStyle: labelStyle,
                       secondaryLabelStyle: secondaryLabelStyle,
                       brightness: brightness
                       ));
        }
Ejemplo n.º 11
0
        public static FlatButton icon(
            Key key = null,
            VoidCallback onPressed = null,
            ValueChanged <bool> onHighlightChanged = null,
            VoidCallback onLongPress  = null,
            ButtonTextTheme?textTheme = null,
            Color textColor           = null,
            Color disabledTextColor   = null,
            Color color                = null,
            Color disabledColor        = null,
            Color focusColor           = null,
            Color hoverColor           = null,
            Color highlightColor       = null,
            Color splashColor          = null,
            Brightness?colorBrightness = null,
            EdgeInsetsGeometry padding = null,
            ShapeBorder shape          = null,
            Clip clipBehavior          = Clip.none,
            FocusNode focusNode        = null,
            bool autofocus             = false,
            MaterialTapTargetSize?materialTapTargetSize = null,
            Widget icon  = null,
            Widget label = null)
        {
            D.assert(icon != null);
            D.assert(label != null);

            return(new _FlatButtonWithIcon(
                       key: key,
                       onPressed: onPressed,
                       onLongPress: onLongPress,
                       onHighlightChanged: onHighlightChanged,
                       textTheme: textTheme,
                       textColor: textColor,
                       disabledTextColor: disabledTextColor,
                       color: color,
                       disabledColor: disabledColor,
                       focusColor: focusColor,
                       hoverColor: hoverColor,
                       highlightColor: highlightColor,
                       splashColor: splashColor,
                       colorBrightness: colorBrightness,
                       padding: padding,
                       shape: shape,
                       clipBehavior: clipBehavior,
                       focusNode: focusNode,
                       autofocus: autofocus,
                       materialTapTargetSize: materialTapTargetSize,
                       icon: icon,
                       label: label
                       ));
        }
Ejemplo n.º 12
0
        public TextField(Key key = null, TextEditingController controller                = null, FocusNode focusNode         = null,
                         InputDecoration decoration            = null, bool noDecoration = false, TextInputType keyboardType = null,
                         TextInputAction?textInputAction       = null,
                         TextCapitalization textCapitalization = TextCapitalization.none, TextStyle style = null,
                         TextAlign textAlign               = TextAlign.left, TextDirection textDirection = TextDirection.ltr,
                         bool autofocus                    = false, bool obscureText      = false, bool autocorrect = false, int?maxLines = 1,
                         int?maxLength                     = null, bool maxLengthEnforced = true, ValueChanged <string> onChanged = null,
                         VoidCallback onEditingComplete    = null,
                         ValueChanged <string> onSubmitted = null, List <TextInputFormatter> inputFormatters = null,
                         bool?enabled = null, float?cursorWidth = 2.0f, Radius cursorRadius = null, Color cursorColor = null,
                         Brightness?keyboardAppearance          = null, EdgeInsets scrollPadding = null,
                         DragStartBehavior dragStartBehavior    = DragStartBehavior.down,
                         bool?enableInteractiveSelection        = null,
                         GestureTapCallback onTap               = null,
                         InputCounterWidgetBuilder buildCounter = null
                         ) : base(key: key)
        {
            D.assert(maxLines == null || maxLines > 0);
            D.assert(maxLength == null || maxLength == TextField.noMaxLength || maxLength > 0);

            this.controller         = controller;
            this.focusNode          = focusNode;
            this.decoration         = noDecoration ? null : (decoration ?? new InputDecoration());
            this.textInputAction    = textInputAction;
            this.textCapitalization = textCapitalization;
            this.style                      = style;
            this.textAlign                  = textAlign;
            this.textDirection              = textDirection;
            this.autofocus                  = autofocus;
            this.obscureText                = obscureText;
            this.autocorrect                = autocorrect;
            this.maxLines                   = maxLines;
            this.maxLength                  = maxLength;
            this.maxLengthEnforced          = maxLengthEnforced;
            this.onChanged                  = onChanged;
            this.onEditingComplete          = onEditingComplete;
            this.onSubmitted                = onSubmitted;
            this.inputFormatters            = inputFormatters;
            this.enabled                    = enabled;
            this.cursorWidth                = cursorWidth;
            this.cursorColor                = cursorColor;
            this.cursorRadius               = cursorRadius;
            this.onSubmitted                = onSubmitted;
            this.keyboardAppearance         = keyboardAppearance;
            this.enableInteractiveSelection = enableInteractiveSelection;
            this.onTap                      = onTap;
            this.keyboardType               = keyboardType ?? (maxLines == 1 ? TextInputType.text : TextInputType.multiline);
            this.scrollPadding              = scrollPadding ?? EdgeInsets.all(20.0f);
            this.dragStartBehavior          = dragStartBehavior;
            this.buildCounter               = buildCounter;
        }
Ejemplo n.º 13
0
 public _OutlineButton(
     Key key = null,
     VoidCallback onPressed    = null,
     VoidCallback onLongPress  = null,
     Brightness?brightness     = null,
     ButtonTextTheme?textTheme = null,
     Color textColor           = null,
     Color disabledTextColor   = null,
     Color color                  = null,
     Color focusColor             = null,
     Color hoverColor             = null,
     Color highlightColor         = null,
     Color splashColor            = null,
     float?highlightElevation     = null,
     BorderSide borderSide        = null,
     Color disabledBorderColor    = null,
     Color highlightedBorderColor = null,
     EdgeInsetsGeometry padding   = null,
     VisualDensity visualDensity  = null,
     ShapeBorder shape            = null,
     Clip?clipBehavior            = Clip.none,
     FocusNode focusNode          = null,
     bool autofocus               = false,
     Widget child                 = null
     ) : base(key: key)
 {
     D.assert(highlightElevation != null && highlightElevation >= 0.0f);
     D.assert(highlightedBorderColor != null);
     this.onPressed              = onPressed;
     this.onLongPress            = onLongPress;
     this.brightness             = brightness;
     this.textTheme              = textTheme;
     this.textColor              = textColor;
     this.disabledTextColor      = disabledTextColor;
     this.color                  = color;
     this.focusColor             = focusColor;
     this.hoverColor             = hoverColor;
     this.highlightColor         = highlightColor;
     this.splashColor            = splashColor;
     this.highlightElevation     = highlightElevation;
     this.borderSide             = borderSide;
     this.disabledBorderColor    = disabledBorderColor;
     this.highlightedBorderColor = highlightedBorderColor;
     this.padding                = padding;
     this.visualDensity          = visualDensity;
     this.shape                  = shape;
     this.clipBehavior           = clipBehavior;
     this.focusNode              = focusNode;
     this.autofocus              = autofocus;
     this.child                  = child;
 }
Ejemplo n.º 14
0
 public AppBarTheme(
     Brightness?brightness   = null,
     Color color             = null,
     float?elevation         = null,
     IconThemeData iconTheme = null,
     TextTheme textTheme     = null
     )
 {
     this.brightness = brightness;
     this.color      = color;
     this.elevation  = elevation;
     this.iconTheme  = iconTheme;
     this.textTheme  = textTheme;
 }
Ejemplo n.º 15
0
        public static RaisedButton icon(
            Key key = null,
            VoidCallback onPressed = null,
            ValueChanged <bool> onHighlightChanged = null,
            ButtonTextTheme?textTheme = null,
            Color textColor           = null,
            Color disabledTextColor   = null,
            Color color                = null,
            Color disabledColor        = null,
            Color highlightColor       = null,
            Color splashColor          = null,
            Brightness?colorBrightness = null,
            double?elevation           = null,
            double?highlightElevation  = null,
            double?disabledElevation   = null,
            EdgeInsets padding         = null,
            ShapeBorder shape          = null,
            Clip?clipBehavior          = null,
            MaterialTapTargetSize?materialTapTargetSize = null,
            TimeSpan?animationDuration = null,
            Widget icon  = null,
            Widget label = null)
        {
            D.assert(icon != null);
            D.assert(label != null);

            return(new _RaisedButtonWithIcon(
                       key: key,
                       onPressed: onPressed,
                       onHighlightChanged: onHighlightChanged,
                       textTheme: textTheme,
                       textColor: textColor,
                       disabledTextColor: disabledTextColor,
                       color: color,
                       disabledColor: disabledColor,
                       highlightColor: highlightColor,
                       splashColor: splashColor,
                       colorBrightness: colorBrightness,
                       elevation: elevation,
                       highlightElevation: highlightElevation,
                       disabledElevation: disabledElevation,
                       padding: padding,
                       shape: shape,
                       clipBehavior: clipBehavior,
                       materialTapTargetSize: materialTapTargetSize,
                       animationDuration: animationDuration,
                       icon: icon,
                       label: label));
        }
Ejemplo n.º 16
0
 public ChipThemeData(
     Color backgroundColor           = null,
     Color deleteIconColor           = null,
     Color disabledColor             = null,
     Color selectedColor             = null,
     Color secondarySelectedColor    = null,
     Color shadowColor               = null,
     Color selectedShadowColor       = null,
     bool?showCheckmark              = 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
     )
 {
     D.assert(backgroundColor != null);
     D.assert(disabledColor != null);
     D.assert(selectedColor != null);
     D.assert(secondarySelectedColor != null);
     D.assert(labelPadding != null);
     D.assert(padding != null);
     D.assert(shape != null);
     D.assert(labelStyle != null);
     D.assert(secondaryLabelStyle != null);
     D.assert(brightness != null);
     this.backgroundColor        = backgroundColor;
     this.deleteIconColor        = deleteIconColor;
     this.disabledColor          = disabledColor;
     this.selectedColor          = selectedColor;
     this.secondarySelectedColor = secondarySelectedColor;
     this.shadowColor            = shadowColor;
     this.selectedShadowColor    = selectedShadowColor;
     this.showCheckmark          = showCheckmark;
     this.checkmarkColor         = checkmarkColor;
     this.labelPadding           = labelPadding;
     this.padding             = padding;
     this.shape               = shape;
     this.labelStyle          = labelStyle;
     this.secondaryLabelStyle = secondaryLabelStyle;
     this.brightness          = brightness;
     this.elevation           = elevation;
     this.pressElevation      = pressElevation;
 }
Ejemplo n.º 17
0
 public SystemUiOverlayStyle(
     Color systemNavigationBarColor               = null,
     Color systemNavigationBarDividerColor        = null,
     Brightness?systemNavigationBarIconBrightness = null,
     Color statusBarColor               = null,
     Brightness?statusBarBrightness     = null,
     Brightness?statusBarIconBrightness = null
     )
 {
     this.systemNavigationBarColor          = systemNavigationBarColor;
     this.systemNavigationBarDividerColor   = systemNavigationBarDividerColor;
     this.systemNavigationBarIconBrightness = systemNavigationBarIconBrightness;
     this.statusBarColor          = statusBarColor;
     this.statusBarBrightness     = statusBarBrightness;
     this.statusBarIconBrightness = statusBarIconBrightness;
 }
Ejemplo n.º 18
0
 public _NoDefaultCupertinoThemeData(
     Brightness?brightness,
     Color primaryColor,
     Color primaryContrastingColor,
     CupertinoTextThemeData textTheme,
     Color barBackgroundColor,
     Color scaffoldBackgroundColor
     )
 {
     this.brightness              = brightness;
     this.primaryColor            = primaryColor;
     this.primaryContrastingColor = primaryContrastingColor;
     this.textTheme               = textTheme;
     this.barBackgroundColor      = barBackgroundColor;
     this.scaffoldBackgroundColor = scaffoldBackgroundColor;
 }
Ejemplo n.º 19
0
 AppBarTheme copyWith(
     Brightness?brightness   = null,
     Color color             = null,
     float?elevation         = null,
     IconThemeData iconTheme = null,
     TextTheme textTheme     = null
     )
 {
     return(new AppBarTheme(
                brightness: brightness ?? this.brightness,
                color: color ?? this.color,
                elevation: elevation ?? this.elevation,
                iconTheme: iconTheme ?? this.iconTheme,
                textTheme: textTheme ?? this.textTheme
                ));
 }
Ejemplo n.º 20
0
 public CupertinoThemeData(
     Brightness?brightness            = null,
     Color primaryColor               = null,
     Color primaryContrastingColor    = null,
     CupertinoTextThemeData textTheme = null,
     Color barBackgroundColor         = null,
     Color scaffoldBackgroundColor    = null
     )
 {
     this._brightness              = brightness;
     this._primaryColor            = primaryColor;
     this._primaryContrastingColor = primaryContrastingColor;
     this._textTheme               = textTheme;
     this._barBackgroundColor      = barBackgroundColor;
     this._scaffoldBackgroundColor = scaffoldBackgroundColor;
 }
Ejemplo n.º 21
0
 public _CupertinoThemeDefaults(
     Brightness?brightness,
     Color primaryColor,
     Color primaryContrastingColor,
     Color barBackgroundColor,
     Color scaffoldBackgroundColor,
     _CupertinoTextThemeDefaults textThemeDefaults
     )
 {
     this.brightness              = brightness;
     this.primaryColor            = primaryColor;
     this.primaryContrastingColor = primaryContrastingColor;
     this.barBackgroundColor      = barBackgroundColor;
     this.scaffoldBackgroundColor = scaffoldBackgroundColor;
     this.textThemeDefaults       = textThemeDefaults;
 }
Ejemplo n.º 22
0
 public MaterialButton(
     Key key = null,
     VoidCallback onPressed = null,
     ValueChanged <bool> onHighlightChanged = null,
     ButtonTextTheme?textTheme = null,
     Color textColor           = null,
     Color disabledTextColor   = null,
     Color color                = null,
     Color disabledColor        = null,
     Color highlightColor       = null,
     Color splashColor          = null,
     Brightness?colorBrightness = null,
     double?elevation           = null,
     double?highlightElevation  = null,
     double?disabledElevation   = null,
     EdgeInsets padding         = null,
     ShapeBorder shape          = null,
     Clip?clipBehavior          = Clip.none,
     MaterialTapTargetSize?materialTapTargetSize = null,
     TimeSpan?animationDuration = null,
     double?minWidth            = null,
     double?height = null,
     Widget child  = null
     ) : base(key: key)
 {
     this.onPressed          = onPressed;
     this.onHighlightChanged = onHighlightChanged;
     this.textTheme          = textTheme;
     this.textColor          = textColor;
     this.disabledTextColor  = disabledTextColor;
     this.color                 = color;
     this.disabledColor         = disabledColor;
     this.highlightColor        = highlightColor;
     this.splashColor           = splashColor;
     this.colorBrightness       = colorBrightness;
     this.elevation             = elevation;
     this.highlightElevation    = highlightElevation;
     this.disabledElevation     = disabledElevation;
     this.padding               = padding;
     this.shape                 = shape;
     this.clipBehavior          = clipBehavior;
     this.materialTapTargetSize = materialTapTargetSize;
     this.animationDuration     = animationDuration;
     this.minWidth              = minWidth;
     this.height                = height;
     this.child                 = child;
 }
Ejemplo n.º 23
0
 public FlatButton(
     Key key = null,
     VoidCallback onPressed = null,
     ValueChanged <bool> onHighlightChanged = null,
     VoidCallback onLongPress  = null,
     ButtonTextTheme?textTheme = null,
     Color textColor           = null,
     Color disabledTextColor   = null,
     Color color                 = null,
     Color disabledColor         = null,
     Color focusColor            = null,
     Color hoverColor            = null,
     Color highlightColor        = null,
     Color splashColor           = null,
     Brightness?colorBrightness  = null,
     EdgeInsetsGeometry padding  = null,
     VisualDensity visualDensity = null,
     ShapeBorder shape           = null,
     Clip clipBehavior           = Clip.none,
     FocusNode focusNode         = null,
     bool autofocus              = false,
     MaterialTapTargetSize?materialTapTargetSize = null,
     Widget child = null) : base(
         key: key,
         onPressed: onPressed,
         onLongPress: onLongPress,
         onHighlightChanged: onHighlightChanged,
         textTheme: textTheme,
         textColor: textColor,
         disabledTextColor: disabledTextColor,
         focusColor: focusColor,
         hoverColor: hoverColor,
         color: color,
         disabledColor: disabledColor,
         highlightColor: highlightColor,
         splashColor: splashColor,
         colorBrightness: colorBrightness,
         padding: padding,
         visualDensity: visualDensity,
         shape: shape,
         clipBehavior: clipBehavior,
         focusNode: focusNode,
         autofocus: autofocus,
         materialTapTargetSize: materialTapTargetSize,
         child: child)
 {
 }
Ejemplo n.º 24
0
 public RaisedButton(
     Key key = null,
     VoidCallback onPressed = null,
     ValueChanged <bool> onHighlightChanged = null,
     ButtonTextTheme?textTheme = null,
     Color textColor           = null,
     Color disabledTextColor   = null,
     Color color                = null,
     Color disabledColor        = null,
     Color highlightColor       = null,
     Color splashColor          = null,
     Brightness?colorBrightness = null,
     double?elevation           = null,
     double?highlightElevation  = null,
     double?disabledElevation   = null,
     EdgeInsets padding         = null,
     ShapeBorder shape          = null,
     Clip?clipBehavior          = Clip.none,
     MaterialTapTargetSize?materialTapTargetSize = null,
     TimeSpan?animationDuration = null,
     Widget child = null
     ) : base(
         key: key,
         onPressed: onPressed,
         onHighlightChanged: onHighlightChanged,
         textTheme: textTheme,
         textColor: textColor,
         disabledTextColor: disabledTextColor,
         color: color,
         disabledColor: disabledColor,
         highlightColor: highlightColor,
         splashColor: splashColor,
         colorBrightness: colorBrightness,
         elevation: elevation,
         highlightElevation: highlightElevation,
         disabledElevation: disabledElevation,
         padding: padding,
         shape: shape,
         clipBehavior: clipBehavior,
         materialTapTargetSize: materialTapTargetSize,
         animationDuration: animationDuration,
         child: child)
 {
     D.assert(elevation == null || elevation >= 0.0);
     D.assert(highlightElevation == null || highlightElevation >= 0.0);
     D.assert(disabledElevation == null || disabledElevation >= 0.0);
 }
Ejemplo n.º 25
0
 public new CupertinoThemeData copyWith(
     Brightness?brightness            = null,
     Color primaryColor               = null,
     Color primaryContrastingColor    = null,
     CupertinoTextThemeData textTheme = null,
     Color barBackgroundColor         = null,
     Color scaffoldBackgroundColor    = null
     )
 {
     return(new _NoDefaultCupertinoThemeData(
                brightness ?? this.brightness,
                primaryColor ?? this.primaryColor,
                primaryContrastingColor ?? this.primaryContrastingColor,
                textTheme ?? this.textTheme,
                barBackgroundColor ?? this.barBackgroundColor,
                scaffoldBackgroundColor ?? this.scaffoldBackgroundColor
                ));
 }
Ejemplo n.º 26
0
 public CupertinoThemeData copyWith(
     Brightness?brightness            = null,
     Color primaryColor               = null,
     Color primaryContrastingColor    = null,
     CupertinoTextThemeData textTheme = null,
     Color barBackgroundColor         = null,
     Color scaffoldBackgroundColor    = null
     )
 {
     return(new CupertinoThemeData(
                brightness: brightness ?? this._brightness,
                primaryColor: primaryColor ?? this._primaryColor,
                primaryContrastingColor: primaryContrastingColor ?? this._primaryContrastingColor,
                textTheme: textTheme ?? this._textTheme,
                barBackgroundColor: barBackgroundColor ?? this._barBackgroundColor,
                scaffoldBackgroundColor: scaffoldBackgroundColor ?? this._scaffoldBackgroundColor
                ));
 }
Ejemplo n.º 27
0
 public CupertinoThemeData(
     Brightness?brightness            = null,
     Color primaryColor               = null,
     Color primaryContrastingColor    = null,
     CupertinoTextThemeData textTheme = null,
     Color barBackgroundColor         = null,
     Color scaffoldBackgroundColor    = null,
     _CupertinoThemeDefaults defaults = null
     )
 {
     this.brightness          = brightness;// ?? Brightness.light;
     _primaryColor            = primaryColor;
     _primaryContrastingColor = primaryContrastingColor;
     _textTheme               = textTheme;
     _barBackgroundColor      = barBackgroundColor;
     _scaffoldBackgroundColor = scaffoldBackgroundColor;
     _defaults = defaults ?? CupertinoThemeDataUtils._kDefaultTheme;
 }
Ejemplo n.º 28
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));
 }
Ejemplo n.º 29
0
 public CupertinoTextThemeData(
     Color primaryColor               = null,
     Brightness?brightness            = null,
     TextStyle textStyle              = null,
     TextStyle actionTextStyle        = null,
     TextStyle tabLabelTextStyle      = null,
     TextStyle navTitleTextStyle      = null,
     TextStyle navLargeTitleTextStyle = null,
     TextStyle navActionTextStyle     = null
     )
 {
     this._primaryColor           = primaryColor ?? CupertinoColors.activeBlue;
     this._brightness             = brightness;
     this._textStyle              = textStyle;
     this._actionTextStyle        = actionTextStyle;
     this._tabLabelTextStyle      = tabLabelTextStyle;
     this._navTitleTextStyle      = navTitleTextStyle;
     this._navLargeTitleTextStyle = navLargeTitleTextStyle;
     this._navActionTextStyle     = navActionTextStyle;
 }
Ejemplo n.º 30
0
 public CupertinoThemeData copyWith(
     Brightness?brightness            = null,
     Color primaryColor               = null,
     Color primaryContrastingColor    = null,
     CupertinoTextThemeData textTheme = null,
     Color barBackgroundColor         = null,
     Color scaffoldBackgroundColor    = null
     )
 {
     //return new CupertinoThemeData(
     return(_rawWithDefaults(
                brightness: brightness ?? this.brightness,
                primaryColor: primaryColor ?? _primaryColor,
                primaryContrastingColor: primaryContrastingColor ?? _primaryContrastingColor,
                textTheme: textTheme ?? _textTheme,
                barBackgroundColor: barBackgroundColor ?? _barBackgroundColor,
                scaffoldBackgroundColor: scaffoldBackgroundColor ?? _scaffoldBackgroundColor,
                _defaults
                ));
 }