diff --git a/.github/workflows/dartpad_ui.yml b/.github/workflows/dartpad_ui.yml index 2fa455135..a079b1d61 100644 --- a/.github/workflows/dartpad_ui.yml +++ b/.github/workflows/dartpad_ui.yml @@ -37,3 +37,4 @@ jobs: - run: dart format --set-exit-if-changed . - run: flutter build web - run: flutter test + - run: sh ./tool/check_cycles.sh diff --git a/pkgs/dartpad_ui/lib/model.dart b/pkgs/dartpad_ui/lib/model.dart index b155ddd3a..5d543b8b5 100644 --- a/pkgs/dartpad_ui/lib/model.dart +++ b/pkgs/dartpad_ui/lib/model.dart @@ -10,6 +10,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:http/http.dart'; +import 'docs.dart'; import 'flutter_samples.dart'; import 'gists.dart'; import 'samples.g.dart'; @@ -90,6 +91,8 @@ class AppModel { final ValueNotifier useNewDDC = ValueNotifier(false); final ValueNotifier currentDeltaDill = ValueNotifier(null); + DocsWidget? docsWidget; + AppModel() { consoleNotifier.addListener(_recalcLayout); void updateCanReload() => diff --git a/pkgs/dartpad_ui/tool/check_cycles.sh b/pkgs/dartpad_ui/tool/check_cycles.sh new file mode 100644 index 000000000..b0bd111d5 --- /dev/null +++ b/pkgs/dartpad_ui/tool/check_cycles.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Copyright 2023 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Runs `analyze` for all code in the repo. + +# Fast fail the script on failures. +set -ex + +# The directory that this script is located in. +TOOL_DIR=`dirname "$0"` + +cd $TOOL_DIR/.. +dart pub global activate layerlens +layerlens --path . --fail-on-cycles +cd -