Update typedef syntax to use Function notation and turn on lint for old notation. (#18362)
Now that Dart 1 is turned off, reapplying my change to turn on the prefer_generic_function_type_aliases analysis option, and fix all the typedefs to Dart 2 preferred syntax. Also eliminated the unused analysis_options_repo.yaml file and turned on public_member_api_docs in analysys_options.yaml. No logic changes, just changing the typedef syntax for all typedefs, and updating analysis options.
This commit is contained in:
parent
3019ad976d
commit
6c56bb2420
@ -7,17 +7,17 @@
|
|||||||
# See the configuration guide for more
|
# See the configuration guide for more
|
||||||
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
|
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
|
||||||
#
|
#
|
||||||
# There are four similar analysis options files in the flutter repos:
|
# There are four similar analysis options files in the flutter repo:
|
||||||
# - analysis_options.yaml (this file)
|
# - analysis_options.yaml (this file)
|
||||||
# - packages/flutter/lib/analysis_options_user.yaml
|
# - packages/flutter/lib/analysis_options_user.yaml
|
||||||
# - https://github.com/flutter/plugins/blob/master/analysis_options.yaml
|
# - https://github.com/flutter/plugins/blob/master/analysis_options.yaml
|
||||||
# - https://github.com/flutter/engine/blob/master/analysis_options.yaml
|
# - https://github.com/flutter/engine/blob/master/analysis_options.yaml
|
||||||
#
|
#
|
||||||
# This file contains the analysis options used by Flutter tools, such as IntelliJ,
|
# This file contains the analysis options used by Flutter tools, such as
|
||||||
# Android Studio, and the `flutter analyze` command.
|
# IntelliJ, Android Studio, and the 'flutter analyze' command.
|
||||||
#
|
#
|
||||||
# The flutter/plugins repo contains a copy of this file, which should be kept
|
# The flutter/plugins and flutter/engine repos contain a copy of this file,
|
||||||
# in sync with this file.
|
# which should be kept in sync with this file.
|
||||||
|
|
||||||
analyzer:
|
analyzer:
|
||||||
language:
|
language:
|
||||||
@ -124,6 +124,7 @@ linter:
|
|||||||
- prefer_final_locals
|
- prefer_final_locals
|
||||||
- prefer_foreach
|
- prefer_foreach
|
||||||
# - prefer_function_declarations_over_variables # not yet tested
|
# - prefer_function_declarations_over_variables # not yet tested
|
||||||
|
- prefer_generic_function_type_aliases
|
||||||
- prefer_initializing_formals
|
- prefer_initializing_formals
|
||||||
# - prefer_interpolation_to_compose_strings # not yet tested
|
# - prefer_interpolation_to_compose_strings # not yet tested
|
||||||
# - prefer_iterable_whereType # https://github.com/dart-lang/sdk/issues/32463
|
# - prefer_iterable_whereType # https://github.com/dart-lang/sdk/issues/32463
|
||||||
@ -131,6 +132,7 @@ linter:
|
|||||||
- prefer_is_not_empty
|
- prefer_is_not_empty
|
||||||
- prefer_single_quotes
|
- prefer_single_quotes
|
||||||
- prefer_typing_uninitialized_variables
|
- prefer_typing_uninitialized_variables
|
||||||
|
- public_member_api_docs
|
||||||
- recursive_getters
|
- recursive_getters
|
||||||
- slash_for_doc_comments
|
- slash_for_doc_comments
|
||||||
- sort_constructors_first
|
- sort_constructors_first
|
||||||
|
@ -1,157 +0,0 @@
|
|||||||
# Specify analysis options.
|
|
||||||
#
|
|
||||||
# Until there are meta linter rules, each desired lint must be explicitly enabled.
|
|
||||||
# See: https://github.com/dart-lang/linter/issues/288
|
|
||||||
#
|
|
||||||
# For a list of lints, see: http://dart-lang.github.io/linter/lints/
|
|
||||||
# See the configuration guide for more
|
|
||||||
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
|
|
||||||
#
|
|
||||||
# There are three similar analysis options files in the flutter repo:
|
|
||||||
# - analysis_options.yaml
|
|
||||||
# - analysis_options_repo.yaml (this file)
|
|
||||||
# - packages/flutter/lib/analysis_options_user.yaml
|
|
||||||
#
|
|
||||||
# This file contains the analysis options used by 'flutter analyze' when analyzing
|
|
||||||
# the flutter repository. It is very similar to analysis_options.yaml;
|
|
||||||
# the only difference (currently) is the public_member_api_docs option,
|
|
||||||
# which is turned on and programmatically reduced to a single output line
|
|
||||||
# indicating the # of violations for that rule.
|
|
||||||
|
|
||||||
analyzer:
|
|
||||||
language:
|
|
||||||
enableStrictCallChecks: true
|
|
||||||
enableSuperMixins: true
|
|
||||||
strong-mode:
|
|
||||||
implicit-dynamic: false
|
|
||||||
errors:
|
|
||||||
# treat missing required parameters as a warning (not a hint)
|
|
||||||
missing_required_param: warning
|
|
||||||
# treat missing returns as a warning (not a hint)
|
|
||||||
missing_return: warning
|
|
||||||
# allow having TODOs in the code
|
|
||||||
todo: ignore
|
|
||||||
# `flutter analyze` (without `--watch`) just ignores directories
|
|
||||||
# that contain a .dartignore file, and this file does not have any
|
|
||||||
# effect on what files are actually analyzed.
|
|
||||||
|
|
||||||
linter:
|
|
||||||
rules:
|
|
||||||
# these rules are documented on and in the same order as
|
|
||||||
# the Dart Lint rules page to make maintenance easier
|
|
||||||
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
|
|
||||||
- always_declare_return_types
|
|
||||||
- always_put_control_body_on_new_line
|
|
||||||
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
|
|
||||||
- always_require_non_null_named_parameters
|
|
||||||
- always_specify_types
|
|
||||||
- annotate_overrides
|
|
||||||
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
|
|
||||||
- avoid_as
|
|
||||||
# - avoid_bool_literals_in_conditional_expressions # not yet tested
|
|
||||||
# - avoid_catches_without_on_clauses # we do this commonly
|
|
||||||
# - avoid_catching_errors # we do this commonly
|
|
||||||
- avoid_classes_with_only_static_members
|
|
||||||
# - avoid_double_and_int_checks # only useful when targeting JS runtime
|
|
||||||
- avoid_empty_else
|
|
||||||
# - avoid_field_initializers_in_const_classes # not yet tested
|
|
||||||
- avoid_function_literals_in_foreach_calls
|
|
||||||
- avoid_init_to_null
|
|
||||||
# - avoid_js_rounded_ints # only useful when targeting JS runtime
|
|
||||||
- avoid_null_checks_in_equality_operators
|
|
||||||
# - avoid_positional_boolean_parameters # not yet tested
|
|
||||||
# - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
|
|
||||||
- avoid_relative_lib_imports
|
|
||||||
- avoid_renaming_method_parameters
|
|
||||||
- avoid_return_types_on_setters
|
|
||||||
# - avoid_returning_null # we do this commonly
|
|
||||||
# - avoid_returning_this # https://github.com/dart-lang/linter/issues/842
|
|
||||||
# - avoid_setters_without_getters # not yet tested
|
|
||||||
# - avoid_single_cascade_in_expression_statements # not yet tested
|
|
||||||
- avoid_slow_async_io
|
|
||||||
# - avoid_types_as_parameter_names # https://github.com/dart-lang/linter/pull/954/files
|
|
||||||
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
|
|
||||||
# - avoid_unused_constructor_parameters # https://github.com/dart-lang/linter/pull/847
|
|
||||||
- await_only_futures
|
|
||||||
- camel_case_types
|
|
||||||
- cancel_subscriptions
|
|
||||||
# - cascade_invocations # not yet tested
|
|
||||||
# - close_sinks # https://github.com/flutter/flutter/issues/5789
|
|
||||||
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
|
|
||||||
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
|
|
||||||
- control_flow_in_finally
|
|
||||||
- directives_ordering
|
|
||||||
- empty_catches
|
|
||||||
- empty_constructor_bodies
|
|
||||||
- empty_statements
|
|
||||||
- hash_and_equals
|
|
||||||
- implementation_imports
|
|
||||||
# - invariant_booleans # https://github.com/flutter/flutter/issues/5790
|
|
||||||
- iterable_contains_unrelated_type
|
|
||||||
# - join_return_with_assignment # not yet tested
|
|
||||||
- library_names
|
|
||||||
- library_prefixes
|
|
||||||
- list_remove_unrelated_type
|
|
||||||
# - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791
|
|
||||||
- no_adjacent_strings_in_list
|
|
||||||
- no_duplicate_case_values
|
|
||||||
- non_constant_identifier_names
|
|
||||||
# - omit_local_variable_types # opposite of always_specify_types
|
|
||||||
# - one_member_abstracts # too many false positives
|
|
||||||
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
|
|
||||||
- overridden_fields
|
|
||||||
- package_api_docs
|
|
||||||
- package_names
|
|
||||||
- package_prefixed_library_names
|
|
||||||
# - parameter_assignments # we do this commonly
|
|
||||||
- prefer_adjacent_string_concatenation
|
|
||||||
- prefer_asserts_in_initializer_lists
|
|
||||||
- prefer_bool_in_asserts
|
|
||||||
- prefer_collection_literals
|
|
||||||
- prefer_conditional_assignment
|
|
||||||
- prefer_const_constructors
|
|
||||||
- prefer_const_constructors_in_immutables
|
|
||||||
- prefer_const_declarations
|
|
||||||
- prefer_const_literals_to_create_immutables
|
|
||||||
# - prefer_constructors_over_static_methods # not yet tested
|
|
||||||
- prefer_contains
|
|
||||||
- prefer_equal_for_default_values
|
|
||||||
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
|
|
||||||
- prefer_final_fields
|
|
||||||
- prefer_final_locals
|
|
||||||
- prefer_foreach
|
|
||||||
# - prefer_function_declarations_over_variables # not yet tested
|
|
||||||
- prefer_initializing_formals
|
|
||||||
# - prefer_interpolation_to_compose_strings # not yet tested
|
|
||||||
# - prefer_iterable_whereType # https://github.com/dart-lang/sdk/issues/32463
|
|
||||||
- prefer_is_empty
|
|
||||||
- prefer_is_not_empty
|
|
||||||
- prefer_single_quotes
|
|
||||||
- prefer_typing_uninitialized_variables
|
|
||||||
- public_member_api_docs # this is the only difference from analysis_options.yaml
|
|
||||||
- recursive_getters
|
|
||||||
- slash_for_doc_comments
|
|
||||||
- sort_constructors_first
|
|
||||||
- sort_unnamed_constructors_first
|
|
||||||
- super_goes_last
|
|
||||||
- test_types_in_equals
|
|
||||||
- throw_in_finally
|
|
||||||
# - type_annotate_public_apis # subset of always_specify_types
|
|
||||||
- type_init_formals
|
|
||||||
# - unawaited_futures # https://github.com/flutter/flutter/issues/5793
|
|
||||||
- unnecessary_brace_in_string_interps
|
|
||||||
- unnecessary_getters_setters
|
|
||||||
# - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498
|
|
||||||
- unnecessary_null_aware_assignments
|
|
||||||
- unnecessary_null_in_if_null_operators
|
|
||||||
- unnecessary_overrides
|
|
||||||
- unnecessary_parenthesis
|
|
||||||
# - unnecessary_statements # not yet tested
|
|
||||||
- unnecessary_this
|
|
||||||
- unrelated_type_equality_checks
|
|
||||||
- use_rethrow_when_possible
|
|
||||||
# - use_setters_to_change_properties # not yet tested
|
|
||||||
# - use_string_buffers # https://github.com/dart-lang/linter/pull/664
|
|
||||||
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
|
|
||||||
- valid_regexps
|
|
||||||
# - void_checks # not yet tested
|
|
@ -175,7 +175,7 @@ class ProcessRunner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef Future<Uint8List> HttpReader(Uri url, {Map<String, String> headers});
|
typedef HttpReader = Future<Uint8List> Function(Uri url, {Map<String, String> headers});
|
||||||
|
|
||||||
/// Creates a pre-populated Flutter archive from a git repo.
|
/// Creates a pre-populated Flutter archive from a git repo.
|
||||||
class ArchiveCreator {
|
class ArchiveCreator {
|
||||||
|
@ -8,7 +8,7 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
|
||||||
typedef Future<Null> ShardRunner();
|
typedef ShardRunner = Future<Null> Function();
|
||||||
|
|
||||||
final String flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(Platform.script))));
|
final String flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(Platform.script))));
|
||||||
final String flutter = path.join(flutterRoot, 'bin', Platform.isWindows ? 'flutter.bat' : 'flutter');
|
final String flutter = path.join(flutterRoot, 'bin', Platform.isWindows ? 'flutter.bat' : 'flutter');
|
||||||
|
@ -150,7 +150,7 @@ class FakeProcess extends Mock implements Process {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Callback used to receive stdin input when it occurs.
|
/// Callback used to receive stdin input when it occurs.
|
||||||
typedef void StringReceivedCallback(String received);
|
typedef StringReceivedCallback = void Function(String received);
|
||||||
|
|
||||||
/// A stream consumer class that consumes UTF8 strings as lists of ints.
|
/// A stream consumer class that consumes UTF8 strings as lists of ints.
|
||||||
class StringStreamConsumer implements StreamConsumer<List<int>> {
|
class StringStreamConsumer implements StreamConsumer<List<int>> {
|
||||||
|
@ -20,7 +20,7 @@ const Duration _kDefaultTaskTimeout = const Duration(minutes: 15);
|
|||||||
|
|
||||||
/// Represents a unit of work performed in the CI environment that can
|
/// Represents a unit of work performed in the CI environment that can
|
||||||
/// succeed, fail and be retried independently of others.
|
/// succeed, fail and be retried independently of others.
|
||||||
typedef Future<TaskResult> TaskFunction();
|
typedef TaskFunction = Future<TaskResult> Function();
|
||||||
|
|
||||||
bool _isTaskRegistered = false;
|
bool _isTaskRegistered = false;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ const int _kRunsPerBenchmark = 3;
|
|||||||
|
|
||||||
/// Runs a benchmark once and reports the result as a lower-is-better numeric
|
/// Runs a benchmark once and reports the result as a lower-is-better numeric
|
||||||
/// value.
|
/// value.
|
||||||
typedef Future<double> _Benchmark();
|
typedef _Benchmark = Future<double> Function();
|
||||||
|
|
||||||
/// Path to the generated "mega gallery" app.
|
/// Path to the generated "mega gallery" app.
|
||||||
Directory get _megaGalleryDirectory => dir(path.join(Directory.systemTemp.path, 'mega_gallery'));
|
Directory get _megaGalleryDirectory => dir(path.join(Directory.systemTemp.path, 'mega_gallery'));
|
||||||
|
@ -112,7 +112,7 @@ CommandArgs cmd({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef dynamic ExitErrorFactory();
|
typedef ExitErrorFactory = dynamic Function();
|
||||||
|
|
||||||
class CommandArgs {
|
class CommandArgs {
|
||||||
CommandArgs({ this.command, this.arguments, this.environment });
|
CommandArgs({ this.command, this.arguments, this.environment });
|
||||||
|
@ -11,7 +11,7 @@ import 'pair.dart';
|
|||||||
|
|
||||||
enum TestStatus { ok, pending, failed, complete }
|
enum TestStatus { ok, pending, failed, complete }
|
||||||
|
|
||||||
typedef Future<TestStepResult> TestStep();
|
typedef TestStep = Future<TestStepResult> Function();
|
||||||
|
|
||||||
const String nothing = '-';
|
const String nothing = '-';
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
enum TestStatus { ok, pending, failed, complete }
|
enum TestStatus { ok, pending, failed, complete }
|
||||||
|
|
||||||
typedef Future<TestStepResult> TestStep();
|
typedef TestStep = Future<TestStepResult> Function();
|
||||||
|
|
||||||
const String nothing = '-';
|
const String nothing = '-';
|
||||||
|
|
||||||
|
@ -396,7 +396,7 @@ class _RectangleDemoState extends State<_RectangleDemo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef Widget _DemoBuilder(_ArcDemo demo);
|
typedef _DemoBuilder = Widget Function(_ArcDemo demo);
|
||||||
|
|
||||||
class _ArcDemo {
|
class _ArcDemo {
|
||||||
_ArcDemo(this.title, this.builder, TickerProvider vsync)
|
_ArcDemo(this.title, this.builder, TickerProvider vsync)
|
||||||
|
@ -92,7 +92,7 @@ class OverlayGeometryApp extends StatefulWidget {
|
|||||||
OverlayGeometryAppState createState() => new OverlayGeometryAppState();
|
OverlayGeometryAppState createState() => new OverlayGeometryAppState();
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void CardTapCallback(GlobalKey targetKey, Offset globalPosition);
|
typedef CardTapCallback = void Function(GlobalKey targetKey, Offset globalPosition);
|
||||||
|
|
||||||
class CardBuilder extends SliverChildDelegate {
|
class CardBuilder extends SliverChildDelegate {
|
||||||
CardBuilder({ this.cardModels, this.onTapUp });
|
CardBuilder({ this.cardModels, this.onTapUp });
|
||||||
|
@ -10,8 +10,8 @@ enum _Location {
|
|||||||
Bermuda
|
Bermuda
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef Widget DemoItemBodyBuilder<T>(DemoItem<T> item);
|
typedef DemoItemBodyBuilder<T> = Widget Function(DemoItem<T> item);
|
||||||
typedef String ValueToString<T>(T value);
|
typedef ValueToString<T> = String Function(T value);
|
||||||
|
|
||||||
class DualHeaderWithHint extends StatelessWidget {
|
class DualHeaderWithHint extends StatelessWidget {
|
||||||
const DualHeaderWithHint({
|
const DualHeaderWithHint({
|
||||||
|
@ -10,7 +10,7 @@ enum GridDemoTileStyle {
|
|||||||
twoLine
|
twoLine
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void BannerTapCallback(Photo photo);
|
typedef BannerTapCallback = void Function(Photo photo);
|
||||||
|
|
||||||
const double _kMinFlingVelocity = 800.0;
|
const double _kMinFlingVelocity = 800.0;
|
||||||
const String _kGalleryAssetsPackage = 'flutter_gallery_assets';
|
const String _kGalleryAssetsPackage = 'flutter_gallery_assets';
|
||||||
|
@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
typedef Future<String> UpdateUrlFetcher();
|
typedef UpdateUrlFetcher = Future<String> Function();
|
||||||
|
|
||||||
class Updater extends StatefulWidget {
|
class Updater extends StatefulWidget {
|
||||||
const Updater({ @required this.updateUrlFetcher, this.child, Key key })
|
const Updater({ @required this.updateUrlFetcher, this.child, Key key })
|
||||||
|
@ -9,8 +9,8 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
typedef void OnProgressListener(double completed, double total);
|
typedef OnProgressListener = void Function(double completed, double total);
|
||||||
typedef void OnResultListener(String result);
|
typedef OnResultListener = void Function(String result);
|
||||||
|
|
||||||
// An encapsulation of a large amount of synchronous processing.
|
// An encapsulation of a large amount of synchronous processing.
|
||||||
//
|
//
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
typedef Widget _TextTransformer(String name, String text);
|
typedef _TextTransformer = Widget Function(String name, String text);
|
||||||
|
|
||||||
// From https://en.wikiquote.org/wiki/2001:_A_Space_Odyssey_(film)
|
// From https://en.wikiquote.org/wiki/2001:_A_Space_Odyssey_(film)
|
||||||
const String _kDialogText = '''
|
const String _kDialogText = '''
|
||||||
|
@ -12,7 +12,7 @@ import 'package:intl/src/intl_helpers.dart';
|
|||||||
import 'stock_messages_en.dart' as messages_en;
|
import 'stock_messages_en.dart' as messages_en;
|
||||||
import 'stock_messages_es.dart' as messages_es;
|
import 'stock_messages_es.dart' as messages_es;
|
||||||
|
|
||||||
typedef Future<dynamic> LibraryLoader();
|
typedef LibraryLoader = Future<dynamic> Function();
|
||||||
Map<String, LibraryLoader> _deferredLibraries = {
|
Map<String, LibraryLoader> _deferredLibraries = {
|
||||||
'en': () => new Future.value(null),
|
'en': () => new Future.value(null),
|
||||||
'es': () => new Future.value(null),
|
'es': () => new Future.value(null),
|
||||||
|
@ -12,7 +12,7 @@ final messages = new MessageLookup();
|
|||||||
final _keepAnalysisHappy = Intl.defaultLocale;
|
final _keepAnalysisHappy = Intl.defaultLocale;
|
||||||
|
|
||||||
// ignore: non_constant_identifier_names
|
// ignore: non_constant_identifier_names
|
||||||
typedef MessageIfAbsent(String message_str, List args);
|
typedef MessageIfAbsent = dynamic Function(String message_str, List args);
|
||||||
|
|
||||||
class MessageLookup extends MessageLookupByLibrary {
|
class MessageLookup extends MessageLookupByLibrary {
|
||||||
get localeName => 'en';
|
get localeName => 'en';
|
||||||
|
@ -11,7 +11,7 @@ import 'stock_strings.dart';
|
|||||||
import 'stock_symbol_viewer.dart';
|
import 'stock_symbol_viewer.dart';
|
||||||
import 'stock_types.dart';
|
import 'stock_types.dart';
|
||||||
|
|
||||||
typedef void ModeUpdater(StockMode mode);
|
typedef ModeUpdater = void Function(StockMode mode);
|
||||||
|
|
||||||
enum _StockMenuItem { autorefresh, refresh, speedUp, speedDown }
|
enum _StockMenuItem { autorefresh, refresh, speedUp, speedDown }
|
||||||
enum StockHomeTab { market, portfolio }
|
enum StockHomeTab { market, portfolio }
|
||||||
|
@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'stock_arrow.dart';
|
import 'stock_arrow.dart';
|
||||||
import 'stock_data.dart';
|
import 'stock_data.dart';
|
||||||
|
|
||||||
typedef void StockRowActionCallback(Stock stock);
|
typedef StockRowActionCallback = void Function(Stock stock);
|
||||||
|
|
||||||
class StockRow extends StatelessWidget {
|
class StockRow extends StatelessWidget {
|
||||||
StockRow({
|
StockRow({
|
||||||
|
@ -22,7 +22,7 @@ enum AnimationStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Signature for listeners attached using [Animation.addStatusListener].
|
/// Signature for listeners attached using [Animation.addStatusListener].
|
||||||
typedef void AnimationStatusListener(AnimationStatus status);
|
typedef AnimationStatusListener = void Function(AnimationStatus status);
|
||||||
|
|
||||||
/// An animation with a value of type `T`.
|
/// An animation with a value of type `T`.
|
||||||
///
|
///
|
||||||
|
@ -204,7 +204,7 @@ enum RefreshIndicatorMode {
|
|||||||
///
|
///
|
||||||
/// The `pulledExtent` parameter is the currently available space either from
|
/// The `pulledExtent` parameter is the currently available space either from
|
||||||
/// overscrolling or as held by the sliver during refresh.
|
/// overscrolling or as held by the sliver during refresh.
|
||||||
typedef Widget RefreshControlIndicatorBuilder(
|
typedef RefreshControlIndicatorBuilder = Widget Function(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
RefreshIndicatorMode refreshState,
|
RefreshIndicatorMode refreshState,
|
||||||
double pulledExtent,
|
double pulledExtent,
|
||||||
@ -216,7 +216,7 @@ typedef Widget RefreshControlIndicatorBuilder(
|
|||||||
/// pulled a `refreshTriggerPullDistance`. Must return a [Future]. Upon
|
/// pulled a `refreshTriggerPullDistance`. Must return a [Future]. Upon
|
||||||
/// completion of the [Future], the [CupertinoRefreshControl] enters the
|
/// completion of the [Future], the [CupertinoRefreshControl] enters the
|
||||||
/// [RefreshIndicatorMode.done] state and will start to go away.
|
/// [RefreshIndicatorMode.done] state and will start to go away.
|
||||||
typedef Future<void> RefreshCallback();
|
typedef RefreshCallback = Future<void> Function();
|
||||||
|
|
||||||
/// A sliver widget implementing the iOS-style pull to refresh content control.
|
/// A sliver widget implementing the iOS-style pull to refresh content control.
|
||||||
///
|
///
|
||||||
|
@ -6,11 +6,11 @@ import 'basic_types.dart';
|
|||||||
import 'print.dart';
|
import 'print.dart';
|
||||||
|
|
||||||
/// Signature for [FlutterError.onError] handler.
|
/// Signature for [FlutterError.onError] handler.
|
||||||
typedef void FlutterExceptionHandler(FlutterErrorDetails details);
|
typedef FlutterExceptionHandler = void Function(FlutterErrorDetails details);
|
||||||
|
|
||||||
/// Signature for [FlutterErrorDetails.informationCollector] callback
|
/// Signature for [FlutterErrorDetails.informationCollector] callback
|
||||||
/// and other callbacks that collect information into a string buffer.
|
/// and other callbacks that collect information into a string buffer.
|
||||||
typedef void InformationCollector(StringBuffer information);
|
typedef InformationCollector = void Function(StringBuffer information);
|
||||||
|
|
||||||
/// Class for information provided to [FlutterExceptionHandler] callbacks.
|
/// Class for information provided to [FlutterExceptionHandler] callbacks.
|
||||||
///
|
///
|
||||||
|
@ -12,7 +12,7 @@ export 'dart:ui' show VoidCallback;
|
|||||||
/// Signature for callbacks that report that an underlying value has changed.
|
/// Signature for callbacks that report that an underlying value has changed.
|
||||||
///
|
///
|
||||||
/// See also [ValueSetter].
|
/// See also [ValueSetter].
|
||||||
typedef void ValueChanged<T>(T value);
|
typedef ValueChanged<T> = void Function(T value);
|
||||||
|
|
||||||
/// Signature for callbacks that report that a value has been set.
|
/// Signature for callbacks that report that a value has been set.
|
||||||
///
|
///
|
||||||
@ -26,7 +26,7 @@ typedef void ValueChanged<T>(T value);
|
|||||||
///
|
///
|
||||||
/// * [ValueGetter], the getter equivalent of this signature.
|
/// * [ValueGetter], the getter equivalent of this signature.
|
||||||
/// * [AsyncValueSetter], an asynchronous version of this signature.
|
/// * [AsyncValueSetter], an asynchronous version of this signature.
|
||||||
typedef void ValueSetter<T>(T value);
|
typedef ValueSetter<T> = void Function(T value);
|
||||||
|
|
||||||
/// Signature for callbacks that are to report a value on demand.
|
/// Signature for callbacks that are to report a value on demand.
|
||||||
///
|
///
|
||||||
@ -34,10 +34,10 @@ typedef void ValueSetter<T>(T value);
|
|||||||
///
|
///
|
||||||
/// * [ValueSetter], the setter equivalent of this signature.
|
/// * [ValueSetter], the setter equivalent of this signature.
|
||||||
/// * [AsyncValueGetter], an asynchronous version of this signature.
|
/// * [AsyncValueGetter], an asynchronous version of this signature.
|
||||||
typedef T ValueGetter<T>();
|
typedef ValueGetter<T> = T Function();
|
||||||
|
|
||||||
/// Signature for callbacks that filter an iterable.
|
/// Signature for callbacks that filter an iterable.
|
||||||
typedef Iterable<T> IterableFilter<T>(Iterable<T> input);
|
typedef IterableFilter<T> = Iterable<T> Function(Iterable<T> input);
|
||||||
|
|
||||||
/// Signature of callbacks that have no arguments and return no data, but that
|
/// Signature of callbacks that have no arguments and return no data, but that
|
||||||
/// return a [Future] to indicate when their work is complete.
|
/// return a [Future] to indicate when their work is complete.
|
||||||
@ -47,7 +47,7 @@ typedef Iterable<T> IterableFilter<T>(Iterable<T> input);
|
|||||||
/// * [VoidCallback], a synchronous version of this signature.
|
/// * [VoidCallback], a synchronous version of this signature.
|
||||||
/// * [AsyncValueGetter], a signature for asynchronous getters.
|
/// * [AsyncValueGetter], a signature for asynchronous getters.
|
||||||
/// * [AsyncValueSetter], a signature for asynchronous setters.
|
/// * [AsyncValueSetter], a signature for asynchronous setters.
|
||||||
typedef Future<Null> AsyncCallback();
|
typedef AsyncCallback = Future<Null> Function();
|
||||||
|
|
||||||
/// Signature for callbacks that report that a value has been set and return a
|
/// Signature for callbacks that report that a value has been set and return a
|
||||||
/// [Future] that completes when the value has been saved.
|
/// [Future] that completes when the value has been saved.
|
||||||
@ -56,7 +56,7 @@ typedef Future<Null> AsyncCallback();
|
|||||||
///
|
///
|
||||||
/// * [ValueSetter], a synchronous version of this signature.
|
/// * [ValueSetter], a synchronous version of this signature.
|
||||||
/// * [AsyncValueGetter], the getter equivalent of this signature.
|
/// * [AsyncValueGetter], the getter equivalent of this signature.
|
||||||
typedef Future<Null> AsyncValueSetter<T>(T value);
|
typedef AsyncValueSetter<T> = Future<Null> Function(T value);
|
||||||
|
|
||||||
/// Signature for callbacks that are to asynchronously report a value on demand.
|
/// Signature for callbacks that are to asynchronously report a value on demand.
|
||||||
///
|
///
|
||||||
@ -64,7 +64,7 @@ typedef Future<Null> AsyncValueSetter<T>(T value);
|
|||||||
///
|
///
|
||||||
/// * [ValueGetter], a synchronous version of this signature.
|
/// * [ValueGetter], a synchronous version of this signature.
|
||||||
/// * [AsyncValueSetter], the setter equivalent of this signature.
|
/// * [AsyncValueSetter], the setter equivalent of this signature.
|
||||||
typedef Future<T> AsyncValueGetter<T>();
|
typedef AsyncValueGetter<T> = Future<T> Function();
|
||||||
|
|
||||||
|
|
||||||
// BITFIELD
|
// BITFIELD
|
||||||
|
@ -22,7 +22,7 @@ import 'print.dart';
|
|||||||
/// "type" key will be set to the string `_extensionType` to indicate
|
/// "type" key will be set to the string `_extensionType` to indicate
|
||||||
/// that this is a return value from a service extension, and the
|
/// that this is a return value from a service extension, and the
|
||||||
/// "method" key will be set to the full name of the method.
|
/// "method" key will be set to the full name of the method.
|
||||||
typedef Future<Map<String, dynamic>> ServiceExtensionCallback(Map<String, String> parameters);
|
typedef ServiceExtensionCallback = Future<Map<String, dynamic>> Function(Map<String, String> parameters);
|
||||||
|
|
||||||
/// Base class for mixins that provide singleton services (also known as
|
/// Base class for mixins that provide singleton services (also known as
|
||||||
/// "bindings").
|
/// "bindings").
|
||||||
|
@ -1661,7 +1661,7 @@ class ObjectFlagProperty<T> extends DiagnosticsProperty<T> {
|
|||||||
/// May throw exception if accessing the property would throw an exception
|
/// May throw exception if accessing the property would throw an exception
|
||||||
/// and callers must handle that case gracefully. For example, accessing a
|
/// and callers must handle that case gracefully. For example, accessing a
|
||||||
/// property may trigger an assert that layout constraints were violated.
|
/// property may trigger an assert that layout constraints were violated.
|
||||||
typedef T ComputePropertyValueCallback<T>();
|
typedef ComputePropertyValueCallback<T> = T Function();
|
||||||
|
|
||||||
/// Property with a [value] of type [T].
|
/// Property with a [value] of type [T].
|
||||||
///
|
///
|
||||||
|
@ -18,7 +18,7 @@ import 'profile.dart';
|
|||||||
/// of classes, not closures or instance methods of objects.
|
/// of classes, not closures or instance methods of objects.
|
||||||
///
|
///
|
||||||
/// {@macro flutter.foundation.compute.limitations}
|
/// {@macro flutter.foundation.compute.limitations}
|
||||||
typedef R ComputeCallback<Q, R>(Q message);
|
typedef ComputeCallback<Q, R> = R Function(Q message);
|
||||||
|
|
||||||
/// Spawn an isolate, run `callback` on that isolate, passing it `message`, and
|
/// Spawn an isolate, run `callback` on that isolate, passing it `message`, and
|
||||||
/// (eventually) return the value returned by `callback`.
|
/// (eventually) return the value returned by `callback`.
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
/// Signature for callbacks passed to [LicenseRegistry.addLicense].
|
/// Signature for callbacks passed to [LicenseRegistry.addLicense].
|
||||||
typedef Stream<LicenseEntry> LicenseEntryCollector();
|
typedef LicenseEntryCollector = Stream<LicenseEntry> Function();
|
||||||
|
|
||||||
/// A string that represents one paragraph in a [LicenseEntry].
|
/// A string that represents one paragraph in a [LicenseEntry].
|
||||||
///
|
///
|
||||||
|
@ -6,7 +6,7 @@ import 'dart:async';
|
|||||||
import 'dart:collection';
|
import 'dart:collection';
|
||||||
|
|
||||||
/// Signature for [debugPrint] implementations.
|
/// Signature for [debugPrint] implementations.
|
||||||
typedef void DebugPrintCallback(String message, { int wrapWidth });
|
typedef DebugPrintCallback = void Function(String message, { int wrapWidth });
|
||||||
|
|
||||||
/// Prints a message to the console, which you can access using the "flutter"
|
/// Prints a message to the console, which you can access using the "flutter"
|
||||||
/// tool's "logs" command ("flutter logs").
|
/// tool's "logs" command ("flutter logs").
|
||||||
|
@ -38,7 +38,7 @@ class DragDownDetails {
|
|||||||
/// The `details` object provides the position of the touch.
|
/// The `details` object provides the position of the touch.
|
||||||
///
|
///
|
||||||
/// See [DragGestureRecognizer.onDown].
|
/// See [DragGestureRecognizer.onDown].
|
||||||
typedef void GestureDragDownCallback(DragDownDetails details);
|
typedef GestureDragDownCallback = void Function(DragDownDetails details);
|
||||||
|
|
||||||
/// Details object for callbacks that use [GestureDragStartCallback].
|
/// Details object for callbacks that use [GestureDragStartCallback].
|
||||||
///
|
///
|
||||||
@ -80,7 +80,7 @@ class DragStartDetails {
|
|||||||
/// touched the surface.
|
/// touched the surface.
|
||||||
///
|
///
|
||||||
/// See [DragGestureRecognizer.onStart].
|
/// See [DragGestureRecognizer.onStart].
|
||||||
typedef void GestureDragStartCallback(DragStartDetails details);
|
typedef GestureDragStartCallback = void Function(DragStartDetails details);
|
||||||
|
|
||||||
/// Details object for callbacks that use [GestureDragUpdateCallback].
|
/// Details object for callbacks that use [GestureDragUpdateCallback].
|
||||||
///
|
///
|
||||||
@ -150,7 +150,7 @@ class DragUpdateDetails {
|
|||||||
/// has travelled since the last update.
|
/// has travelled since the last update.
|
||||||
///
|
///
|
||||||
/// See [DragGestureRecognizer.onUpdate].
|
/// See [DragGestureRecognizer.onUpdate].
|
||||||
typedef void GestureDragUpdateCallback(DragUpdateDetails details);
|
typedef GestureDragUpdateCallback = void Function(DragUpdateDetails details);
|
||||||
|
|
||||||
/// Details object for callbacks that use [GestureDragEndCallback].
|
/// Details object for callbacks that use [GestureDragEndCallback].
|
||||||
///
|
///
|
||||||
|
@ -9,7 +9,7 @@ import 'recognizer.dart';
|
|||||||
|
|
||||||
/// Signature for when a pointer has remained in contact with the screen at the
|
/// Signature for when a pointer has remained in contact with the screen at the
|
||||||
/// same location for a long period of time.
|
/// same location for a long period of time.
|
||||||
typedef void GestureLongPressCallback();
|
typedef GestureLongPressCallback = void Function();
|
||||||
|
|
||||||
/// Recognizes when the user has pressed down at the same location for a long
|
/// Recognizes when the user has pressed down at the same location for a long
|
||||||
/// period of time.
|
/// period of time.
|
||||||
|
@ -22,13 +22,13 @@ enum _DragState {
|
|||||||
/// the screen is available in the `details`.
|
/// the screen is available in the `details`.
|
||||||
///
|
///
|
||||||
/// See [DragGestureRecognizer.onEnd].
|
/// See [DragGestureRecognizer.onEnd].
|
||||||
typedef void GestureDragEndCallback(DragEndDetails details);
|
typedef GestureDragEndCallback = void Function(DragEndDetails details);
|
||||||
|
|
||||||
/// Signature for when the pointer that previously triggered a
|
/// Signature for when the pointer that previously triggered a
|
||||||
/// [GestureDragDownCallback] did not complete.
|
/// [GestureDragDownCallback] did not complete.
|
||||||
///
|
///
|
||||||
/// See [DragGestureRecognizer.onCancel].
|
/// See [DragGestureRecognizer.onCancel].
|
||||||
typedef void GestureDragCancelCallback();
|
typedef GestureDragCancelCallback = void Function();
|
||||||
|
|
||||||
/// Recognizes movement.
|
/// Recognizes movement.
|
||||||
///
|
///
|
||||||
|
@ -17,7 +17,7 @@ import 'recognizer.dart';
|
|||||||
import 'velocity_tracker.dart';
|
import 'velocity_tracker.dart';
|
||||||
|
|
||||||
/// Signature for when [MultiDragGestureRecognizer] recognizes the start of a drag gesture.
|
/// Signature for when [MultiDragGestureRecognizer] recognizes the start of a drag gesture.
|
||||||
typedef Drag GestureMultiDragStartCallback(Offset position);
|
typedef GestureMultiDragStartCallback = Drag Function(Offset position);
|
||||||
|
|
||||||
/// Per-pointer state for a [MultiDragGestureRecognizer].
|
/// Per-pointer state for a [MultiDragGestureRecognizer].
|
||||||
///
|
///
|
||||||
|
@ -15,22 +15,22 @@ import 'tap.dart';
|
|||||||
|
|
||||||
/// Signature for callback when the user has tapped the screen at the same
|
/// Signature for callback when the user has tapped the screen at the same
|
||||||
/// location twice in quick succession.
|
/// location twice in quick succession.
|
||||||
typedef void GestureDoubleTapCallback();
|
typedef GestureDoubleTapCallback = void Function();
|
||||||
|
|
||||||
/// Signature used by [MultiTapGestureRecognizer] for when a pointer that might
|
/// Signature used by [MultiTapGestureRecognizer] for when a pointer that might
|
||||||
/// cause a tap has contacted the screen at a particular location.
|
/// cause a tap has contacted the screen at a particular location.
|
||||||
typedef void GestureMultiTapDownCallback(int pointer, TapDownDetails details);
|
typedef GestureMultiTapDownCallback = void Function(int pointer, TapDownDetails details);
|
||||||
|
|
||||||
/// Signature used by [MultiTapGestureRecognizer] for when a pointer that will
|
/// Signature used by [MultiTapGestureRecognizer] for when a pointer that will
|
||||||
/// trigger a tap has stopped contacting the screen at a particular location.
|
/// trigger a tap has stopped contacting the screen at a particular location.
|
||||||
typedef void GestureMultiTapUpCallback(int pointer, TapUpDetails details);
|
typedef GestureMultiTapUpCallback = void Function(int pointer, TapUpDetails details);
|
||||||
|
|
||||||
/// Signature used by [MultiTapGestureRecognizer] for when a tap has occurred.
|
/// Signature used by [MultiTapGestureRecognizer] for when a tap has occurred.
|
||||||
typedef void GestureMultiTapCallback(int pointer);
|
typedef GestureMultiTapCallback = void Function(int pointer);
|
||||||
|
|
||||||
/// Signature for when the pointer that previously triggered a
|
/// Signature for when the pointer that previously triggered a
|
||||||
/// [GestureMultiTapDownCallback] will not end up causing a tap.
|
/// [GestureMultiTapDownCallback] will not end up causing a tap.
|
||||||
typedef void GestureMultiTapCancelCallback(int pointer);
|
typedef GestureMultiTapCancelCallback = void Function(int pointer);
|
||||||
|
|
||||||
/// TapTracker helps track individual tap sequences as part of a
|
/// TapTracker helps track individual tap sequences as part of a
|
||||||
/// larger gesture.
|
/// larger gesture.
|
||||||
|
@ -9,7 +9,7 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'events.dart';
|
import 'events.dart';
|
||||||
|
|
||||||
/// A callback that receives a [PointerEvent]
|
/// A callback that receives a [PointerEvent]
|
||||||
typedef void PointerRoute(PointerEvent event);
|
typedef PointerRoute = void Function(PointerEvent event);
|
||||||
|
|
||||||
/// A routing table for [PointerEvent] events.
|
/// A routing table for [PointerEvent] events.
|
||||||
class PointerRouter {
|
class PointerRouter {
|
||||||
|
@ -22,7 +22,7 @@ export 'pointer_router.dart' show PointerRouter;
|
|||||||
/// [GestureRecognizer.invokeCallback]. This allows the
|
/// [GestureRecognizer.invokeCallback]. This allows the
|
||||||
/// [GestureRecognizer.invokeCallback] mechanism to be generically used with
|
/// [GestureRecognizer.invokeCallback] mechanism to be generically used with
|
||||||
/// anonymous functions that return objects of particular types.
|
/// anonymous functions that return objects of particular types.
|
||||||
typedef T RecognizerCallback<T>();
|
typedef RecognizerCallback<T> = T Function();
|
||||||
|
|
||||||
/// The base class that all gesture recognizers inherit from.
|
/// The base class that all gesture recognizers inherit from.
|
||||||
///
|
///
|
||||||
|
@ -84,14 +84,14 @@ class ScaleEndDetails {
|
|||||||
|
|
||||||
/// Signature for when the pointers in contact with the screen have established
|
/// Signature for when the pointers in contact with the screen have established
|
||||||
/// a focal point and initial scale of 1.0.
|
/// a focal point and initial scale of 1.0.
|
||||||
typedef void GestureScaleStartCallback(ScaleStartDetails details);
|
typedef GestureScaleStartCallback = void Function(ScaleStartDetails details);
|
||||||
|
|
||||||
/// Signature for when the pointers in contact with the screen have indicated a
|
/// Signature for when the pointers in contact with the screen have indicated a
|
||||||
/// new focal point and/or scale.
|
/// new focal point and/or scale.
|
||||||
typedef void GestureScaleUpdateCallback(ScaleUpdateDetails details);
|
typedef GestureScaleUpdateCallback = void Function(ScaleUpdateDetails details);
|
||||||
|
|
||||||
/// Signature for when the pointers are no longer in contact with the screen.
|
/// Signature for when the pointers are no longer in contact with the screen.
|
||||||
typedef void GestureScaleEndCallback(ScaleEndDetails details);
|
typedef GestureScaleEndCallback = void Function(ScaleEndDetails details);
|
||||||
|
|
||||||
bool _isFlingGesture(Velocity velocity) {
|
bool _isFlingGesture(Velocity velocity) {
|
||||||
assert(velocity != null);
|
assert(velocity != null);
|
||||||
|
@ -26,7 +26,7 @@ class TapDownDetails {
|
|||||||
///
|
///
|
||||||
/// The position at which the pointer contacted the screen is available in the
|
/// The position at which the pointer contacted the screen is available in the
|
||||||
/// `details`.
|
/// `details`.
|
||||||
typedef void GestureTapDownCallback(TapDownDetails details);
|
typedef GestureTapDownCallback = void Function(TapDownDetails details);
|
||||||
|
|
||||||
/// Details for [GestureTapUpCallback], such as position.
|
/// Details for [GestureTapUpCallback], such as position.
|
||||||
class TapUpDetails {
|
class TapUpDetails {
|
||||||
@ -45,14 +45,14 @@ class TapUpDetails {
|
|||||||
///
|
///
|
||||||
/// The position at which the pointer stopped contacting the screen is available
|
/// The position at which the pointer stopped contacting the screen is available
|
||||||
/// in the `details`.
|
/// in the `details`.
|
||||||
typedef void GestureTapUpCallback(TapUpDetails details);
|
typedef GestureTapUpCallback = void Function(TapUpDetails details);
|
||||||
|
|
||||||
/// Signature for when a tap has occurred.
|
/// Signature for when a tap has occurred.
|
||||||
typedef void GestureTapCallback();
|
typedef GestureTapCallback = void Function();
|
||||||
|
|
||||||
/// Signature for when the pointer that previously triggered a
|
/// Signature for when the pointer that previously triggered a
|
||||||
/// [GestureTapDownCallback] will not end up causing a tap.
|
/// [GestureTapDownCallback] will not end up causing a tap.
|
||||||
typedef void GestureTapCancelCallback();
|
typedef GestureTapCancelCallback = void Function();
|
||||||
|
|
||||||
/// Recognizes taps.
|
/// Recognizes taps.
|
||||||
///
|
///
|
||||||
|
@ -125,7 +125,7 @@ class AnimatedIcon extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef ui.Path _UiPathFactory();
|
typedef _UiPathFactory = ui.Path Function();
|
||||||
|
|
||||||
class _AnimatedIconPainter extends CustomPainter {
|
class _AnimatedIconPainter extends CustomPainter {
|
||||||
_AnimatedIconPainter({
|
_AnimatedIconPainter({
|
||||||
@ -296,4 +296,4 @@ T _interpolate<T>(List<T> values, double progress, _Interpolator<T> interpolator
|
|||||||
return interpolator(values[lowIdx], values[highIdx], t);
|
return interpolator(values[lowIdx], values[highIdx], t);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef T _Interpolator<T>(T a, T b, double progress);
|
typedef _Interpolator<T> = T Function(T a, T b, double progress);
|
||||||
|
@ -193,7 +193,7 @@ const List<_Diagonal> _allDiagonals = const <_Diagonal>[
|
|||||||
const _Diagonal(_CornerId.bottomLeft, _CornerId.topRight),
|
const _Diagonal(_CornerId.bottomLeft, _CornerId.topRight),
|
||||||
];
|
];
|
||||||
|
|
||||||
typedef dynamic _KeyFunc<T>(T input);
|
typedef _KeyFunc<T> = dynamic Function(T input);
|
||||||
|
|
||||||
// Select the element for which the key function returns the maximum value.
|
// Select the element for which the key function returns the maximum value.
|
||||||
T _maxBy<T>(Iterable<T> input, _KeyFunc<T> keyFunc) {
|
T _maxBy<T>(Iterable<T> input, _KeyFunc<T> keyFunc) {
|
||||||
|
@ -21,7 +21,7 @@ import 'theme_data.dart';
|
|||||||
import 'tooltip.dart';
|
import 'tooltip.dart';
|
||||||
|
|
||||||
/// Signature for [DataColumn.onSort] callback.
|
/// Signature for [DataColumn.onSort] callback.
|
||||||
typedef void DataColumnSortCallback(int columnIndex, bool ascending);
|
typedef DataColumnSortCallback = void Function(int columnIndex, bool ascending);
|
||||||
|
|
||||||
/// Column configuration for a [DataTable].
|
/// Column configuration for a [DataTable].
|
||||||
///
|
///
|
||||||
|
@ -1008,7 +1008,7 @@ class _DatePickerDialogState extends State<_DatePickerDialog> {
|
|||||||
/// Signature for predicating dates for enabled date selections.
|
/// Signature for predicating dates for enabled date selections.
|
||||||
///
|
///
|
||||||
/// See [showDatePicker].
|
/// See [showDatePicker].
|
||||||
typedef bool SelectableDayPredicate(DateTime day);
|
typedef SelectableDayPredicate = bool Function(DateTime day);
|
||||||
|
|
||||||
/// Shows a dialog containing a material design date picker.
|
/// Shows a dialog containing a material design date picker.
|
||||||
///
|
///
|
||||||
|
@ -43,11 +43,11 @@ class _SaltedKey<S, V> extends LocalKey {
|
|||||||
///
|
///
|
||||||
/// The position of the panel within an [ExpansionPanelList] is given by
|
/// The position of the panel within an [ExpansionPanelList] is given by
|
||||||
/// [panelIndex].
|
/// [panelIndex].
|
||||||
typedef void ExpansionPanelCallback(int panelIndex, bool isExpanded);
|
typedef ExpansionPanelCallback = void Function(int panelIndex, bool isExpanded);
|
||||||
|
|
||||||
/// Signature for the callback that's called when the header of the
|
/// Signature for the callback that's called when the header of the
|
||||||
/// [ExpansionPanel] needs to rebuild.
|
/// [ExpansionPanel] needs to rebuild.
|
||||||
typedef Widget ExpansionPanelHeaderBuilder(BuildContext context, bool isExpanded);
|
typedef ExpansionPanelHeaderBuilder = Widget Function(BuildContext context, bool isExpanded);
|
||||||
|
|
||||||
/// A material expansion panel. It has a header and a body and can be either
|
/// A material expansion panel. It has a header and a body and can be either
|
||||||
/// expanded or collapsed. The body of the panel is only visible when it is
|
/// expanded or collapsed. The body of the panel is only visible when it is
|
||||||
|
@ -12,7 +12,7 @@ import 'theme.dart';
|
|||||||
/// Signature for the callback used by ink effects to obtain the rectangle for the effect.
|
/// Signature for the callback used by ink effects to obtain the rectangle for the effect.
|
||||||
///
|
///
|
||||||
/// Used by [InkHighlight] and [InkSplash], for example.
|
/// Used by [InkHighlight] and [InkSplash], for example.
|
||||||
typedef Rect RectCallback();
|
typedef RectCallback = Rect Function();
|
||||||
|
|
||||||
/// The various kinds of material in material design. Used to
|
/// The various kinds of material in material design. Used to
|
||||||
/// configure the default behavior of [Material] widgets.
|
/// configure the default behavior of [Material] widgets.
|
||||||
|
@ -739,19 +739,19 @@ Future<T> showMenu<T>({
|
|||||||
/// dismissed.
|
/// dismissed.
|
||||||
///
|
///
|
||||||
/// Used by [PopupMenuButton.onSelected].
|
/// Used by [PopupMenuButton.onSelected].
|
||||||
typedef void PopupMenuItemSelected<T>(T value);
|
typedef PopupMenuItemSelected<T> = void Function(T value);
|
||||||
|
|
||||||
/// Signature for the callback invoked when a [PopupMenuButton] is dismissed
|
/// Signature for the callback invoked when a [PopupMenuButton] is dismissed
|
||||||
/// without selecting an item.
|
/// without selecting an item.
|
||||||
///
|
///
|
||||||
/// Used by [PopupMenuButton.onCanceled].
|
/// Used by [PopupMenuButton.onCanceled].
|
||||||
typedef void PopupMenuCanceled();
|
typedef PopupMenuCanceled = void Function();
|
||||||
|
|
||||||
/// Signature used by [PopupMenuButton] to lazily construct the items shown when
|
/// Signature used by [PopupMenuButton] to lazily construct the items shown when
|
||||||
/// the button is pressed.
|
/// the button is pressed.
|
||||||
///
|
///
|
||||||
/// Used by [PopupMenuButton.itemBuilder].
|
/// Used by [PopupMenuButton.itemBuilder].
|
||||||
typedef List<PopupMenuEntry<T>> PopupMenuItemBuilder<T>(BuildContext context);
|
typedef PopupMenuItemBuilder<T> = List<PopupMenuEntry<T>> Function(BuildContext context);
|
||||||
|
|
||||||
/// Displays a menu when pressed and calls [onSelected] when the menu is dismissed
|
/// Displays a menu when pressed and calls [onSelected] when the menu is dismissed
|
||||||
/// because an item was selected. The value passed to [onSelected] is the value of
|
/// because an item was selected. The value passed to [onSelected] is the value of
|
||||||
|
@ -32,7 +32,7 @@ const Duration _kIndicatorScaleDuration = const Duration(milliseconds: 200);
|
|||||||
/// finished.
|
/// finished.
|
||||||
///
|
///
|
||||||
/// Used by [RefreshIndicator.onRefresh].
|
/// Used by [RefreshIndicator.onRefresh].
|
||||||
typedef Future<Null> RefreshCallback();
|
typedef RefreshCallback = Future<Null> Function();
|
||||||
|
|
||||||
// The state machine moves through these modes only when the scrollable
|
// The state machine moves through these modes only when the scrollable
|
||||||
// identified by scrollableKey has been scrolled to its min or max limit.
|
// identified by scrollableKey has been scrolled to its min or max limit.
|
||||||
|
@ -43,7 +43,7 @@ const FloatingActionButtonAnimator _kDefaultFloatingActionButtonAnimator = Float
|
|||||||
/// not end with a [Path.close]. The returned [Path] is built under the
|
/// not end with a [Path.close]. The returned [Path] is built under the
|
||||||
/// assumption it will be added to an existing path that is at the `start`
|
/// assumption it will be added to an existing path that is at the `start`
|
||||||
/// coordinates using [Path.addPath].
|
/// coordinates using [Path.addPath].
|
||||||
typedef Path ComputeNotch(Rect host, Rect guest, Offset start, Offset end);
|
typedef ComputeNotch = Path Function(Rect host, Rect guest, Offset start, Offset end);
|
||||||
|
|
||||||
enum _ScaffoldSlot {
|
enum _ScaffoldSlot {
|
||||||
body,
|
body,
|
||||||
|
@ -26,7 +26,7 @@ import 'theme.dart';
|
|||||||
/// See also:
|
/// See also:
|
||||||
///
|
///
|
||||||
/// * [Slider.semanticFormatterCallback], which shows an example use case.
|
/// * [Slider.semanticFormatterCallback], which shows an example use case.
|
||||||
typedef String SemanticFormatterCallback(double value);
|
typedef SemanticFormatterCallback = String Function(double value);
|
||||||
|
|
||||||
/// A Material Design slider.
|
/// A Material Design slider.
|
||||||
///
|
///
|
||||||
|
@ -174,7 +174,7 @@ class _TabStyle extends AnimatedWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void _LayoutCallback(List<double> xOffsets, TextDirection textDirection, double width);
|
typedef _LayoutCallback = void Function(List<double> xOffsets, TextDirection textDirection, double width);
|
||||||
|
|
||||||
class _TabLabelBarRenderer extends RenderFlex {
|
class _TabLabelBarRenderer extends RenderFlex {
|
||||||
_TabLabelBarRenderer({
|
_TabLabelBarRenderer({
|
||||||
|
@ -66,7 +66,7 @@ class ImageInfo {
|
|||||||
/// frame is requested if the call was asynchronous (after the current frame)
|
/// frame is requested if the call was asynchronous (after the current frame)
|
||||||
/// and no rendering frame is requested if the call was synchronous (within the
|
/// and no rendering frame is requested if the call was synchronous (within the
|
||||||
/// same stack frame as the call to [ImageStream.addListener]).
|
/// same stack frame as the call to [ImageStream.addListener]).
|
||||||
typedef void ImageListener(ImageInfo image, bool synchronousCall);
|
typedef ImageListener = void Function(ImageInfo image, bool synchronousCall);
|
||||||
|
|
||||||
/// A handle to an image resource.
|
/// A handle to an image resource.
|
||||||
///
|
///
|
||||||
|
@ -22,7 +22,7 @@ import 'proxy_box.dart';
|
|||||||
/// The returned list must not be mutated after this function completes. To
|
/// The returned list must not be mutated after this function completes. To
|
||||||
/// change the semantic information, the function must return a new list
|
/// change the semantic information, the function must return a new list
|
||||||
/// instead.
|
/// instead.
|
||||||
typedef List<CustomPainterSemantics> SemanticsBuilderCallback(Size size);
|
typedef SemanticsBuilderCallback = List<CustomPainterSemantics> Function(Size size);
|
||||||
|
|
||||||
/// The interface used by [CustomPaint] (in the widgets library) and
|
/// The interface used by [CustomPaint] (in the widgets library) and
|
||||||
/// [RenderCustomPaint] (in the rendering library).
|
/// [RenderCustomPaint] (in the rendering library).
|
||||||
|
@ -22,7 +22,7 @@ const double _kCaretWidth = 1.0; // pixels
|
|||||||
/// (including the cursor location).
|
/// (including the cursor location).
|
||||||
///
|
///
|
||||||
/// Used by [RenderEditable.onSelectionChanged].
|
/// Used by [RenderEditable.onSelectionChanged].
|
||||||
typedef void SelectionChangedHandler(TextSelection selection, RenderEditable renderObject, SelectionChangedCause cause);
|
typedef SelectionChangedHandler = void Function(TextSelection selection, RenderEditable renderObject, SelectionChangedCause cause);
|
||||||
|
|
||||||
/// Indicates what triggered the change in selected text (including changes to
|
/// Indicates what triggered the change in selected text (including changes to
|
||||||
/// the cursor location).
|
/// the cursor location).
|
||||||
@ -46,7 +46,7 @@ enum SelectionChangedCause {
|
|||||||
/// Signature for the callback that reports when the caret location changes.
|
/// Signature for the callback that reports when the caret location changes.
|
||||||
///
|
///
|
||||||
/// Used by [RenderEditable.onCaretChanged].
|
/// Used by [RenderEditable.onCaretChanged].
|
||||||
typedef void CaretChangedHandler(Rect caretRect);
|
typedef CaretChangedHandler = void Function(Rect caretRect);
|
||||||
|
|
||||||
/// Represents the coordinates of the point in a selection, and the text
|
/// Represents the coordinates of the point in a selection, and the text
|
||||||
/// direction at that point, relative to top left of the [RenderEditable] that
|
/// direction at that point, relative to top left of the [RenderEditable] that
|
||||||
|
@ -212,7 +212,7 @@ bool _startIsTopLeft(Axis direction, TextDirection textDirection, VerticalDirect
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef double _ChildSizingFunction(RenderBox child, double extent);
|
typedef _ChildSizingFunction = double Function(RenderBox child, double extent);
|
||||||
|
|
||||||
/// Displays its children in a one-dimensional array.
|
/// Displays its children in a one-dimensional array.
|
||||||
///
|
///
|
||||||
|
@ -10,7 +10,7 @@ import 'object.dart';
|
|||||||
/// Parent data for use with [RenderListBody].
|
/// Parent data for use with [RenderListBody].
|
||||||
class ListBodyParentData extends ContainerBoxParentData<RenderBox> { }
|
class ListBodyParentData extends ContainerBoxParentData<RenderBox> { }
|
||||||
|
|
||||||
typedef double _ChildSizingFunction(RenderBox child);
|
typedef _ChildSizingFunction = double Function(RenderBox child);
|
||||||
|
|
||||||
/// Displays its children sequentially along a given axis, forcing them to the
|
/// Displays its children sequentially along a given axis, forcing them to the
|
||||||
/// dimensions of the parent in the other axis.
|
/// dimensions of the parent in the other axis.
|
||||||
|
@ -13,7 +13,7 @@ import 'object.dart';
|
|||||||
import 'viewport.dart';
|
import 'viewport.dart';
|
||||||
import 'viewport_offset.dart';
|
import 'viewport_offset.dart';
|
||||||
|
|
||||||
typedef double _ChildSizingFunction(RenderBox child);
|
typedef _ChildSizingFunction = double Function(RenderBox child);
|
||||||
|
|
||||||
/// [ParentData] for use with [RenderListWheelViewport].
|
/// [ParentData] for use with [RenderListWheelViewport].
|
||||||
class ListWheelParentData extends ContainerBoxParentData<RenderBox> { }
|
class ListWheelParentData extends ContainerBoxParentData<RenderBox> { }
|
||||||
|
@ -42,7 +42,7 @@ class ParentData {
|
|||||||
/// of the [PaintingContext.canvas] to the coordinate system of the callee.
|
/// of the [PaintingContext.canvas] to the coordinate system of the callee.
|
||||||
///
|
///
|
||||||
/// Used by many of the methods of [PaintingContext].
|
/// Used by many of the methods of [PaintingContext].
|
||||||
typedef void PaintingContextCallback(PaintingContext context, Offset offset);
|
typedef PaintingContextCallback = void Function(PaintingContext context, Offset offset);
|
||||||
|
|
||||||
/// A place to paint.
|
/// A place to paint.
|
||||||
///
|
///
|
||||||
@ -531,12 +531,12 @@ abstract class Constraints {
|
|||||||
/// Signature for a function that is called for each [RenderObject].
|
/// Signature for a function that is called for each [RenderObject].
|
||||||
///
|
///
|
||||||
/// Used by [RenderObject.visitChildren] and [RenderObject.visitChildrenForSemantics].
|
/// Used by [RenderObject.visitChildren] and [RenderObject.visitChildrenForSemantics].
|
||||||
typedef void RenderObjectVisitor(RenderObject child);
|
typedef RenderObjectVisitor = void Function(RenderObject child);
|
||||||
|
|
||||||
/// Signature for a function that is called during layout.
|
/// Signature for a function that is called during layout.
|
||||||
///
|
///
|
||||||
/// Used by [RenderObject.invokeLayoutCallback].
|
/// Used by [RenderObject.invokeLayoutCallback].
|
||||||
typedef void LayoutCallback<T extends Constraints>(T constraints);
|
typedef LayoutCallback<T extends Constraints> = void Function(T constraints);
|
||||||
|
|
||||||
/// A reference to the semantics tree.
|
/// A reference to the semantics tree.
|
||||||
///
|
///
|
||||||
|
@ -876,7 +876,7 @@ class RenderAnimatedOpacity extends RenderProxyBox {
|
|||||||
/// Signature for a function that creates a [Shader] for a given [Rect].
|
/// Signature for a function that creates a [Shader] for a given [Rect].
|
||||||
///
|
///
|
||||||
/// Used by [RenderShaderMask] and the [ShaderMask] widget.
|
/// Used by [RenderShaderMask] and the [ShaderMask] widget.
|
||||||
typedef Shader ShaderCallback(Rect bounds);
|
typedef ShaderCallback = Shader Function(Rect bounds);
|
||||||
|
|
||||||
/// Applies a mask generated by a [Shader] to its child.
|
/// Applies a mask generated by a [Shader] to its child.
|
||||||
///
|
///
|
||||||
@ -2390,22 +2390,22 @@ class RenderFractionalTranslation extends RenderProxyBox {
|
|||||||
/// Signature for listening to [PointerDownEvent] events.
|
/// Signature for listening to [PointerDownEvent] events.
|
||||||
///
|
///
|
||||||
/// Used by [Listener] and [RenderPointerListener].
|
/// Used by [Listener] and [RenderPointerListener].
|
||||||
typedef void PointerDownEventListener(PointerDownEvent event);
|
typedef PointerDownEventListener = void Function(PointerDownEvent event);
|
||||||
|
|
||||||
/// Signature for listening to [PointerMoveEvent] events.
|
/// Signature for listening to [PointerMoveEvent] events.
|
||||||
///
|
///
|
||||||
/// Used by [Listener] and [RenderPointerListener].
|
/// Used by [Listener] and [RenderPointerListener].
|
||||||
typedef void PointerMoveEventListener(PointerMoveEvent event);
|
typedef PointerMoveEventListener = void Function(PointerMoveEvent event);
|
||||||
|
|
||||||
/// Signature for listening to [PointerUpEvent] events.
|
/// Signature for listening to [PointerUpEvent] events.
|
||||||
///
|
///
|
||||||
/// Used by [Listener] and [RenderPointerListener].
|
/// Used by [Listener] and [RenderPointerListener].
|
||||||
typedef void PointerUpEventListener(PointerUpEvent event);
|
typedef PointerUpEventListener = void Function(PointerUpEvent event);
|
||||||
|
|
||||||
/// Signature for listening to [PointerCancelEvent] events.
|
/// Signature for listening to [PointerCancelEvent] events.
|
||||||
///
|
///
|
||||||
/// Used by [Listener] and [RenderPointerListener].
|
/// Used by [Listener] and [RenderPointerListener].
|
||||||
typedef void PointerCancelEventListener(PointerCancelEvent event);
|
typedef PointerCancelEventListener = void Function(PointerCancelEvent event);
|
||||||
|
|
||||||
/// Calls callbacks in response to pointer events.
|
/// Calls callbacks in response to pointer events.
|
||||||
///
|
///
|
||||||
|
@ -39,13 +39,13 @@ set timeDilation(double value) {
|
|||||||
/// scheduler's epoch. Use timeStamp to determine how far to advance animation
|
/// scheduler's epoch. Use timeStamp to determine how far to advance animation
|
||||||
/// timelines so that all the animations in the system are synchronized to a
|
/// timelines so that all the animations in the system are synchronized to a
|
||||||
/// common time base.
|
/// common time base.
|
||||||
typedef void FrameCallback(Duration timeStamp);
|
typedef FrameCallback = void Function(Duration timeStamp);
|
||||||
|
|
||||||
/// Signature for [Scheduler.scheduleTask] callbacks.
|
/// Signature for [Scheduler.scheduleTask] callbacks.
|
||||||
///
|
///
|
||||||
/// The type argument `T` is the task's return value. Consider [void] if the
|
/// The type argument `T` is the task's return value. Consider [void] if the
|
||||||
/// task does not return a value.
|
/// task does not return a value.
|
||||||
typedef T TaskCallback<T>();
|
typedef TaskCallback<T> = T Function();
|
||||||
|
|
||||||
/// Signature for the [SchedulerBinding.schedulingStrategy] callback. Called
|
/// Signature for the [SchedulerBinding.schedulingStrategy] callback. Called
|
||||||
/// whenever the system needs to decide whether a task at a given
|
/// whenever the system needs to decide whether a task at a given
|
||||||
@ -55,7 +55,7 @@ typedef T TaskCallback<T>();
|
|||||||
/// at this time, false otherwise.
|
/// at this time, false otherwise.
|
||||||
///
|
///
|
||||||
/// See also [defaultSchedulingStrategy].
|
/// See also [defaultSchedulingStrategy].
|
||||||
typedef bool SchedulingStrategy({ int priority, SchedulerBinding scheduler });
|
typedef SchedulingStrategy = bool Function({ int priority, SchedulerBinding scheduler });
|
||||||
|
|
||||||
class _TaskEntry<T> {
|
class _TaskEntry<T> {
|
||||||
_TaskEntry(this.task, this.priority, this.debugLabel, this.flow) {
|
_TaskEntry(this.task, this.priority, this.debugLabel, this.flow) {
|
||||||
|
@ -12,7 +12,7 @@ import 'binding.dart';
|
|||||||
///
|
///
|
||||||
/// The argument is the time that the object had spent enabled so far
|
/// The argument is the time that the object had spent enabled so far
|
||||||
/// at the time of the callback being called.
|
/// at the time of the callback being called.
|
||||||
typedef void TickerCallback(Duration elapsed);
|
typedef TickerCallback = void Function(Duration elapsed);
|
||||||
|
|
||||||
/// An interface implemented by classes that can vend [Ticker] objects.
|
/// An interface implemented by classes that can vend [Ticker] objects.
|
||||||
///
|
///
|
||||||
|
@ -23,19 +23,19 @@ export 'semantics_event.dart';
|
|||||||
/// Return false to stop visiting nodes.
|
/// Return false to stop visiting nodes.
|
||||||
///
|
///
|
||||||
/// Used by [SemanticsNode.visitChildren].
|
/// Used by [SemanticsNode.visitChildren].
|
||||||
typedef bool SemanticsNodeVisitor(SemanticsNode node);
|
typedef SemanticsNodeVisitor = bool Function(SemanticsNode node);
|
||||||
|
|
||||||
/// Signature for [SemanticsAction]s that move the cursor.
|
/// Signature for [SemanticsAction]s that move the cursor.
|
||||||
///
|
///
|
||||||
/// If `extendSelection` is set to true the cursor movement should extend the
|
/// If `extendSelection` is set to true the cursor movement should extend the
|
||||||
/// current selection or (if nothing is currently selected) start a selection.
|
/// current selection or (if nothing is currently selected) start a selection.
|
||||||
typedef void MoveCursorHandler(bool extendSelection);
|
typedef MoveCursorHandler = void Function(bool extendSelection);
|
||||||
|
|
||||||
/// Signature for the [SemanticsAction.setSelection] handlers to change the
|
/// Signature for the [SemanticsAction.setSelection] handlers to change the
|
||||||
/// text selection (or re-position the cursor) to `selection`.
|
/// text selection (or re-position the cursor) to `selection`.
|
||||||
typedef void SetSelectionHandler(TextSelection selection);
|
typedef SetSelectionHandler = void Function(TextSelection selection);
|
||||||
|
|
||||||
typedef void _SemanticsActionHandler(dynamic args);
|
typedef _SemanticsActionHandler = void Function(dynamic args);
|
||||||
|
|
||||||
/// A tag for a [SemanticsNode].
|
/// A tag for a [SemanticsNode].
|
||||||
///
|
///
|
||||||
|
@ -10,7 +10,7 @@ import 'package:flutter/foundation.dart';
|
|||||||
|
|
||||||
import 'platform_channel.dart';
|
import 'platform_channel.dart';
|
||||||
|
|
||||||
typedef Future<ByteData> _MessageHandler(ByteData message);
|
typedef _MessageHandler = Future<ByteData> Function(ByteData message);
|
||||||
|
|
||||||
/// Sends binary messages to and receives binary messages from platform plugins.
|
/// Sends binary messages to and receives binary messages from platform plugins.
|
||||||
///
|
///
|
||||||
|
@ -53,7 +53,7 @@ abstract class TextInputFormatter {
|
|||||||
|
|
||||||
/// Function signature expected for creating custom [TextInputFormatter]
|
/// Function signature expected for creating custom [TextInputFormatter]
|
||||||
/// shorthands via [TextInputFormatter.withFunction];
|
/// shorthands via [TextInputFormatter.withFunction];
|
||||||
typedef TextEditingValue TextInputFormatFunction(
|
typedef TextInputFormatFunction = TextEditingValue Function(
|
||||||
TextEditingValue oldValue,
|
TextEditingValue oldValue,
|
||||||
TextEditingValue newValue,
|
TextEditingValue newValue,
|
||||||
);
|
);
|
||||||
|
@ -57,7 +57,7 @@ enum CrossFadeState {
|
|||||||
/// );
|
/// );
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
typedef Widget AnimatedCrossFadeBuilder(Widget topChild, Key topChildKey, Widget bottomChild, Key bottomChildKey);
|
typedef AnimatedCrossFadeBuilder = Widget Function(Widget topChild, Key topChildKey, Widget bottomChild, Key bottomChildKey);
|
||||||
|
|
||||||
/// A widget that cross-fades between two given children and animates itself
|
/// A widget that cross-fades between two given children and animates itself
|
||||||
/// between their sizes.
|
/// between their sizes.
|
||||||
|
@ -14,10 +14,10 @@ import 'scroll_view.dart';
|
|||||||
import 'ticker_provider.dart';
|
import 'ticker_provider.dart';
|
||||||
|
|
||||||
/// Signature for the builder callback used by [AnimatedList].
|
/// Signature for the builder callback used by [AnimatedList].
|
||||||
typedef Widget AnimatedListItemBuilder(BuildContext context, int index, Animation<double> animation);
|
typedef AnimatedListItemBuilder = Widget Function(BuildContext context, int index, Animation<double> animation);
|
||||||
|
|
||||||
/// Signature for the builder callback used by [AnimatedListState.removeItem].
|
/// Signature for the builder callback used by [AnimatedListState.removeItem].
|
||||||
typedef Widget AnimatedListRemovedItemBuilder(BuildContext context, Animation<double> animation);
|
typedef AnimatedListRemovedItemBuilder = Widget Function(BuildContext context, Animation<double> animation);
|
||||||
|
|
||||||
// The default insert/remove animation duration.
|
// The default insert/remove animation duration.
|
||||||
const Duration _kDuration = const Duration(milliseconds: 300);
|
const Duration _kDuration = const Duration(milliseconds: 300);
|
||||||
|
@ -43,7 +43,7 @@ class _AnimatedSwitcherChildEntry {
|
|||||||
///
|
///
|
||||||
/// The function should return a widget which wraps the given `child`. It may
|
/// The function should return a widget which wraps the given `child`. It may
|
||||||
/// also use the `animation` to inform its transition. It must not return null.
|
/// also use the `animation` to inform its transition. It must not return null.
|
||||||
typedef Widget AnimatedSwitcherTransitionBuilder(Widget child, Animation<double> animation);
|
typedef AnimatedSwitcherTransitionBuilder = Widget Function(Widget child, Animation<double> animation);
|
||||||
|
|
||||||
/// Signature for builders used to generate custom layouts for
|
/// Signature for builders used to generate custom layouts for
|
||||||
/// [AnimatedSwitcher].
|
/// [AnimatedSwitcher].
|
||||||
@ -55,7 +55,7 @@ typedef Widget AnimatedSwitcherTransitionBuilder(Widget child, Animation<double>
|
|||||||
/// The `previousChildren` list is an unmodifiable list, sorted with the oldest
|
/// The `previousChildren` list is an unmodifiable list, sorted with the oldest
|
||||||
/// at the beginning and the newest at the end. It does not include the
|
/// at the beginning and the newest at the end. It does not include the
|
||||||
/// `currentChild`.
|
/// `currentChild`.
|
||||||
typedef Widget AnimatedSwitcherLayoutBuilder(Widget currentChild, List<Widget> previousChildren);
|
typedef AnimatedSwitcherLayoutBuilder = Widget Function(Widget currentChild, List<Widget> previousChildren);
|
||||||
|
|
||||||
/// A widget that by default does a [FadeTransition] between a new widget and
|
/// A widget that by default does a [FadeTransition] between a new widget and
|
||||||
/// the widget previously set on the [AnimatedSwitcher] as a child.
|
/// the widget previously set on the [AnimatedSwitcher] as a child.
|
||||||
|
@ -31,7 +31,7 @@ export 'dart:ui' show Locale;
|
|||||||
/// The `locale` is the device's locale when the app started, or the device
|
/// The `locale` is the device's locale when the app started, or the device
|
||||||
/// locale the user selected after the app was started. The `supportedLocales`
|
/// locale the user selected after the app was started. The `supportedLocales`
|
||||||
/// parameter is just the value of [WidgetsApp.supportedLocales].
|
/// parameter is just the value of [WidgetsApp.supportedLocales].
|
||||||
typedef Locale LocaleResolutionCallback(Locale locale, Iterable<Locale> supportedLocales);
|
typedef LocaleResolutionCallback = Locale Function(Locale locale, Iterable<Locale> supportedLocales);
|
||||||
|
|
||||||
/// The signature of [WidgetsApp.onGenerateTitle].
|
/// The signature of [WidgetsApp.onGenerateTitle].
|
||||||
///
|
///
|
||||||
@ -41,7 +41,7 @@ typedef Locale LocaleResolutionCallback(Locale locale, Iterable<Locale> supporte
|
|||||||
/// localized title.
|
/// localized title.
|
||||||
///
|
///
|
||||||
/// This function must not return null.
|
/// This function must not return null.
|
||||||
typedef String GenerateAppTitle(BuildContext context);
|
typedef GenerateAppTitle = String Function(BuildContext context);
|
||||||
|
|
||||||
/// A convenience class that wraps a number of widgets that are commonly
|
/// A convenience class that wraps a number of widgets that are commonly
|
||||||
/// required for an application.
|
/// required for an application.
|
||||||
|
@ -288,7 +288,7 @@ class AsyncSnapshot<T> {
|
|||||||
/// itself based on a snapshot from interacting with a [Stream].
|
/// itself based on a snapshot from interacting with a [Stream].
|
||||||
/// * [FutureBuilder], which delegates to an [AsyncWidgetBuilder] to build
|
/// * [FutureBuilder], which delegates to an [AsyncWidgetBuilder] to build
|
||||||
/// itself based on a snapshot from interacting with a [Future].
|
/// itself based on a snapshot from interacting with a [Future].
|
||||||
typedef Widget AsyncWidgetBuilder<T>(BuildContext context, AsyncSnapshot<T> snapshot);
|
typedef AsyncWidgetBuilder<T> = Widget Function(BuildContext context, AsyncSnapshot<T> snapshot);
|
||||||
|
|
||||||
/// Widget that builds itself based on the latest snapshot of interaction with
|
/// Widget that builds itself based on the latest snapshot of interaction with
|
||||||
/// a [Stream].
|
/// a [Stream].
|
||||||
|
@ -5402,7 +5402,7 @@ class Builder extends StatelessWidget {
|
|||||||
/// Signature for the builder callback used by [StatefulBuilder].
|
/// Signature for the builder callback used by [StatefulBuilder].
|
||||||
///
|
///
|
||||||
/// Call [setState] to schedule the [StatefulBuilder] to rebuild.
|
/// Call [setState] to schedule the [StatefulBuilder] to rebuild.
|
||||||
typedef Widget StatefulWidgetBuilder(BuildContext context, StateSetter setState);
|
typedef StatefulWidgetBuilder = Widget Function(BuildContext context, StateSetter setState);
|
||||||
|
|
||||||
/// A platonic widget that both has state and calls a closure to obtain its child widget.
|
/// A platonic widget that both has state and calls a closure to obtain its child widget.
|
||||||
///
|
///
|
||||||
|
@ -20,7 +20,7 @@ const double _kDismissThreshold = 0.4;
|
|||||||
/// the given `direction`.
|
/// the given `direction`.
|
||||||
///
|
///
|
||||||
/// Used by [Dismissible.onDismissed].
|
/// Used by [Dismissible.onDismissed].
|
||||||
typedef void DismissDirectionCallback(DismissDirection direction);
|
typedef DismissDirectionCallback = void Function(DismissDirection direction);
|
||||||
|
|
||||||
/// The direction in which a [Dismissible] can be dismissed.
|
/// The direction in which a [Dismissible] can be dismissed.
|
||||||
enum DismissDirection {
|
enum DismissDirection {
|
||||||
|
@ -14,12 +14,12 @@ import 'overlay.dart';
|
|||||||
/// Signature for determining whether the given data will be accepted by a [DragTarget].
|
/// Signature for determining whether the given data will be accepted by a [DragTarget].
|
||||||
///
|
///
|
||||||
/// Used by [DragTarget.onWillAccept].
|
/// Used by [DragTarget.onWillAccept].
|
||||||
typedef bool DragTargetWillAccept<T>(T data);
|
typedef DragTargetWillAccept<T> = bool Function(T data);
|
||||||
|
|
||||||
/// Signature for causing a [DragTarget] to accept the given data.
|
/// Signature for causing a [DragTarget] to accept the given data.
|
||||||
///
|
///
|
||||||
/// Used by [DragTarget.onAccept].
|
/// Used by [DragTarget.onAccept].
|
||||||
typedef void DragTargetAccept<T>(T data);
|
typedef DragTargetAccept<T> = void Function(T data);
|
||||||
|
|
||||||
/// Signature for building children of a [DragTarget].
|
/// Signature for building children of a [DragTarget].
|
||||||
///
|
///
|
||||||
@ -29,17 +29,17 @@ typedef void DragTargetAccept<T>(T data);
|
|||||||
/// this [DragTarget] and that will not be accepted by the [DragTarget].
|
/// this [DragTarget] and that will not be accepted by the [DragTarget].
|
||||||
///
|
///
|
||||||
/// Used by [DragTarget.builder].
|
/// Used by [DragTarget.builder].
|
||||||
typedef Widget DragTargetBuilder<T>(BuildContext context, List<T> candidateData, List<dynamic> rejectedData);
|
typedef DragTargetBuilder<T> = Widget Function(BuildContext context, List<T> candidateData, List<dynamic> rejectedData);
|
||||||
|
|
||||||
/// Signature for when a [Draggable] is dropped without being accepted by a [DragTarget].
|
/// Signature for when a [Draggable] is dropped without being accepted by a [DragTarget].
|
||||||
///
|
///
|
||||||
/// Used by [Draggable.onDraggableCanceled].
|
/// Used by [Draggable.onDraggableCanceled].
|
||||||
typedef void DraggableCanceledCallback(Velocity velocity, Offset offset);
|
typedef DraggableCanceledCallback = void Function(Velocity velocity, Offset offset);
|
||||||
|
|
||||||
/// Signature for when a [Draggable] leaves a [DragTarget].
|
/// Signature for when a [Draggable] leaves a [DragTarget].
|
||||||
///
|
///
|
||||||
/// Used by [DragTarget.onLeave].
|
/// Used by [DragTarget.onLeave].
|
||||||
typedef void DragTargetLeave<T>(T data);
|
typedef DragTargetLeave<T> = void Function(T data);
|
||||||
|
|
||||||
/// Where the [Draggable] should be anchored during a drag.
|
/// Where the [Draggable] should be anchored during a drag.
|
||||||
enum DragAnchor {
|
enum DragAnchor {
|
||||||
@ -481,7 +481,7 @@ class _DragTargetState<T> extends State<DragTarget<T>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum _DragEndKind { dropped, canceled }
|
enum _DragEndKind { dropped, canceled }
|
||||||
typedef void _OnDragEnd(Velocity velocity, Offset offset, bool wasAccepted);
|
typedef _OnDragEnd = void Function(Velocity velocity, Offset offset, bool wasAccepted);
|
||||||
|
|
||||||
// The lifetime of this object is a little dubious right now. Specifically, it
|
// The lifetime of this object is a little dubious right now. Specifically, it
|
||||||
// lives as long as the pointer is down. Arguably it should self-immolate if the
|
// lives as long as the pointer is down. Arguably it should self-immolate if the
|
||||||
|
@ -24,7 +24,7 @@ export 'package:flutter/rendering.dart' show SelectionChangedCause;
|
|||||||
|
|
||||||
/// Signature for the callback that reports when the user changes the selection
|
/// Signature for the callback that reports when the user changes the selection
|
||||||
/// (including the cursor location).
|
/// (including the cursor location).
|
||||||
typedef void SelectionChangedCallback(TextSelection selection, SelectionChangedCause cause);
|
typedef SelectionChangedCallback = void Function(TextSelection selection, SelectionChangedCause cause);
|
||||||
|
|
||||||
const Duration _kCursorBlinkHalfPeriod = const Duration(milliseconds: 500);
|
const Duration _kCursorBlinkHalfPeriod = const Duration(milliseconds: 500);
|
||||||
|
|
||||||
|
@ -311,7 +311,7 @@ enum FadeInImagePhase {
|
|||||||
completed,
|
completed,
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void _ImageProviderResolverListener();
|
typedef _ImageProviderResolverListener = void Function();
|
||||||
|
|
||||||
class _ImageProviderResolver {
|
class _ImageProviderResolver {
|
||||||
_ImageProviderResolver({
|
_ImageProviderResolver({
|
||||||
|
@ -183,17 +183,17 @@ class _FormScope extends InheritedWidget {
|
|||||||
/// Signature for validating a form field.
|
/// Signature for validating a form field.
|
||||||
///
|
///
|
||||||
/// Used by [FormField.validator].
|
/// Used by [FormField.validator].
|
||||||
typedef String FormFieldValidator<T>(T value);
|
typedef FormFieldValidator<T> = String Function(T value);
|
||||||
|
|
||||||
/// Signature for being notified when a form field changes value.
|
/// Signature for being notified when a form field changes value.
|
||||||
///
|
///
|
||||||
/// Used by [FormField.onSaved].
|
/// Used by [FormField.onSaved].
|
||||||
typedef void FormFieldSetter<T>(T newValue);
|
typedef FormFieldSetter<T> = void Function(T newValue);
|
||||||
|
|
||||||
/// Signature for building the widget representing the form field.
|
/// Signature for building the widget representing the form field.
|
||||||
///
|
///
|
||||||
/// Used by [FormField.builder].
|
/// Used by [FormField.builder].
|
||||||
typedef Widget FormFieldBuilder<T>(FormFieldState<T> field);
|
typedef FormFieldBuilder<T> = Widget Function(FormFieldState<T> field);
|
||||||
|
|
||||||
/// A single form field.
|
/// A single form field.
|
||||||
///
|
///
|
||||||
|
@ -829,7 +829,7 @@ enum _StateLifecycle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The signature of [State.setState] functions.
|
/// The signature of [State.setState] functions.
|
||||||
typedef void StateSetter(VoidCallback fn);
|
typedef StateSetter = void Function(VoidCallback fn);
|
||||||
|
|
||||||
/// The logic and internal state for a [StatefulWidget].
|
/// The logic and internal state for a [StatefulWidget].
|
||||||
///
|
///
|
||||||
@ -1751,7 +1751,7 @@ class _InactiveElements {
|
|||||||
///
|
///
|
||||||
/// It is safe to call `element.visitChildElements` reentrantly within
|
/// It is safe to call `element.visitChildElements` reentrantly within
|
||||||
/// this callback.
|
/// this callback.
|
||||||
typedef void ElementVisitor(Element element);
|
typedef ElementVisitor = void Function(Element element);
|
||||||
|
|
||||||
/// A handle to the location of a widget in the widget tree.
|
/// A handle to the location of a widget in the widget tree.
|
||||||
///
|
///
|
||||||
@ -3518,7 +3518,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
|
|||||||
/// * [FlutterError.reportError], which is typically called with the same
|
/// * [FlutterError.reportError], which is typically called with the same
|
||||||
/// [FlutterErrorDetails] object immediately prior to [ErrorWidget.builder]
|
/// [FlutterErrorDetails] object immediately prior to [ErrorWidget.builder]
|
||||||
/// being called.
|
/// being called.
|
||||||
typedef Widget ErrorWidgetBuilder(FlutterErrorDetails details);
|
typedef ErrorWidgetBuilder = Widget Function(FlutterErrorDetails details);
|
||||||
|
|
||||||
/// A widget that renders an exception's message.
|
/// A widget that renders an exception's message.
|
||||||
///
|
///
|
||||||
@ -3581,13 +3581,13 @@ class ErrorWidget extends LeafRenderObjectWidget {
|
|||||||
/// or [State.build].
|
/// or [State.build].
|
||||||
///
|
///
|
||||||
/// Used by [Builder.builder], [OverlayEntry.builder], etc.
|
/// Used by [Builder.builder], [OverlayEntry.builder], etc.
|
||||||
typedef Widget WidgetBuilder(BuildContext context);
|
typedef WidgetBuilder = Widget Function(BuildContext context);
|
||||||
|
|
||||||
/// Signature for a function that creates a widget for a given index, e.g., in a
|
/// Signature for a function that creates a widget for a given index, e.g., in a
|
||||||
/// list.
|
/// list.
|
||||||
///
|
///
|
||||||
/// Used by [ListView.builder] and other APIs that use lazily-generated widgets.
|
/// Used by [ListView.builder] and other APIs that use lazily-generated widgets.
|
||||||
typedef Widget IndexedWidgetBuilder(BuildContext context, int index);
|
typedef IndexedWidgetBuilder = Widget Function(BuildContext context, int index);
|
||||||
|
|
||||||
/// A builder that builds a widget given a child.
|
/// A builder that builds a widget given a child.
|
||||||
///
|
///
|
||||||
@ -3595,7 +3595,7 @@ typedef Widget IndexedWidgetBuilder(BuildContext context, int index);
|
|||||||
///
|
///
|
||||||
/// Used by [AnimatedBuilder.builder], as well as [WidgetsApp.builder] and
|
/// Used by [AnimatedBuilder.builder], as well as [WidgetsApp.builder] and
|
||||||
/// [MaterialApp.builder].
|
/// [MaterialApp.builder].
|
||||||
typedef Widget TransitionBuilder(BuildContext context, Widget child);
|
typedef TransitionBuilder = Widget Function(BuildContext context, Widget child);
|
||||||
|
|
||||||
/// An [Element] that composes other [Element]s.
|
/// An [Element] that composes other [Element]s.
|
||||||
///
|
///
|
||||||
|
@ -61,10 +61,10 @@ abstract class GestureRecognizerFactory<T extends GestureRecognizer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Signature for closures that implement [GestureRecognizerFactory.constructor].
|
/// Signature for closures that implement [GestureRecognizerFactory.constructor].
|
||||||
typedef T GestureRecognizerFactoryConstructor<T extends GestureRecognizer>();
|
typedef GestureRecognizerFactoryConstructor<T extends GestureRecognizer> = T Function();
|
||||||
|
|
||||||
/// Signature for closures that implement [GestureRecognizerFactory.initializer].
|
/// Signature for closures that implement [GestureRecognizerFactory.initializer].
|
||||||
typedef void GestureRecognizerFactoryInitializer<T extends GestureRecognizer>(T instance);
|
typedef GestureRecognizerFactoryInitializer<T extends GestureRecognizer> = void Function(T instance);
|
||||||
|
|
||||||
/// Factory for creating gesture recognizers that delegates to callbacks.
|
/// Factory for creating gesture recognizers that delegates to callbacks.
|
||||||
///
|
///
|
||||||
|
@ -18,9 +18,9 @@ import 'transitions.dart';
|
|||||||
/// This is typically used with a [HeroController] to provide an animation for
|
/// This is typically used with a [HeroController] to provide an animation for
|
||||||
/// [Hero] positions that looks nicer than a linear movement. For example, see
|
/// [Hero] positions that looks nicer than a linear movement. For example, see
|
||||||
/// [MaterialRectArcTween].
|
/// [MaterialRectArcTween].
|
||||||
typedef Tween<Rect> CreateRectTween(Rect begin, Rect end);
|
typedef CreateRectTween = Tween<Rect> Function(Rect begin, Rect end);
|
||||||
|
|
||||||
typedef void _OnFlightEnded(_HeroFlight flight);
|
typedef _OnFlightEnded = void Function(_HeroFlight flight);
|
||||||
|
|
||||||
enum _HeroFlightType {
|
enum _HeroFlightType {
|
||||||
push, // Fly the "to" hero and animate with the "to" route.
|
push, // Fly the "to" hero and animate with the "to" route.
|
||||||
|
@ -223,10 +223,10 @@ abstract class ImplicitlyAnimatedWidget extends StatefulWidget {
|
|||||||
///
|
///
|
||||||
/// This is the type of one of the arguments of [TweenVisitor], the signature
|
/// This is the type of one of the arguments of [TweenVisitor], the signature
|
||||||
/// used by [AnimatedWidgetBaseState.forEachTween].
|
/// used by [AnimatedWidgetBaseState.forEachTween].
|
||||||
typedef Tween<T> TweenConstructor<T>(T targetValue);
|
typedef TweenConstructor<T> = Tween<T> Function(T targetValue);
|
||||||
|
|
||||||
/// Signature for callbacks passed to [AnimatedWidgetBaseState.forEachTween].
|
/// Signature for callbacks passed to [AnimatedWidgetBaseState.forEachTween].
|
||||||
typedef Tween<T> TweenVisitor<T>(Tween<T> tween, T targetValue, TweenConstructor<T> constructor);
|
typedef TweenVisitor<T> = Tween<T> Function(Tween<T> tween, T targetValue, TweenConstructor<T> constructor);
|
||||||
|
|
||||||
/// A base class for widgets with implicit animations.
|
/// A base class for widgets with implicit animations.
|
||||||
///
|
///
|
||||||
|
@ -9,7 +9,7 @@ import 'debug.dart';
|
|||||||
import 'framework.dart';
|
import 'framework.dart';
|
||||||
|
|
||||||
/// The signature of the [LayoutBuilder] builder function.
|
/// The signature of the [LayoutBuilder] builder function.
|
||||||
typedef Widget LayoutWidgetBuilder(BuildContext context, BoxConstraints constraints);
|
typedef LayoutWidgetBuilder = Widget Function(BuildContext context, BoxConstraints constraints);
|
||||||
|
|
||||||
/// Builds a widget tree that can depend on the parent widget's size.
|
/// Builds a widget tree that can depend on the parent widget's size.
|
||||||
///
|
///
|
||||||
|
@ -23,16 +23,16 @@ import 'ticker_provider.dart';
|
|||||||
/// Creates a route for the given route settings.
|
/// Creates a route for the given route settings.
|
||||||
///
|
///
|
||||||
/// Used by [Navigator.onGenerateRoute] and [Navigator.onUnknownRoute].
|
/// Used by [Navigator.onGenerateRoute] and [Navigator.onUnknownRoute].
|
||||||
typedef Route<dynamic> RouteFactory(RouteSettings settings);
|
typedef RouteFactory = Route<dynamic> Function(RouteSettings settings);
|
||||||
|
|
||||||
/// Signature for the [Navigator.popUntil] predicate argument.
|
/// Signature for the [Navigator.popUntil] predicate argument.
|
||||||
typedef bool RoutePredicate(Route<dynamic> route);
|
typedef RoutePredicate = bool Function(Route<dynamic> route);
|
||||||
|
|
||||||
/// Signature for a callback that verifies that it's OK to call [Navigator.pop].
|
/// Signature for a callback that verifies that it's OK to call [Navigator.pop].
|
||||||
///
|
///
|
||||||
/// Used by [Form.onWillPop], [ModalRoute.addScopedWillPopCallback],
|
/// Used by [Form.onWillPop], [ModalRoute.addScopedWillPopCallback],
|
||||||
/// [ModalRoute.removeScopedWillPopCallback], and [WillPopScope].
|
/// [ModalRoute.removeScopedWillPopCallback], and [WillPopScope].
|
||||||
typedef Future<bool> WillPopCallback();
|
typedef WillPopCallback = Future<bool> Function();
|
||||||
|
|
||||||
/// Indicates whether the current route should be popped.
|
/// Indicates whether the current route should be popped.
|
||||||
///
|
///
|
||||||
|
@ -34,7 +34,7 @@ import 'viewport.dart';
|
|||||||
/// [SliverAppBar.forceElevated] property to ensure that the app bar shows a
|
/// [SliverAppBar.forceElevated] property to ensure that the app bar shows a
|
||||||
/// shadow, since it would otherwise not necessarily be aware that it had
|
/// shadow, since it would otherwise not necessarily be aware that it had
|
||||||
/// content ostensibly below it.
|
/// content ostensibly below it.
|
||||||
typedef List<Widget> NestedScrollViewHeaderSliversBuilder(BuildContext context, bool innerBoxIsScrolled);
|
typedef NestedScrollViewHeaderSliversBuilder = List<Widget> Function(BuildContext context, bool innerBoxIsScrolled);
|
||||||
|
|
||||||
/// A scrolling view inside of which can be nested other scrolling views, with
|
/// A scrolling view inside of which can be nested other scrolling views, with
|
||||||
/// their scroll positions being intrinsically linked.
|
/// their scroll positions being intrinsically linked.
|
||||||
@ -454,7 +454,7 @@ class _NestedScrollMetrics extends FixedScrollMetrics {
|
|||||||
final double correctionOffset;
|
final double correctionOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef ScrollActivity _NestedScrollActivityGetter(_NestedScrollPosition position);
|
typedef _NestedScrollActivityGetter = ScrollActivity Function(_NestedScrollPosition position);
|
||||||
|
|
||||||
class _NestedScrollCoordinator implements ScrollActivityDelegate, ScrollHoldController {
|
class _NestedScrollCoordinator implements ScrollActivityDelegate, ScrollHoldController {
|
||||||
_NestedScrollCoordinator(this._state, this._parent, this._onHasScrolledBodyChanged) {
|
_NestedScrollCoordinator(this._state, this._parent, this._onHasScrolledBodyChanged) {
|
||||||
|
@ -10,7 +10,7 @@ import 'framework.dart';
|
|||||||
/// notification to continue to be dispatched to further ancestors.
|
/// notification to continue to be dispatched to further ancestors.
|
||||||
///
|
///
|
||||||
/// Used by [NotificationListener.onNotification].
|
/// Used by [NotificationListener.onNotification].
|
||||||
typedef bool NotificationListenerCallback<T extends Notification>(T notification);
|
typedef NotificationListenerCallback<T extends Notification> = bool Function(T notification);
|
||||||
|
|
||||||
/// A notification that can bubble up the widget tree.
|
/// A notification that can bubble up the widget tree.
|
||||||
///
|
///
|
||||||
|
@ -10,7 +10,7 @@ import 'media_query.dart';
|
|||||||
/// Signature for a function that builds a widget given an [Orientation].
|
/// Signature for a function that builds a widget given an [Orientation].
|
||||||
///
|
///
|
||||||
/// Used by [OrientationBuilder.builder].
|
/// Used by [OrientationBuilder.builder].
|
||||||
typedef Widget OrientationWidgetBuilder(BuildContext context, Orientation orientation);
|
typedef OrientationWidgetBuilder = Widget Function(BuildContext context, Orientation orientation);
|
||||||
|
|
||||||
/// Builds a widget tree that can depend on the parent widget's orientation
|
/// Builds a widget tree that can depend on the parent widget's orientation
|
||||||
/// (distinct from the device orientation).
|
/// (distinct from the device orientation).
|
||||||
|
@ -48,13 +48,13 @@ abstract class PageRoute<T> extends ModalRoute<T> {
|
|||||||
/// primary contents.
|
/// primary contents.
|
||||||
///
|
///
|
||||||
/// See [ModalRoute.buildPage] for complete definition of the parameters.
|
/// See [ModalRoute.buildPage] for complete definition of the parameters.
|
||||||
typedef Widget RoutePageBuilder(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation);
|
typedef RoutePageBuilder = Widget Function(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation);
|
||||||
|
|
||||||
/// Signature for the [PageRouteBuilder] function that builds the route's
|
/// Signature for the [PageRouteBuilder] function that builds the route's
|
||||||
/// transitions.
|
/// transitions.
|
||||||
///
|
///
|
||||||
/// See [ModalRoute.buildTransitions] for complete definition of the parameters.
|
/// See [ModalRoute.buildTransitions] for complete definition of the parameters.
|
||||||
typedef Widget RouteTransitionsBuilder(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child);
|
typedef RouteTransitionsBuilder = Widget Function(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child);
|
||||||
|
|
||||||
Widget _defaultTransitionsBuilder(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
|
Widget _defaultTransitionsBuilder(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
|
||||||
return child;
|
return child;
|
||||||
|
@ -284,7 +284,7 @@ class UserScrollNotification extends ScrollNotification {
|
|||||||
|
|
||||||
/// A predicate for [ScrollNotification], used to customize widgets that
|
/// A predicate for [ScrollNotification], used to customize widgets that
|
||||||
/// listen to notifications from their children.
|
/// listen to notifications from their children.
|
||||||
typedef bool ScrollNotificationPredicate(ScrollNotification notification);
|
typedef ScrollNotificationPredicate = bool Function(ScrollNotification notification);
|
||||||
|
|
||||||
/// A [ScrollNotificationPredicate] that checks whether
|
/// A [ScrollNotificationPredicate] that checks whether
|
||||||
/// `notification.depth == 0`, which means that the notification did not bubble
|
/// `notification.depth == 0`, which means that the notification did not bubble
|
||||||
|
@ -25,7 +25,7 @@ export 'package:flutter/physics.dart' show Tolerance;
|
|||||||
|
|
||||||
/// Signature used by [Scrollable] to build the viewport through which the
|
/// Signature used by [Scrollable] to build the viewport through which the
|
||||||
/// scrollable content is displayed.
|
/// scrollable content is displayed.
|
||||||
typedef Widget ViewportBuilder(BuildContext context, ViewportOffset position);
|
typedef ViewportBuilder = Widget Function(BuildContext context, ViewportOffset position);
|
||||||
|
|
||||||
/// A widget that scrolls.
|
/// A widget that scrolls.
|
||||||
///
|
///
|
||||||
|
@ -58,7 +58,7 @@ enum _TextSelectionHandlePosition { start, end }
|
|||||||
/// of the [RenderBox] given by the [TextSelectionOverlay.renderObject].
|
/// of the [RenderBox] given by the [TextSelectionOverlay.renderObject].
|
||||||
///
|
///
|
||||||
/// Used by [TextSelectionOverlay.onSelectionOverlayChanged].
|
/// Used by [TextSelectionOverlay.onSelectionOverlayChanged].
|
||||||
typedef void TextSelectionOverlayChanged(TextEditingValue value, Rect caretRect);
|
typedef TextSelectionOverlayChanged = void Function(TextEditingValue value, Rect caretRect);
|
||||||
|
|
||||||
/// An interface for manipulating the selection, to be used by the implementor
|
/// An interface for manipulating the selection, to be used by the implementor
|
||||||
/// of the toolbar widget.
|
/// of the toolbar widget.
|
||||||
|
@ -24,9 +24,9 @@ import 'icon_data.dart';
|
|||||||
|
|
||||||
/// Signature for the builder callback used by
|
/// Signature for the builder callback used by
|
||||||
/// [WidgetInspector.selectButtonBuilder].
|
/// [WidgetInspector.selectButtonBuilder].
|
||||||
typedef Widget InspectorSelectButtonBuilder(BuildContext context, VoidCallback onPressed);
|
typedef InspectorSelectButtonBuilder = Widget Function(BuildContext context, VoidCallback onPressed);
|
||||||
|
|
||||||
typedef void _RegisterServiceExtensionCallback({
|
typedef _RegisterServiceExtensionCallback = void Function({
|
||||||
@required String name,
|
@required String name,
|
||||||
@required ServiceExtensionCallback callback
|
@required ServiceExtensionCallback callback
|
||||||
});
|
});
|
||||||
@ -93,7 +93,7 @@ List<_DiagnosticsPathNode> _followDiagnosticableChain(List<Diagnosticable> chain
|
|||||||
|
|
||||||
/// Signature for the selection change callback used by
|
/// Signature for the selection change callback used by
|
||||||
/// [WidgetInspectorService.selectionChangedCallback].
|
/// [WidgetInspectorService.selectionChangedCallback].
|
||||||
typedef void InspectorSelectionChangedCallback();
|
typedef InspectorSelectionChangedCallback = void Function();
|
||||||
|
|
||||||
/// Structure to help reference count Dart objects referenced by a GUI tool
|
/// Structure to help reference count Dart objects referenced by a GUI tool
|
||||||
/// using [WidgetInspectorService].
|
/// using [WidgetInspectorService].
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
typedef void GestureArenaCallback(Object key);
|
typedef GestureArenaCallback = void Function(Object key);
|
||||||
|
|
||||||
const int primaryKey = 4;
|
const int primaryKey = 4;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
typedef void HandleEventCallback(PointerEvent event);
|
typedef HandleEventCallback = void Function(PointerEvent event);
|
||||||
|
|
||||||
class TestGestureFlutterBinding extends BindingBase with GestureBinding {
|
class TestGestureFlutterBinding extends BindingBase with GestureBinding {
|
||||||
HandleEventCallback callback;
|
HandleEventCallback callback;
|
||||||
|
@ -31,7 +31,7 @@ class GestureTester {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void GestureTest(GestureTester tester);
|
typedef GestureTest = void Function(GestureTester tester);
|
||||||
|
|
||||||
@isTest
|
@isTest
|
||||||
void testGesture(String description, GestureTest callback) {
|
void testGesture(String description, GestureTest callback) {
|
||||||
|
@ -9,7 +9,7 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
typedef void HandleEventCallback(PointerEvent event);
|
typedef HandleEventCallback = void Function(PointerEvent event);
|
||||||
|
|
||||||
class TestGestureFlutterBinding extends BindingBase with GestureBinding {
|
class TestGestureFlutterBinding extends BindingBase with GestureBinding {
|
||||||
HandleEventCallback callback;
|
HandleEventCallback callback;
|
||||||
|
@ -224,4 +224,4 @@ class TestWidget extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef VoidCallback HandlerCreator(BuildContext context);
|
typedef HandlerCreator = VoidCallback Function(BuildContext context);
|
||||||
|
@ -69,7 +69,7 @@ Widget buildFrame({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef Widget TabControllerFrameBuilder(BuildContext context, TabController controller);
|
typedef TabControllerFrameBuilder = Widget Function(BuildContext context, TabController controller);
|
||||||
|
|
||||||
class TabControllerFrame extends StatefulWidget {
|
class TabControllerFrame extends StatefulWidget {
|
||||||
const TabControllerFrame({ this.length, this.initialIndex = 0, this.builder });
|
const TabControllerFrame({ this.length, this.initialIndex = 0, this.builder });
|
||||||
|
@ -59,13 +59,13 @@ Matcher get paintsAssertion => new _TestRecordingCanvasPaintsAssertionMatcher();
|
|||||||
/// ```dart
|
/// ```dart
|
||||||
/// if (methodName == #drawCircle) { ... }
|
/// if (methodName == #drawCircle) { ... }
|
||||||
/// ```
|
/// ```
|
||||||
typedef bool PaintPatternPredicate(Symbol methodName, List<dynamic> arguments);
|
typedef PaintPatternPredicate = bool Function(Symbol methodName, List<dynamic> arguments);
|
||||||
|
|
||||||
/// The signature of [RenderObject.paint] functions.
|
/// The signature of [RenderObject.paint] functions.
|
||||||
typedef void _ContextPainterFunction(PaintingContext context, Offset offset);
|
typedef _ContextPainterFunction = void Function(PaintingContext context, Offset offset);
|
||||||
|
|
||||||
/// The signature of functions that paint directly on a canvas.
|
/// The signature of functions that paint directly on a canvas.
|
||||||
typedef void _CanvasPainterFunction(Canvas canvas);
|
typedef _CanvasPainterFunction = void Function(Canvas canvas);
|
||||||
|
|
||||||
/// Builder interface for patterns used to match display lists (canvas calls).
|
/// Builder interface for patterns used to match display lists (canvas calls).
|
||||||
///
|
///
|
||||||
|
@ -61,7 +61,7 @@ Widget buildTest({ double startToEndThreshold, TextDirection textDirection = Tex
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef Future<Null> DismissMethod(WidgetTester tester, Finder finder, { @required AxisDirection gestureDirection });
|
typedef DismissMethod = Future<Null> Function(WidgetTester tester, Finder finder, { @required AxisDirection gestureDirection });
|
||||||
|
|
||||||
Future<Null> dismissElement(WidgetTester tester, Finder finder, { @required AxisDirection gestureDirection }) async {
|
Future<Null> dismissElement(WidgetTester tester, Finder finder, { @required AxisDirection gestureDirection }) async {
|
||||||
Offset downLocation;
|
Offset downLocation;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
import 'package:flutter_test/flutter_test.dart' hide TypeMatcher;
|
import 'package:flutter_test/flutter_test.dart' hide TypeMatcher;
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
typedef void TestCallback(BuildContext context);
|
typedef TestCallback = void Function(BuildContext context);
|
||||||
|
|
||||||
class TestWidget extends StatefulWidget {
|
class TestWidget extends StatefulWidget {
|
||||||
const TestWidget(this.callback);
|
const TestWidget(this.callback);
|
||||||
|
@ -42,7 +42,7 @@ class SecondWidgetState extends State<SecondWidget> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void ExceptionCallback(dynamic exception);
|
typedef ExceptionCallback = void Function(dynamic exception);
|
||||||
|
|
||||||
class ThirdWidget extends StatelessWidget {
|
class ThirdWidget extends StatelessWidget {
|
||||||
const ThirdWidget({ this.targetKey, this.onException });
|
const ThirdWidget({ this.targetKey, this.onException });
|
||||||
@ -89,7 +89,7 @@ class OnTapPage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void OnObservation(Route<dynamic> route, Route<dynamic> previousRoute);
|
typedef OnObservation = void Function(Route<dynamic> route, Route<dynamic> previousRoute);
|
||||||
|
|
||||||
class TestObserver extends NavigatorObserver {
|
class TestObserver extends NavigatorObserver {
|
||||||
OnObservation onPushed;
|
OnObservation onPushed;
|
||||||
|
@ -14,7 +14,7 @@ import 'package:flutter_test/flutter_test.dart';
|
|||||||
|
|
||||||
import 'semantics_tester.dart';
|
import 'semantics_tester.dart';
|
||||||
|
|
||||||
typedef Future<Null> TraversalTestFunction(TraversalTester tester);
|
typedef TraversalTestFunction = Future<Null> Function(TraversalTester tester);
|
||||||
const Size tenByTen = const Size(10.0, 10.0);
|
const Size tenByTen = const Size(10.0, 10.0);
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -105,7 +105,7 @@ Future<Null> main() async {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void Logger(String caller);
|
typedef Logger = void Function(String caller);
|
||||||
|
|
||||||
class TestBorder extends ShapeBorder {
|
class TestBorder extends ShapeBorder {
|
||||||
const TestBorder(this.onLog) : assert(onLog != null);
|
const TestBorder(this.onLog) : assert(onLog != null);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user