• Ian Hickson's avatar
    License update (#45373) · 449f4a66
    Ian Hickson authored
    * Update project.pbxproj files to say Flutter rather than Chromium
    
    Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.
    
    * Update the copyright notice checker to require a standard notice on all files
    
    * Update copyrights on Dart files. (This was a mechanical commit.)
    
    * Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.
    
    Some were already marked "The Flutter Authors", not clear why. Their
    dates have been normalized. Some were missing the blank line after the
    license. Some were randomly different in trivial ways for no apparent
    reason (e.g. missing the trailing period).
    
    * Clean up the copyrights in non-Dart files. (Manual edits.)
    
    Also, make sure templates don't have copyrights.
    
    * Fix some more ORGANIZATIONNAMEs
    Unverified
    449f4a66
proxy_getters_and_setters_test.dart 2.33 KB
// 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/rendering.dart';
import '../flutter_test_alternative.dart';

void main() {
  test('RenderConstrainedBox getters and setters', () {
    final RenderConstrainedBox box = RenderConstrainedBox(additionalConstraints: const BoxConstraints.tightFor(height: 10.0));
    expect(box.additionalConstraints, const BoxConstraints(minHeight: 10.0, maxHeight: 10.0));
    box.additionalConstraints = const BoxConstraints.tightFor(width: 10.0);
    expect(box.additionalConstraints, const BoxConstraints(minWidth: 10.0, maxWidth: 10.0));
  });

  test('RenderLimitedBox getters and setters', () {
    final RenderLimitedBox box = RenderLimitedBox();
    expect(box.maxWidth, double.infinity);
    expect(box.maxHeight, double.infinity);
    box.maxWidth = 0.0;
    box.maxHeight = 1.0;
    expect(box.maxHeight, 1.0);
    expect(box.maxWidth, 0.0);
  });

  test('RenderAspectRatio getters and setters', () {
    final RenderAspectRatio box = RenderAspectRatio(aspectRatio: 1.0);
    expect(box.aspectRatio, 1.0);
    box.aspectRatio = 0.2;
    expect(box.aspectRatio, 0.2);
    box.aspectRatio = 1.2;
    expect(box.aspectRatio, 1.2);
  });

  test('RenderIntrinsicWidth getters and setters', () {
    final RenderIntrinsicWidth box = RenderIntrinsicWidth();
    expect(box.stepWidth, isNull);
    box.stepWidth = 10.0;
    expect(box.stepWidth, 10.0);
    expect(box.stepHeight, isNull);
    box.stepHeight = 10.0;
    expect(box.stepHeight, 10.0);
  });

  test('RenderOpacity getters and setters', () {
    final RenderOpacity box = RenderOpacity();
    expect(box.opacity, 1.0);
    box.opacity = 0.0;
    expect(box.opacity, 0.0);
  });

  test('RenderShaderMask getters and setters', () {
    final ShaderCallback callback1 = (Rect bounds) => null;
    final ShaderCallback callback2 = (Rect bounds) => null;
    final RenderShaderMask box = RenderShaderMask(shaderCallback: callback1);
    expect(box.shaderCallback, equals(callback1));
    box.shaderCallback = callback2;
    expect(box.shaderCallback, equals(callback2));
    expect(box.blendMode, BlendMode.modulate);
    box.blendMode = BlendMode.colorBurn;
    expect(box.blendMode, BlendMode.colorBurn);
  });
}