mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
26 lines
756 B
Dart
26 lines
756 B
Dart
// Copyright 2015 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.
|
|
|
|
import 'package:flutter/rendering.dart';
|
|
import 'package:sky_services/semantics/semantics.mojom.dart' as mojom;
|
|
|
|
class TestSemanticsClient {
|
|
TestSemanticsClient(PipelineOwner pipelineOwner) {
|
|
_semanticsOwner = pipelineOwner.addSemanticsListener(_updateSemanticsTree);
|
|
}
|
|
|
|
SemanticsOwner _semanticsOwner;
|
|
|
|
void dispose() {
|
|
_semanticsOwner.removeListener(_updateSemanticsTree);
|
|
_semanticsOwner = null;
|
|
}
|
|
|
|
final List<mojom.SemanticsNode> updates = <mojom.SemanticsNode>[];
|
|
|
|
void _updateSemanticsTree(List<mojom.SemanticsNode> nodes) {
|
|
updates.addAll(nodes);
|
|
}
|
|
}
|