mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

Updated tests in dev, examples/api, and tests/widgets to ensure that they continue to pass when the default for `ThemeData.useMaterial3` is changed to true. This is the final set of changes required for https://github.com/flutter/flutter/issues/127064.
38 lines
1.3 KiB
Dart
38 lines
1.3 KiB
Dart
// Copyright 2014 The Flutter 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/material.dart';
|
|
import 'package:flutter_api_samples/widgets/implicit_animations/animated_slide.0.dart' as example;
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
testWidgets('Translate FlutterLogo using AnimatedSlide', (WidgetTester tester) async {
|
|
await tester.pumpWidget(
|
|
const example.AnimatedSlideApp(),
|
|
);
|
|
|
|
Offset logoOffset = tester.getCenter(find.byType(FlutterLogo));
|
|
expect(logoOffset.dx, 376.0);
|
|
expect(logoOffset.dy, 304.0);
|
|
|
|
// Test Y axis slider.
|
|
final Offset y = tester.getCenter(find.text('Y'));
|
|
await tester.tapAt(Offset(y.dx, y.dy + 100));
|
|
await tester.pumpAndSettle();
|
|
|
|
logoOffset = tester.getCenter(find.byType(FlutterLogo));
|
|
expect(logoOffset.dx.roundToDouble(), 376.0);
|
|
expect(logoOffset.dy.roundToDouble(), 137.0);
|
|
|
|
// Test X axis slider.
|
|
final Offset x = tester.getCenter(find.text('X'));
|
|
await tester.tapAt(Offset(x.dx + 100, x.dy));
|
|
await tester.pumpAndSettle();
|
|
|
|
logoOffset = tester.getCenter(find.byType(FlutterLogo));
|
|
expect(logoOffset.dx.roundToDouble(), 178.0);
|
|
expect(logoOffset.dy.roundToDouble(), 137.0);
|
|
});
|
|
}
|