This commit is contained in:
Jonah Williams
2018-08-29 16:48:23 -07:00
committed by GitHub
parent 44cdb049d8
commit 0e9cfe7df1
8 changed files with 77 additions and 41 deletions

View File

@@ -128,9 +128,6 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
@protected
bool get checkIntrinsicSizes => false;
@override
bool disableAnimations = false;
/// Creates and initializes the binding. This function is
/// idempotent; calling it a second time will just return the
/// previously-created instance.

View File

@@ -10,8 +10,16 @@ import 'package:flutter/scheduler.dart';
/// tree.
class TestVSync implements TickerProvider {
/// Creates a ticker provider that creates standalone tickers.
const TestVSync();
const TestVSync({this.disableAnimations = false});
/// Whether to disable the animations of tickers create from this picker.
///
/// See also:
///
/// * [AccessibilityFeatures.disableAnimations], for the setting that controls this flag.
/// * [AnimationBehavior], for how animation controllers change when created from tickers with this flag.
final bool disableAnimations;
@override
Ticker createTicker(TickerCallback onTick) => new Ticker(onTick);
Ticker createTicker(TickerCallback onTick) => new Ticker(onTick)..disableAnimations = disableAnimations;
}