shader_mask_test.dart 848 Bytes
Newer Older
Hixie's avatar
Hixie committed
1 2 3 4
// Copyright 2015 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.

5
import 'dart:ui' show Shader;
Hans Muller's avatar
Hans Muller committed
6

Adam Barth's avatar
Adam Barth committed
7
import 'package:flutter_test/flutter_test.dart';
8
import 'package:flutter/widgets.dart';
Hans Muller's avatar
Hans Muller committed
9 10
import 'package:test/test.dart';

11
Shader createShader(Rect bounds) {
Hans Muller's avatar
Hans Muller committed
12
  return new LinearGradient(
13 14
      begin: const Offset(0.0, 0.0),
      end: const Offset(0.0, 1.0),
15 16
      colors: <Color>[const Color(0x00FFFFFF), const Color(0xFFFFFFFF)],
      stops: <double>[0.1, 0.35]
Hans Muller's avatar
Hans Muller committed
17
  )
18
  .createShader(bounds);
Hans Muller's avatar
Hans Muller committed
19 20 21 22 23 24 25 26 27 28 29
}


void main() {
  test('Can be constructed', () {
    testWidgets((WidgetTester tester) {
      Widget child = new Container(width: 100.0, height: 100.0);
      tester.pumpWidget(new ShaderMask(child: child, shaderCallback: createShader));
    });
  });
}