Normalize assert checking of clipBehavior (#38568)

I noticed that we were pretty inconsistent with the way that we checked the value of clipBehavior in the framework, so I normalized the usages and updated docs where necessary.

This is a breaking change if you used to pass null explicitly to FlatButton, OutlineButton or RaisedButton constructors, expecting to get Clip.none. It will now assert if you do that. Existing implementations that pass null implicitly by not specifying clipBehavior won't need to change their call sites. It always implicitly defaulted to Clip.none before, and it will continue to do that, it's only places where it was explicitly set to null in order to get the implicit default that it will fail.
16 files changed
tree: d43f95cad1c8b07ecfb9c906a327bdd03e7668b8
  1. .github/
  2. bin/
  3. dev/
  4. examples/
  5. packages/
  6. .cirrus.yml
  7. .codecov.yml
  8. .gitattributes
  9. .gitignore
  10. analysis_options.yaml
  11. AUTHORS
  12. CODE_OF_CONDUCT.md
  13. CODEOWNERS
  14. CONTRIBUTING.md
  15. dartdoc_options.yaml
  16. flutter_console.bat
  17. LICENSE
  18. PATENT_GRANT
  19. README.md
README.md

Flutter logo

Build Status - Cirrus Gitter Channel

Flutter is Google's mobile app SDK for crafting high-quality native interfaces on iOS and Android in record time. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source.

Documentation

For announcements about new releases and breaking changes, follow the flutter-announce@googlegroups.com mailing list.

About Flutter

We think Flutter will help you create beautiful, fast apps, with a productive, extensible and open development model.

Beautiful apps

We want to enable designers to deliver their full creative vision without being forced to water it down due to limitations of the underlying framework. Flutter's layered architecture gives you control over every pixel on the screen, and its powerful compositing capabilities let you overlay and animate graphics, video, text and controls without limitation. Flutter includes a full set of widgets that deliver pixel-perfect experiences on both iOS and Android.

Reflectly hero image

Fast apps

Flutter is fast. It's powered by the same hardware-accelerated Skia 2D graphics library that underpins Chrome and Android. We architected Flutter to support glitch-free, jank-free graphics at the native speed of your device. Flutter code is powered by the world-class Dart platform, which enables compilation to native 32-bit and 64-bit ARM code for iOS and Android.

Productive development

Flutter offers stateful hot reload, allowing you to make changes to your code and see the results instantly without restarting your app or losing its state.

Hot reload animation

Extensible and open model

Flutter works with any development tool, but includes editor plug-ins for both Visual Studio Code and IntelliJ / Android Studio. Flutter provides thousands of packages to speed your development, regardless of your target platform. And accessing platform features is easy. Here is a snippet from our interop example:

Future<void> getBatteryLevel() async {
  var batteryLevel = 'unknown';
  try {
    int result = await methodChannel.invokeMethod('getBatteryLevel');
    batteryLevel = 'Battery level: $result%';
  } on PlatformException {
    batteryLevel = 'Failed to get battery level.';
  }
  setState(() {
    _batteryLevel = batteryLevel;
  });
}

Flutter is a fully open source project, and we welcome contributions. Information on how to get started can be found at our contributor guide.