shader_mask_test.dart 691 Bytes
Newer Older
1
import 'dart:ui' as ui;
Hans Muller's avatar
Hans Muller committed
2

3 4
import 'package:flutter/painting.dart';
import 'package:flutter/widgets.dart';
Hans Muller's avatar
Hans Muller committed
5 6 7 8
import 'package:test/test.dart';

import 'widget_tester.dart';

9
ui.Shader createShader(Rect bounds) {
Hans Muller's avatar
Hans Muller committed
10 11 12
  return new LinearGradient(
      begin: Point.origin,
      end: new Point(0.0, bounds.height),
13 14
      colors: <Color>[const Color(0x00FFFFFF), const Color(0xFFFFFFFF)],
      stops: <double>[0.1, 0.35]
Hans Muller's avatar
Hans Muller committed
15 16 17 18 19 20 21 22 23 24 25 26 27
  )
  .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));
    });
  });
}