shader_mask_test.dart 866 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' as ui;
Hans Muller's avatar
Hans Muller committed
6

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

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


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));
    });
  });
}