Ejemplo n.º 1
0
        public override Widget build(BuildContext context)
        {
            Widget home = new GalleryHome(
                testMode: this.widget.testMode,
                optionsPage: new GalleryOptionsPage(
                    options: this._options,
                    onOptionsChanged: this._handleOptionsChanged,
                    onSendFeedback: this.widget.onSendFeedback ?? (() => {
                Application.OpenURL("https://github.com/UnityTech/UIWidgets/issues");
            })
                    ),
                options: this._options
                );

            if (this.widget.updateUrlFetcher != null)
            {
                home = new Updater(
                    updateUrlFetcher: this.widget.updateUrlFetcher,
                    child: home
                    );
            }

            return(new MaterialApp(
                       theme: this._options.theme.data.copyWith(/*platform: this._options.platform*/),
                       title: "UIWidgets Gallery",
                       color: Colors.grey,
                       showPerformanceOverlay: this._options.showPerformanceOverlay,
                       //checkerboardOffscreenLayers: this._options.showOffscreenLayersCheckerboard,
                       //checkerboardRasterCacheImages: this._options.showRasterCacheImagesCheckerboard,
                       routes: this._buildRoutes(),
                       builder: (BuildContext _, Widget child) => this._applyTextScaleFactor(child),
                       home: home
                       ));
        }
Ejemplo n.º 2
0
        public override Widget build(BuildContext context)
        {
            Widget home = new GalleryHome(
                testMode: this.widget.testMode,
                optionsPage: new GalleryOptionsPage(
                    options: this._options,
                    onOptionsChanged: this._handleOptionsChanged,
                    onSendFeedback: this.widget.onSendFeedback ?? defaultSendFeedback
                    )
                );

            if (this.widget.updateUrlFetcher != null)
            {
                home = new Updater(
                    updateUrlFetcher: this.widget.updateUrlFetcher,
                    child: home
                    );
            }

            return(new ScopedModel <AppStateModel>(
                       model: this.model,
                       child: new MaterialApp(
                           theme: GalleyThemes.kLightGalleryTheme.copyWith(platform: this._options.platform,
                                                                           visualDensity: this._options.visualDensity.visualDensity),
                           darkTheme: GalleyThemes.kDarkGalleryTheme.copyWith(platform: this._options.platform,
                                                                              visualDensity: this._options.visualDensity.visualDensity),
                           themeMode: this._options.themeMode.Value,
                           title: "Flutter Gallery",
                           color: Colors.grey,
                           showPerformanceOverlay: this._options.showPerformanceOverlay,
                           checkerboardOffscreenLayers: this._options.showOffscreenLayersCheckerboard,
                           checkerboardRasterCacheImages: this._options.showRasterCacheImagesCheckerboard,
                           routes: this._buildRoutes(),
                           builder: (BuildContext subContext, Widget child) =>
            {
                return new Directionality(
                    textDirection: this._options.textDirection.Value,
                    child: this._applyTextScaleFactor(
                        // Specifically use a blank Cupertino theme here and do not transfer
                        // over the Material primary color etc except the brightness to
                        // showcase standard iOS looks.
                        new Builder(builder: (BuildContext context1) =>
                {
                    return new CupertinoTheme(
                        data: new CupertinoThemeData(
                            brightness: Theme.of(context1).brightness
                            ),
                        child: child
                        );
                })
                        )
                    );
            },
                           home: home
                           )
                       ));
        }