Skip to content

Commit

Permalink
Export public API types from services/*.dart library (#106316)
Browse files Browse the repository at this point in the history
  • Loading branch information
a14n authored Jun 28, 2022
1 parent c0ac61b commit bbdf617
Show file tree
Hide file tree
Showing 49 changed files with 131 additions and 39 deletions.
1 change: 0 additions & 1 deletion dev/benchmarks/platform_channels_benchmarks/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import 'dart:async';
import 'dart:math' as math;
import 'dart:typed_data';

import 'package:flutter/foundation.dart' show kDebugMode;
import 'package:flutter/material.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import 'dart:async';

import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;
import 'package:flutter/services.dart';

import 'pair.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:typed_data';

import 'package:flutter/services.dart';
import 'package:flutter_gallery/gallery/example_code_parser.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down
2 changes: 2 additions & 0 deletions dev/tools/gen_keycodes/data/keyboard_key.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import 'package:flutter/foundation.dart';

export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder;

// DO NOT EDIT -- DO NOT EDIT -- DO NOT EDIT
// This file is generated by dev/tools/gen_keycodes/bin/gen_keycodes.dart and
// should not be edited directly.
Expand Down
2 changes: 2 additions & 0 deletions dev/tools/gen_keycodes/data/keyboard_maps.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

import 'keyboard_key.dart';

export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey;

/// Maps Android-specific key codes to the matching [LogicalKeyboardKey].
const Map<int, LogicalKeyboardKey> kAndroidToLogicalKey = <int, LogicalKeyboardKey>{
@@@ANDROID_KEY_CODE_MAP@@@
Expand Down
1 change: 0 additions & 1 deletion examples/image_list/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import 'dart:async';
import 'dart:io';
import 'dart:math';
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

Expand Down
1 change: 0 additions & 1 deletion packages/flutter/lib/src/rendering/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'dart:ui' as ui show Scene, SceneBuilder, FlutterView;

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:vector_math/vector_math_64.dart';

import 'binding.dart';
import 'box.dart';
Expand Down
3 changes: 3 additions & 0 deletions packages/flutter/lib/src/services/asset_bundle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import 'package:flutter/foundation.dart';

import 'binding.dart';

export 'dart:typed_data' show ByteData;
export 'dart:ui' show ImmutableBuffer;

/// A collection of resources used by the application.
///
/// Asset bundles contain resources, such as images and strings, that can be
Expand Down
3 changes: 3 additions & 0 deletions packages/flutter/lib/src/services/autofill.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
// found in the LICENSE file.

import 'package:flutter/foundation.dart';

import 'text_input.dart';

export 'text_input.dart' show TextEditingValue, TextInputClient, TextInputConfiguration, TextInputConnection;

/// A collection of commonly used autofill hint strings on different platforms.
///
/// Each hint is pre-defined on at least one supported platform. See their
Expand Down
3 changes: 3 additions & 0 deletions packages/flutter/lib/src/services/binary_messenger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import 'dart:typed_data';
import 'dart:ui' as ui;

export 'dart:typed_data' show ByteData;
export 'dart:ui' show PlatformMessageResponseCallback;

/// A function which takes a platform message and asynchronously returns an encoded response.
typedef MessageHandler = Future<ByteData?>? Function(ByteData? message);

Expand Down
7 changes: 6 additions & 1 deletion packages/flutter/lib/src/services/binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ import 'asset_bundle.dart';
import 'binary_messenger.dart';
import 'hardware_keyboard.dart';
import 'message_codec.dart';
import 'raw_keyboard.dart';
import 'restoration.dart';
import 'system_channels.dart';
import 'text_input.dart';

export 'dart:ui' show ChannelBuffers;

export 'binary_messenger.dart' show BinaryMessenger;
export 'hardware_keyboard.dart' show HardwareKeyboard, KeyEventManager;
export 'restoration.dart' show RestorationManager;

/// Listens for platform messages and directs them to the [defaultBinaryMessenger].
///
/// The [ServicesBinding] also registers a [LicenseEntryCollector] that exposes
Expand Down
2 changes: 2 additions & 0 deletions packages/flutter/lib/src/services/debug.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'package:flutter/foundation.dart';

import 'hardware_keyboard.dart';

export 'hardware_keyboard.dart' show KeyDataTransitMode;

/// Override the transit mode with which key events are simulated.
///
/// Setting [debugKeyEventSimulatorTransitModeOverride] is a good way to make
Expand Down
2 changes: 2 additions & 0 deletions packages/flutter/lib/src/services/font_loader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'dart:ui';

import 'package:flutter/foundation.dart';

export 'dart:typed_data' show ByteData;

/// A class that enables the dynamic loading of fonts at runtime.
///
/// The [FontLoader] class provides a builder pattern, where the caller builds
Expand Down
9 changes: 8 additions & 1 deletion packages/flutter/lib/src/services/hardware_keyboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@
import 'dart:ui' as ui;

import 'package:flutter/foundation.dart';

import 'binding.dart';
import 'keyboard_key.dart';
import 'raw_keyboard.dart';

export 'dart:ui' show KeyData;

export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder;

export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey;
export 'raw_keyboard.dart' show RawKeyboard, RawKeyEvent;

/// Represents a lock mode of a keyboard, such as [KeyboardLockMode.capsLock].
///
/// A lock mode locks some of a keyboard's keys into a distinct mode of operation,
Expand Down
2 changes: 2 additions & 0 deletions packages/flutter/lib/src/services/keyboard_key.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import 'package:flutter/foundation.dart';

export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder;

// DO NOT EDIT -- DO NOT EDIT -- DO NOT EDIT
// This file is generated by dev/tools/gen_keycodes/bin/gen_keycodes.dart and
// should not be edited directly.
Expand Down
2 changes: 2 additions & 0 deletions packages/flutter/lib/src/services/keyboard_maps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

import 'keyboard_key.dart';

export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey;

/// Maps Android-specific key codes to the matching [LogicalKeyboardKey].
const Map<int, LogicalKeyboardKey> kAndroidToLogicalKey = <int, LogicalKeyboardKey>{
3: LogicalKeyboardKey.goHome,
Expand Down
6 changes: 6 additions & 0 deletions packages/flutter/lib/src/services/message_codecs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;

import 'message_codec.dart';

export 'dart:typed_data' show ByteData;

export 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;

export 'message_codec.dart' show MethodCall;

const int _writeBufferStartCapacity = 64;

/// [MessageCodec] with unencoded binary messages represented using [ByteData].
Expand Down
3 changes: 3 additions & 0 deletions packages/flutter/lib/src/services/mouse_cursor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import 'package:flutter/gestures.dart';

import 'system_channels.dart';

export 'package:flutter/foundation.dart' show DiagnosticLevel, DiagnosticPropertiesBuilder;
export 'package:flutter/gestures.dart' show PointerEvent;

/// Maintains the state of mouse cursors and manages how cursors are searched
/// for.
///
Expand Down
5 changes: 5 additions & 0 deletions packages/flutter/lib/src/services/mouse_tracking.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import 'package:flutter/gestures.dart';

import 'mouse_cursor.dart';

export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder;
export 'package:flutter/gestures.dart' show PointerEnterEvent, PointerExitEvent, PointerHoverEvent;

export 'mouse_cursor.dart' show MouseCursor;

/// Signature for listening to [PointerEnterEvent] events.
///
/// Used by [MouseTrackerAnnotation], [MouseRegion] and [RenderMouseRegion].
Expand Down
4 changes: 3 additions & 1 deletion packages/flutter/lib/src/services/platform_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import 'dart:async';
import 'dart:developer';
import 'dart:ui' show PlatformMessageResponseCallback;

import 'package:flutter/foundation.dart';

Expand All @@ -14,6 +13,9 @@ import 'debug.dart' show debugProfilePlatformChannels;
import 'message_codec.dart';
import 'message_codecs.dart';

export 'binary_messenger.dart' show BinaryMessenger;
export 'message_codec.dart' show MessageCodec, MethodCall, MethodCodec;

bool _debugProfilePlatformChannelsIsRunning = false;
const Duration _debugProfilePlatformChannelsRate = Duration(seconds: 1);
final Expando<BinaryMessenger> _debugBinaryMessengers = Expando<BinaryMessenger>();
Expand Down
6 changes: 6 additions & 0 deletions packages/flutter/lib/src/services/platform_views.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import 'package:flutter/gestures.dart';
import 'message_codec.dart';
import 'system_channels.dart';

export 'dart:ui' show Offset, Size, TextDirection, VoidCallback;

export 'package:flutter/gestures.dart' show PointerEvent;

export 'message_codec.dart' show MessageCodec;

/// Converts a given point from the global coordinate system in logical pixels
/// to the local coordinate system for a box.
///
Expand Down
4 changes: 4 additions & 0 deletions packages/flutter/lib/src/services/raw_keyboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import 'raw_keyboard_web.dart';
import 'raw_keyboard_windows.dart';
import 'system_channels.dart';

export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder, ValueChanged;

export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey;

/// An enum describing the side of the keyboard that a key is on, to allow
/// discrimination between which key is pressed (e.g. the left or right SHIFT
/// key).
Expand Down
6 changes: 5 additions & 1 deletion packages/flutter/lib/src/services/raw_keyboard_android.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

import 'package:flutter/foundation.dart';

import 'keyboard_key.dart';
import 'keyboard_maps.dart';
import 'raw_keyboard.dart';

export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder;

export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey;
export 'raw_keyboard.dart' show KeyboardSide, ModifierKey;

// Android sets the 0x80000000 bit on a character to indicate that it is a
// combining character, so we use this mask to remove that bit to make it a
// valid Unicode character again.
Expand Down
6 changes: 5 additions & 1 deletion packages/flutter/lib/src/services/raw_keyboard_fuchsia.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

import 'package:flutter/foundation.dart';

import 'keyboard_key.dart';
import 'keyboard_maps.dart';
import 'raw_keyboard.dart';

export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder;

export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey;
export 'raw_keyboard.dart' show KeyboardSide, ModifierKey;

/// Platform-specific key event data for Fuchsia.
///
/// This object contains information about key events obtained from Fuchsia's
Expand Down
6 changes: 5 additions & 1 deletion packages/flutter/lib/src/services/raw_keyboard_ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

import 'package:flutter/foundation.dart';

import 'keyboard_key.dart';
import 'keyboard_maps.dart';
import 'raw_keyboard.dart';

export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder;

export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey;
export 'raw_keyboard.dart' show KeyboardSide, ModifierKey;

/// Maps iOS specific string values of nonvisible keys to logical keys
///
/// See: https://developer.apple.com/documentation/uikit/uikeycommand/input_strings_for_special_keys?language=objc
Expand Down
6 changes: 5 additions & 1 deletion packages/flutter/lib/src/services/raw_keyboard_linux.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

import 'package:flutter/foundation.dart';

import 'keyboard_key.dart';
import 'keyboard_maps.dart';
import 'raw_keyboard.dart';

export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder;

export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey;
export 'raw_keyboard.dart' show KeyboardSide, ModifierKey;

/// Platform-specific key event data for Linux.
///
/// Different window toolkit implementations can map to different key codes. This class
Expand Down
6 changes: 5 additions & 1 deletion packages/flutter/lib/src/services/raw_keyboard_macos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

import 'package:flutter/foundation.dart';

import 'keyboard_key.dart';
import 'keyboard_maps.dart';
import 'raw_keyboard.dart';

export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder;

export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey;
export 'raw_keyboard.dart' show KeyboardSide, ModifierKey;

/// Convert a UTF32 rune to its lower case.
int runeToLowerCase(int rune) {
// Assume only Basic Multilingual Plane runes have lower and upper cases.
Expand Down
6 changes: 5 additions & 1 deletion packages/flutter/lib/src/services/raw_keyboard_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

import 'package:flutter/foundation.dart';

import 'keyboard_key.dart';
import 'keyboard_maps.dart';
import 'raw_keyboard.dart';

export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder;

export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey;
export 'raw_keyboard.dart' show KeyboardSide, ModifierKey;

String? _unicodeChar(String key) {
if (key.length == 1) {
return key.substring(0, 1);
Expand Down
6 changes: 5 additions & 1 deletion packages/flutter/lib/src/services/raw_keyboard_windows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

import 'package:flutter/foundation.dart';

import 'keyboard_key.dart';
import 'keyboard_maps.dart';
import 'raw_keyboard.dart';

export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder;

export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey;
export 'raw_keyboard.dart' show KeyboardSide, ModifierKey;

// Virtual key VK_PROCESSKEY in Win32 API.
//
// Key down events related to IME operations use this as keyCode.
Expand Down
3 changes: 2 additions & 1 deletion packages/flutter/lib/src/services/restoration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/scheduler.dart';

import 'message_codec.dart';
import 'message_codecs.dart';
import 'system_channels.dart';

export 'dart:typed_data' show Uint8List;

typedef _BucketVisitor = void Function(RestorationBucket bucket);

/// Manages the restoration data in the framework and synchronizes it with the
Expand Down
2 changes: 2 additions & 0 deletions packages/flutter/lib/src/services/system_channels.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import 'dart:ui';
import 'message_codecs.dart';
import 'platform_channel.dart';

export 'platform_channel.dart' show BasicMessageChannel, MethodChannel;

/// Platform channels used by the Flutter system.
class SystemChannels {
// This class is not meant to be instantiated or extended; this constructor
Expand Down
4 changes: 3 additions & 1 deletion packages/flutter/lib/src/services/system_chrome.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import 'package:flutter/foundation.dart';
import 'binding.dart';
import 'system_channels.dart';

export 'dart:ui' show Brightness;
export 'dart:ui' show Brightness, Color;

export 'binding.dart' show SystemUiChangeCallback;

/// Specifies a particular device orientation.
///
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/services/text_editing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'dart:ui' show TextAffinity, TextPosition, TextRange;

import 'package:flutter/foundation.dart';

export 'dart:ui' show TextAffinity, TextPosition, TextRange;
export 'dart:ui' show TextAffinity, TextPosition;

/// A range of text that represents a selection.
@immutable
Expand Down
Loading

0 comments on commit bbdf617

Please sign in to comment.