ink_splash_test.dart 989 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
// 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/material.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
  // Regression test for https://github.com/flutter/flutter/issues/21506.
  testWidgets('InkSplash receives textDirection', (WidgetTester tester) async {
11 12 13 14 15
    await tester.pumpWidget(MaterialApp(
      home: Scaffold(
      appBar: AppBar(title: const Text('Button Border Test')),
      body: Center(
        child: RaisedButton(
16
          child: const Text('Test'),
17
          onPressed: () { },
18
          shape: Border.all(
19 20 21 22 23 24 25 26 27 28 29
            color: Colors.blue,
          ),
        ),
      ),
    )));
    await tester.tap(find.text('Test'));
    // start ink animation which asserts for a textDirection.
    await tester.pumpAndSettle(const Duration(milliseconds: 30));
    expect(tester.takeException(), isNull);
  });
}