mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
There were four or five different implementations in various tests for sendFakeKeyEvent, which roughly all did the same thing. I was going to add yet another one, and decided that it needed to be generalized and centralized. This replaces those instances with something that just takes a LogicalKeyboardKey so that it's self-documenting, and can be used with multiple platforms. This adds two functions to widget tester: sendKeyDownEvent and sendKeyUpEvent which simulate key up/down from a physical keyboard. It also adds global functions simulateKeyDownEvent and simulateKeyUpEvent that can be called without a widget tester. All are async functions protected by the async guard.
38 lines
1.4 KiB
Dart
38 lines
1.4 KiB
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.
|
|
|
|
/// Platform services exposed to Flutter apps.
|
|
///
|
|
/// To use, import `package:flutter/services.dart`.
|
|
///
|
|
/// This library depends only on core Dart libraries and the `foundation`
|
|
/// library.
|
|
library services;
|
|
|
|
export 'src/services/asset_bundle.dart';
|
|
export 'src/services/binary_messenger.dart';
|
|
export 'src/services/binding.dart';
|
|
export 'src/services/clipboard.dart';
|
|
export 'src/services/font_loader.dart';
|
|
export 'src/services/haptic_feedback.dart';
|
|
export 'src/services/keyboard_key.dart';
|
|
export 'src/services/keyboard_maps.dart';
|
|
export 'src/services/message_codec.dart';
|
|
export 'src/services/message_codecs.dart';
|
|
export 'src/services/platform_channel.dart';
|
|
export 'src/services/platform_messages.dart';
|
|
export 'src/services/platform_views.dart';
|
|
export 'src/services/raw_keyboard.dart';
|
|
export 'src/services/raw_keyboard_android.dart';
|
|
export 'src/services/raw_keyboard_fuchsia.dart';
|
|
export 'src/services/raw_keyboard_linux.dart';
|
|
export 'src/services/raw_keyboard_macos.dart';
|
|
export 'src/services/system_channels.dart';
|
|
export 'src/services/system_chrome.dart';
|
|
export 'src/services/system_navigator.dart';
|
|
export 'src/services/system_sound.dart';
|
|
export 'src/services/text_editing.dart';
|
|
export 'src/services/text_formatter.dart';
|
|
export 'src/services/text_input.dart';
|