Exemplo n.º 1
0
        public override void debugFillProperties(DiagnosticPropertiesBuilder properties)
        {
            base.debugFillProperties(properties);
            ThemeData     defaultTheme = ThemeData.fallback();
            ChipThemeData defaultData  = fromDefaults(
                secondaryColor: defaultTheme.primaryColor,
                brightness: defaultTheme.brightness,
                labelStyle: defaultTheme.textTheme.body2
                );

            properties.add(new DiagnosticsProperty <Color>("backgroundColor", this.backgroundColor,
                                                           defaultValue: defaultData.backgroundColor));
            properties.add(new DiagnosticsProperty <Color>("deleteIconColor", this.deleteIconColor,
                                                           defaultValue: defaultData.deleteIconColor));
            properties.add(new DiagnosticsProperty <Color>("disabledColor", this.disabledColor,
                                                           defaultValue: defaultData.disabledColor));
            properties.add(new DiagnosticsProperty <Color>("selectedColor", this.selectedColor,
                                                           defaultValue: defaultData.selectedColor));
            properties.add(new DiagnosticsProperty <Color>("secondarySelectedColor", this.secondarySelectedColor,
                                                           defaultValue: defaultData.secondarySelectedColor));
            properties.add(new DiagnosticsProperty <EdgeInsets>("labelPadding", this.labelPadding,
                                                                defaultValue: defaultData.labelPadding));
            properties.add(
                new DiagnosticsProperty <EdgeInsets>("padding", this.padding, defaultValue: defaultData.padding));
            properties.add(new DiagnosticsProperty <ShapeBorder>("shape", this.shape, defaultValue: defaultData.shape));
            properties.add(new DiagnosticsProperty <TextStyle>("labelStyle", this.labelStyle,
                                                               defaultValue: defaultData.labelStyle));
            properties.add(new DiagnosticsProperty <TextStyle>("secondaryLabelStyle", this.secondaryLabelStyle,
                                                               defaultValue: defaultData.secondaryLabelStyle));
            properties.add(new EnumProperty <Brightness?>("brightness", this.brightness,
                                                          defaultValue: defaultData.brightness));
            properties.add(new FloatProperty("elevation", this.elevation, defaultValue: defaultData.elevation));
            properties.add(new FloatProperty("pressElevation", this.pressElevation,
                                             defaultValue: defaultData.pressElevation));
        }
Exemplo n.º 2
0
        public override Widget build(BuildContext context)
        {
            ThemeData theme  = this.widget.theme ?? ThemeData.fallback();
            Widget    result = new AnimatedTheme(
                data: theme,
                isMaterialAppTheme: true,
                child: new WidgetsApp(
                    key: new GlobalObjectKey <State>(this),
                    navigatorKey: this.widget.navigatorKey,
                    navigatorObservers: this._navigatorObservers,
                    pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
                    new MaterialPageRoute(settings: settings, builder: builder),
                    home: this.widget.home,
                    routes: this.widget.routes,
                    initialRoute: this.widget.initialRoute,
                    onGenerateRoute: this.widget.onGenerateRoute,
                    onUnknownRoute: this.widget.onUnknownRoute,
                    builder: this.widget.builder,
                    textStyle: AppUtils._errorTextStyle,
                    locale: this.widget.locale,
                    localizationsDelegates: this._localizationsDelegates,
                    localeResolutionCallback: this.widget.localeResolutionCallback,
                    localeListResolutionCallback: this.widget.localeListResolutionCallback,
                    supportedLocales: this.widget.supportedLocales,
                    showPerformanceOverlay: this.widget.showPerformanceOverlay
                    )
                );

            return(result);
        }
        public override void debugFillProperties(DiagnosticPropertiesBuilder properties)
        {
            base.debugFillProperties(properties);
            ThemeData       defaultTheme = ThemeData.fallback();
            SliderThemeData defaultData  = fromPrimaryColors(
                primaryColor: defaultTheme.primaryColor,
                primaryColorDark: defaultTheme.primaryColorDark,
                primaryColorLight: defaultTheme.primaryColorLight,
                valueIndicatorTextStyle: defaultTheme.accentTextTheme.body2
                );

            properties.add(new DiagnosticsProperty <Color>("activeTrackColor", this.activeTrackColor,
                                                           defaultValue: defaultData.activeTrackColor));
            properties.add(new DiagnosticsProperty <Color>("activeTrackColor", this.activeTrackColor,
                                                           defaultValue: defaultData.activeTrackColor));
            properties.add(new DiagnosticsProperty <Color>("inactiveTrackColor", this.inactiveTrackColor,
                                                           defaultValue: defaultData.inactiveTrackColor));
            properties.add(new DiagnosticsProperty <Color>("disabledActiveTrackColor", this.disabledActiveTrackColor,
                                                           defaultValue: defaultData.disabledActiveTrackColor, level: DiagnosticLevel.debug));
            properties.add(new DiagnosticsProperty <Color>("disabledInactiveTrackColor", this.disabledInactiveTrackColor,
                                                           defaultValue: defaultData.disabledInactiveTrackColor, level: DiagnosticLevel.debug));
            properties.add(new DiagnosticsProperty <Color>("activeTickMarkColor", this.activeTickMarkColor,
                                                           defaultValue: defaultData.activeTickMarkColor, level: DiagnosticLevel.debug));
            properties.add(new DiagnosticsProperty <Color>("inactiveTickMarkColor", this.inactiveTickMarkColor,
                                                           defaultValue: defaultData.inactiveTickMarkColor, level: DiagnosticLevel.debug));
            properties.add(new DiagnosticsProperty <Color>("disabledActiveTickMarkColor",
                                                           this.disabledActiveTickMarkColor, defaultValue: defaultData.disabledActiveTickMarkColor,
                                                           level: DiagnosticLevel.debug));
            properties.add(new DiagnosticsProperty <Color>("disabledInactiveTickMarkColor",
                                                           this.disabledInactiveTickMarkColor, defaultValue: defaultData.disabledInactiveTickMarkColor,
                                                           level: DiagnosticLevel.debug));
            properties.add(new DiagnosticsProperty <Color>("thumbColor", this.thumbColor,
                                                           defaultValue: defaultData.thumbColor));
            properties.add(new DiagnosticsProperty <Color>("disabledThumbColor", this.disabledThumbColor,
                                                           defaultValue: defaultData.disabledThumbColor, level: DiagnosticLevel.debug));
            properties.add(new DiagnosticsProperty <Color>("overlayColor", this.overlayColor,
                                                           defaultValue: defaultData.overlayColor, level: DiagnosticLevel.debug));
            properties.add(new DiagnosticsProperty <Color>("valueIndicatorColor", this.valueIndicatorColor,
                                                           defaultValue: defaultData.valueIndicatorColor));
            properties.add(new DiagnosticsProperty <SliderTrackShape>("trackShape", this.trackShape,
                                                                      defaultValue: defaultData.trackShape, level: DiagnosticLevel.debug));
            properties.add(new DiagnosticsProperty <SliderTickMarkShape>("tickMarkShape", this.tickMarkShape,
                                                                         defaultValue: defaultData.tickMarkShape, level: DiagnosticLevel.debug));
            properties.add(new DiagnosticsProperty <SliderComponentShape>("thumbShape", this.thumbShape,
                                                                          defaultValue: defaultData.thumbShape, level: DiagnosticLevel.debug));
            properties.add(new DiagnosticsProperty <SliderComponentShape>("overlayShape", this.overlayShape,
                                                                          defaultValue: defaultData.overlayShape, level: DiagnosticLevel.debug));
            properties.add(new DiagnosticsProperty <SliderComponentShape>("valueIndicatorShape",
                                                                          this.valueIndicatorShape, defaultValue: defaultData.valueIndicatorShape, level: DiagnosticLevel.debug));
            properties.add(new EnumProperty <ShowValueIndicator>("showValueIndicator", this.showValueIndicator,
                                                                 defaultValue: defaultData.showValueIndicator));
            properties.add(new DiagnosticsProperty <TextStyle>("valueIndicatorTextStyle", this.valueIndicatorTextStyle,
                                                               defaultValue: defaultData.valueIndicatorTextStyle));
        }
Exemplo n.º 4
0
        public override Widget build(BuildContext context)
        {
            Widget result = new WidgetsApp(
                key: new GlobalObjectKey <State>(this),
                navigatorKey: this.widget.navigatorKey,
                navigatorObservers: this._navigatorObservers,
                pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
                new MaterialPageRoute(settings: settings, builder: builder),
                home: this.widget.home,
                routes: this.widget.routes,
                initialRoute: this.widget.initialRoute,
                onGenerateRoute: this.widget.onGenerateRoute,
                onUnknownRoute: this.widget.onUnknownRoute,
                builder: (BuildContext _context, Widget child) => {
                ThemeData theme;
                Brightness platformBrightness = MediaQuery.platformBrightnessOf(_context);
                if (platformBrightness == Brightness.dark && this.widget.darkTheme != null)
                {
                    theme = this.widget.darkTheme;
                }
                else if (this.widget.theme != null)
                {
                    theme = this.widget.theme;
                }
                else
                {
                    theme = ThemeData.fallback();
                }

                return(new AnimatedTheme(
                           data: theme,
                           isMaterialAppTheme: true,
                           child: this.widget.builder != null
                            ? new Builder(
                               builder: (__context) => { return this.widget.builder(__context, child); }
                               )
                            : child
                           ));
            },
                textStyle: AppUtils._errorTextStyle,
                locale: this.widget.locale,
                localizationsDelegates: this._localizationsDelegates,
                localeResolutionCallback: this.widget.localeResolutionCallback,
                localeListResolutionCallback: this.widget.localeListResolutionCallback,
                supportedLocales: this.widget.supportedLocales,
                showPerformanceOverlay: this.widget.showPerformanceOverlay
                );

            return(result);
        }
Exemplo n.º 5
0
        public override Widget build(BuildContext context)
        {
            ThemeData theme  = this.widget.theme ?? ThemeData.fallback();
            Widget    result = new AnimatedTheme(
                data: theme,
                isMaterialAppTheme: true,
                child: new WidgetsApp(
                    key: new GlobalObjectKey <State>(this),
                    navigatorKey: this.widget.navigatorKey,
                    navigatorObservers: this._navigatorObservers,
                    pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
                    new MaterialPageRoute(settings: settings, builder: builder),
                    home: this.widget.home,
                    routes: this.widget.routes,
                    initialRoute: this.widget.initialRoute,
                    onGenerateRoute: this.widget.onGenerateRoute,
                    onUnknownRoute: this.widget.onUnknownRoute,
                    builder: this.widget.builder,
                    textStyle: AppUtils._errorTextStyle
                    )
                );

            return(result);
        }
Exemplo n.º 6
0
        public override Widget build(BuildContext context)
        {
            Widget result = new WidgetsApp(
                key: new GlobalObjectKey <State>(this),
                navigatorKey: widget.navigatorKey,
                navigatorObservers: _navigatorObservers,
                pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
                new MaterialPageRoute(settings: settings, builder: builder),
                home: widget.home,
                routes: widget.routes,
                initialRoute: widget.initialRoute,
                onGenerateRoute: widget.onGenerateRoute,
                onGenerateInitialRoutes: widget.onGenerateInitialRoutes,
                onUnknownRoute: widget.onUnknownRoute,
                builder: (BuildContext _context, Widget child) => {
                ThemeMode mode  = widget.themeMode;
                ThemeData theme = null;
                if (widget.darkTheme != null)
                {
                    ui.Brightness platformBrightness = MediaQuery.platformBrightnessOf(context);
                    if (mode == ThemeMode.dark ||
                        (mode == ThemeMode.system && platformBrightness == ui.Brightness.dark))
                    {
                        theme = widget.darkTheme;
                    }
                }

                theme = theme ?? widget.theme ?? ThemeData.fallback();

                return(new AnimatedTheme(
                           data: theme,
                           isMaterialAppTheme: true,
                           child: widget.builder != null
                            ? new Builder(
                               builder: (__context) => { return widget.builder(__context, child); }
                               )
                            : child
                           ));
            },
                textStyle: material_._errorTextStyle,
                title: widget.title,
                onGenerateTitle: widget.onGenerateTitle,
                color: widget.color ?? widget.theme?.primaryColor ?? Colors.blue,
                locale: widget.locale,
                localizationsDelegates: _localizationsDelegates,
                localeResolutionCallback: widget.localeResolutionCallback,
                localeListResolutionCallback: widget.localeListResolutionCallback,
                supportedLocales: widget.supportedLocales,
                showPerformanceOverlay: widget.showPerformanceOverlay,
                checkerboardRasterCacheImages: widget.checkerboardRasterCacheImages,
                checkerboardOffscreenLayers: widget.checkerboardOffscreenLayers,
                debugShowCheckedModeBanner: widget.debugShowCheckedModeBanner,
                inspectorSelectButtonBuilder: (BuildContext contextIn, VoidCallback onPressed) => {
                return(new FloatingActionButton(
                           child: new Icon(Icons.search),
                           onPressed: onPressed,
                           mini: true
                           ));
            },
                shortcuts: widget.shortcuts,
                actions: widget.actions
                );

            return(result);
        }