mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-07-13 08:33:26 +08:00
Add:创建 flutter go web 版
This commit is contained in:
35
packages/flutter_web/test/widgets/fade_transition_test.dart
Normal file
35
packages/flutter_web/test/widgets/fade_transition_test.dart
Normal file
@ -0,0 +1,35 @@
|
||||
// Copyright 2018 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter_web/foundation.dart';
|
||||
import 'package:flutter_web/widgets.dart';
|
||||
import 'package:flutter_web_test/flutter_web_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('FadeTransition', (WidgetTester tester) async {
|
||||
final DebugPrintCallback oldPrint = debugPrint;
|
||||
final List<String> log = <String>[];
|
||||
debugPrint = (String message, {int wrapWidth}) {
|
||||
log.add(message);
|
||||
};
|
||||
debugPrintBuildScope = true;
|
||||
final AnimationController controller = AnimationController(
|
||||
vsync: const TestVSync(),
|
||||
duration: const Duration(seconds: 2),
|
||||
);
|
||||
await tester.pumpWidget(FadeTransition(
|
||||
opacity: controller,
|
||||
child: const Placeholder(),
|
||||
));
|
||||
expect(log, hasLength(2));
|
||||
expect(log.last, 'buildScope finished');
|
||||
await tester.pump();
|
||||
expect(log, hasLength(2));
|
||||
controller.forward();
|
||||
await tester.pumpAndSettle();
|
||||
expect(log, hasLength(2));
|
||||
debugPrint = oldPrint;
|
||||
debugPrintBuildScope = false;
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user