[run_mod] remove run_mod library
TEST=None
Change-Id: I8b16ea4b12366f0e27f060ff50d700ce8c901a0f
diff --git a/bin/xi/xi_session_demo/BUILD.gn b/bin/xi/xi_session_demo/BUILD.gn
index d806930..85a7847 100644
--- a/bin/xi/xi_session_demo/BUILD.gn
+++ b/bin/xi/xi_session_demo/BUILD.gn
@@ -20,6 +20,6 @@
"//topaz/bin/xi/xi_session_agent:xi_session_services",
"//topaz/public/lib/app/dart",
"//topaz/public/lib/app_driver/dart",
- "//topaz/public/lib/run_mod/dart",
+ "//topaz/public/lib/widgets/dart",
]
}
diff --git a/bin/xi/xi_session_demo/lib/main.dart b/bin/xi/xi_session_demo/lib/main.dart
index 4897794..2a1bb59 100644
--- a/bin/xi/xi_session_demo/lib/main.dart
+++ b/bin/xi/xi_session_demo/lib/main.dart
@@ -4,7 +4,7 @@
import 'package:flutter/material.dart';
import 'package:lib.app.dart/logging.dart';
-import 'package:lib.widgets/model.dart';
+import 'package:lib.widgets.dart/model.dart';
import 'src/demo_model.dart';
import 'src/demo_widget.dart';
diff --git a/bin/xi/xi_session_demo/lib/src/demo_model.dart b/bin/xi/xi_session_demo/lib/src/demo_model.dart
index 7c2f84e..b033ec5 100644
--- a/bin/xi/xi_session_demo/lib/src/demo_model.dart
+++ b/bin/xi/xi_session_demo/lib/src/demo_model.dart
@@ -6,12 +6,13 @@
import 'package:lib.app_driver.dart/module_driver.dart';
import 'package:fidl/fidl.dart';
import 'package:lib.ui.flutter/child_view.dart';
-import 'package:lib.widgets/model.dart';
import 'package:lib.app.dart/logging.dart';
+import 'package:lib.widgets.dart/model.dart';
import 'package:fidl_fuchsia_xi_session/fidl_async.dart';
import 'package:fidl_fuchsia_modular/fidl.dart';
-const String kSessionManagerURL = 'fuchsia-pkg://fuchsia.com/xi_session_agent#meta/xi_session_agent.cmx';
+const String kSessionManagerURL =
+ 'fuchsia-pkg://fuchsia.com/xi_session_agent#meta/xi_session_agent.cmx';
class DemoModel extends Model {
/// TODO: Refactor this class to use the new SDK instead of deprecated API
@@ -96,7 +97,8 @@
void connectXiModule(String sessionId) async {
viewOwner = InterfacePair();
editorController = new ModuleControllerClient();
- IntentBuilder intentBuilder = new IntentBuilder.handler('fuchsia-pkg://fuchsia.com/xi_embeddable#meta/xi_embeddable.cmx')
+ IntentBuilder intentBuilder = new IntentBuilder.handler(
+ 'fuchsia-pkg://fuchsia.com/xi_embeddable#meta/xi_embeddable.cmx')
..addParameter('session-id', sessionId);
driver.moduleContext.proxy.embedModule(
'xi_embeddable',
diff --git a/bin/xi/xi_session_demo/lib/src/demo_widget.dart b/bin/xi/xi_session_demo/lib/src/demo_widget.dart
index e9b78f2..34741e0 100644
--- a/bin/xi/xi_session_demo/lib/src/demo_widget.dart
+++ b/bin/xi/xi_session_demo/lib/src/demo_widget.dart
@@ -4,7 +4,7 @@
import 'package:flutter/material.dart';
import 'package:lib.ui.flutter/child_view.dart';
-import 'package:lib.widgets/model.dart';
+import 'package:lib.widgets.dart/model.dart';
import 'demo_model.dart';
diff --git a/public/lib/run_mod/dart/BUILD.gn b/public/lib/run_mod/dart/BUILD.gn
deleted file mode 100644
index 8724ae0..0000000
--- a/public/lib/run_mod/dart/BUILD.gn
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2018 The Fuchsia Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//build/dart/dart_library.gni")
-import("//topaz/runtime/dart/dart_test.gni")
-
-dart_library("dart") {
- package_name = "lib.run_mod.dart"
-
- sdk_category = "partner"
-
- sources = [
- "run_mod.dart",
- "src/run_mod.dart",
- "src/widgets/mod_failure_widget.dart",
- "src/widgets/mod_loading_widget.dart",
- ]
-
- deps = [
- "//third_party/dart-pkg/git/flutter/packages/flutter",
- "//topaz/public/dart/widgets:lib.widgets",
- ]
-}
diff --git a/public/lib/run_mod/dart/analysis_options.yaml b/public/lib/run_mod/dart/analysis_options.yaml
deleted file mode 100644
index 28306ea..0000000
--- a/public/lib/run_mod/dart/analysis_options.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright 2018 The Fuchsia Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-include: ../../../analysis_options.yaml
diff --git a/public/lib/run_mod/dart/lib/run_mod.dart b/public/lib/run_mod/dart/lib/run_mod.dart
deleted file mode 100644
index c7174b9..0000000
--- a/public/lib/run_mod/dart/lib/run_mod.dart
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2018 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export 'src/run_mod.dart';
diff --git a/public/lib/run_mod/dart/lib/src/run_mod.dart b/public/lib/run_mod/dart/lib/src/run_mod.dart
deleted file mode 100644
index 549f165..0000000
--- a/public/lib/run_mod/dart/lib/src/run_mod.dart
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2018 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import 'dart:async';
-
-import 'package:flutter/material.dart';
-import 'package:lib.widgets/widgets.dart';
-import 'package:meta/meta.dart';
-
-import 'widgets/mod_failure_widget.dart';
-import 'widgets/mod_loading_widget.dart';
-
-_ModuleRunner _runner;
-
-/// [runMod] is a method which aims to simplify the process of bootstrapping
-/// a module. The method is a wrapper around the flutter [runApp] method but
-/// allows the developer to defer displaying the widget tree and display
-/// a loading Widget in its place until the Widget tree is ready to render.
-/// If no loading Widget is provided a default one will be provided by the
-/// system. If a Module fails to load the [runMod] will display the error
-/// to the user in a way that is consistent amonst all modules.
-///
-/// The [runMod] method will call the start method on the singleton
-/// ModuleDriver instance. Note: this functionality is dependent on the
-/// ModuleDriver being implemented as a singleton and is being
-/// tracked in MS-1507.
-///
-/// [runMod] can be run in a synchronous manner by supplying a Widget
-/// immediately like the following:
-///
-/// void main() {
-/// runMod({
-/// child: new MyWidget(),
-/// });
-/// }
-///
-/// Or, [runMod] can be run asynchronously by providing a [Future<Widget>] to
-/// as the child.
-///
-/// void main() {
-/// Future<Widget> widget = _loadRequiredConfig().then((MyConfig c) {
-/// return new MyWidget(rquiredConfig: c);
-/// });
-/// runMod({
-/// child: widget,
-/// });
-/// }
-///
-/// In this example the widget requires some configuration before it can be
-/// created. The module author can pass the Future to the [runMod] method and
-/// the system will draw a default loadingScreen which avoids any delay for the
-/// user. When the configuration is loaded the module author can create their
-/// Widget tree and the [runMod] method will replace the loading Widget with the
-/// module author's Widget. If there is a failure during any part of the loading
-/// process a default error screen will be shown to the user.
-///
-/// * [child] (required): A [Future<Widget>] or a [Widget] which will be
-/// the root widget for the module.
-/// * [loadingWidget] (optional): A [Widget] which, if provided, will be used
-/// as the placeholder widget while waiting for the [child] widget to resolve.
-/// If [child] is a [Widget] and not a [Future<Widget>] this value is ignored.
-void runMod({
- @required FutureOr<Widget> child,
- Widget loadingWidget,
-}) {
- if (_runner != null) {
- throw new Exception('runMod() should only be called once.');
- }
-
- _runner = new _ModuleRunner(
- child: child,
- loadingWidget: loadingWidget,
- )..run();
-}
-
-class _ModuleRunner {
- final FutureOr<Widget> child;
- final Widget loadingWidget;
-
- _ModuleRunner({
- @required this.child,
- this.loadingWidget,
- }) : assert(child != null);
-
- void run() {
- runApp(
- new FutureWidget(
- child: child,
- loadingWidget: loadingWidget ?? const ModLoadingWidget(),
- errorBuilder: _errorBuilder,
- ),
- );
- }
-
- Widget _errorBuilder(BuildContext context, Error error) {
- return const ModFailureWidget();
- }
-}
diff --git a/public/lib/run_mod/dart/lib/src/widgets/mod_failure_widget.dart b/public/lib/run_mod/dart/lib/src/widgets/mod_failure_widget.dart
deleted file mode 100644
index 0c39cea..0000000
--- a/public/lib/run_mod/dart/lib/src/widgets/mod_failure_widget.dart
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2018 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import 'package:flutter/material.dart';
-
-/// The [ModFailureWidget] is a widget which is displayed when a module has
-/// a failure before it can draw its own Widget.
-class ModFailureWidget extends StatelessWidget {
- /// The constructur for the [ModFailureWidget]
- const ModFailureWidget({
- Key key,
- }) : super(key: key);
-
- @override
- //TODO(MS-1508) update this widget to display an error message
- Widget build(BuildContext context) {
- return new Container(
- color: Colors.red,
- );
- }
-}
diff --git a/public/lib/run_mod/dart/lib/src/widgets/mod_loading_widget.dart b/public/lib/run_mod/dart/lib/src/widgets/mod_loading_widget.dart
deleted file mode 100644
index 85204b3..0000000
--- a/public/lib/run_mod/dart/lib/src/widgets/mod_loading_widget.dart
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2018 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import 'package:flutter/material.dart';
-import 'package:lib.widgets/widgets.dart';
-
-/// The [ModLoadingWidget] is a Widget which is shown as the default loading
-/// widget for any module that needs to do asynchronous work before it can
-/// draw its own widget.
-class ModLoadingWidget extends StatelessWidget {
- /// The constructor for the [ModLoadingWidget]
- const ModLoadingWidget({
- Key key,
- }) : super(key: key);
-
- @override
- //TODO(MS-1510) stylize this widget
- Widget build(BuildContext context) {
- return new Container(
- color: Colors.white,
- child: new Center(
- child: new Container(
- height: 48.0,
- width: 48.0,
- child: new FuchsiaSpinner(
- color: Colors.blue[700],
- ),
- ),
- ),
- );
- }
-}
diff --git a/public/lib/run_mod/dart/pubspec.yaml b/public/lib/run_mod/dart/pubspec.yaml
deleted file mode 100644
index 4e9260f..0000000
--- a/public/lib/run_mod/dart/pubspec.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright 2018 The Fuchsia Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-name: lib.run_mod.dart