Exemple #1
0
        public static CupertinoButton filled(
            Key key      = null,
            Widget child = null,
            EdgeInsetsGeometry padding = null,
            Color disabledColor        = null,
            float minSize             = 44.0f,
            float pressedOpacity      = 0.4f,
            BorderRadius borderRadius = null,
            VoidCallback onPressed    = null
            )
        {
            disabledColor = disabledColor ?? CupertinoColors.quaternarySystemFill;
            D.assert(pressedOpacity >= 0.0 && pressedOpacity <= 1.0);
            var btn = new CupertinoButton(
                key: key,
                color: null,
                child: child,
                padding: padding,
                disabledColor: disabledColor,
                minSize: minSize,
                pressedOpacity: pressedOpacity,
                borderRadius: borderRadius,
                onPressed: onPressed
                );

            btn._filled = true;
            return(btn);
        }
Exemple #2
0
        public override Widget build(BuildContext context)
        {
            CupertinoThemeData effectiveThemeData = widget.theme ?? new CupertinoThemeData();

            return(new ScrollConfiguration(
                       behavior: new _AlwaysCupertinoScrollBehavior(),
                       child: new CupertinoUserInterfaceLevel(
                           data: CupertinoUserInterfaceLevelData.baselayer,
                           child: new CupertinoTheme(
                               data: effectiveThemeData,
                               child: new Builder(
                                   builder: (BuildContext context1) => {
                return new WidgetsApp(
                    key: new GlobalObjectKey <State <StatefulWidget> >(value: this),
                    navigatorKey: widget.navigatorKey,
                    navigatorObservers: _navigatorObservers,
                    pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
                    new CupertinoPageRoute(settings: settings, builder: builder),
                    home: widget.home,
                    routes: widget.routes,
                    initialRoute: widget.initialRoute,
                    onGenerateRoute: widget.onGenerateRoute,
                    onGenerateInitialRoutes: widget.onGenerateInitialRoutes,
                    onUnknownRoute: widget.onUnknownRoute,
                    builder: widget.builder,
                    title: widget.title,
                    onGenerateTitle: widget.onGenerateTitle,
                    textStyle: CupertinoTheme.of(context1).textTheme.textStyle,
                    color: CupertinoDynamicColor.resolve(widget.color ?? effectiveThemeData.primaryColor, context1),
                    locale: widget.locale,
                    localizationsDelegates: _localizationsDelegates,
                    localeResolutionCallback: widget.localeResolutionCallback,
                    localeListResolutionCallback: widget.localeListResolutionCallback,
                    supportedLocales: widget.supportedLocales,
                    showPerformanceOverlay: widget.showPerformanceOverlay,
                    checkerboardRasterCacheImages: widget.checkerboardRasterCacheImages,
                    checkerboardOffscreenLayers: widget.checkerboardOffscreenLayers,
                    showSemanticsDebugger: widget.showSemanticsDebugger,
                    debugShowCheckedModeBanner: widget.debugShowCheckedModeBanner,
                    inspectorSelectButtonBuilder: (BuildContext context3, VoidCallback onPressed) => {
                    return CupertinoButton.filled(
                        child: new Icon(
                            CupertinoIcons.search,
                            size: 28.0f,
                            color: CupertinoColors.white
                            ),
                        padding: EdgeInsets.zero,
                        onPressed: onPressed
                        );
                },
                    shortcuts: widget.shortcuts,
                    actions: widget.actions
                    );
            }
                                   )
                               )
                           )
                       ));
        }
Exemple #3
0
        public override Widget build(BuildContext context)
        {
            CupertinoThemeData effectiveThemeData = this.widget.theme ?? new CupertinoThemeData();

            return(new ScrollConfiguration(
                       behavior: new _AlwaysCupertinoScrollBehavior(),
                       child: new CupertinoTheme(
                           data: effectiveThemeData,
                           child: new WidgetsApp(
                               pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
                               new CupertinoPageRoute(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,
                               title: this.widget.title,
                               onGenerateTitle: this.widget.onGenerateTitle,
                               textStyle: effectiveThemeData.textTheme.textStyle,
                               color: this.widget.color ?? CupertinoColors.activeBlue,
                               locale: this.widget.locale,
                               localizationsDelegates: this._localizationsDelegates,
                               localeResolutionCallback: this.widget.localeResolutionCallback,
                               localeListResolutionCallback: this.widget.localeListResolutionCallback,
                               supportedLocales: this.widget.supportedLocales,
                               showPerformanceOverlay: this.widget.showPerformanceOverlay,
                               inspectorSelectButtonBuilder: (BuildContext _context, VoidCallback onPressed) => {
                return CupertinoButton.filled(
                    child: new Icon(
                        CupertinoIcons.search,
                        size: 28.0f,
                        color: CupertinoColors.white
                        ),
                    padding: EdgeInsets.zero,
                    onPressed: onPressed
                    );
            }
                               )
                           )
                       ));
        }