-
Notifications
You must be signed in to change notification settings - Fork 390
Expand file tree
/
Copy pathaccessibility_controller.dart
More file actions
46 lines (35 loc) · 1.54 KB
/
accessibility_controller.dart
File metadata and controls
46 lines (35 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2025 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.
import 'package:devtools_app_shared/utils.dart';
import 'package:flutter/foundation.dart';
import '../../shared/framework/screen.dart';
import '../../shared/framework/screen_controllers.dart';
class AccessibilityController extends DevToolsScreenController
with AutoDisposeControllerMixin {
@override
String get screenId => ScreenMetaData.accessibility.id;
ValueListenable<bool> get accessibilityEnabled => _accessibilityEnabled;
final _accessibilityEnabled = ValueNotifier<bool>(false);
ValueListenable<double> get textScaleFactor => _textScaleFactor;
final _textScaleFactor = ValueNotifier<double>(1.0);
ValueListenable<bool> get highContrastEnabled => _highContrastEnabled;
final _highContrastEnabled = ValueNotifier<bool>(false);
ValueListenable<bool> get autoAuditEnabled => _autoAuditEnabled;
final _autoAuditEnabled = ValueNotifier<bool>(false);
void setTextScaleFactor(double factor) {
_textScaleFactor.value = factor;
// TODO(chunhtai): set text scale factor on device.
}
void toggleHighContrast(bool enable) {
_highContrastEnabled.value = enable;
// TODO(chunhtai): set high contrast on device.
}
void toggleAutoAudit(bool enable) {
_autoAuditEnabled.value = enable;
// TODO(chunhtai): auto run audit when enabled.
}
void runAudit() {
// TODO(chunhtai): run accessibility audit.
}
}