-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
deferred_load.dart
31 lines (26 loc) · 982 Bytes
/
deferred_load.dart
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
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
part of dart.async;
/// Indicates that loading of [libraryName] is deferred.
///
/// This class is obsolete. Instead prefer the `deferred as` import directive
/// syntax.
/// ```
@Deprecated("Dart sdk v. 1.8")
class DeferredLibrary {
final String libraryName;
final String? uri;
const DeferredLibrary(this.libraryName, {this.uri});
/// Ensure that [libraryName] has been loaded.
///
/// If the library fails to load, the [Future] will complete with a
/// [DeferredLoadException].
external Future<Null> load();
}
/// Thrown when a deferred library fails to load.
class DeferredLoadException implements Exception {
DeferredLoadException(String message) : _s = message;
String toString() => "DeferredLoadException: '$_s'";
final String _s;
}