mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
 <details> <summary> Code Example</summary> ```dart import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class DemoGradientTransform implements GradientTransform { @override Matrix4? transform(Rect bounds, {TextDirection? textDirection}) { return Matrix4.identity() ..scale(1.2, 1.7) ..rotateZ(0.25); } } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { var colors = <Color>[ Colors.red, Colors.green, Colors.blue, Colors.yellow, ]; const stops = <double>[0.0, 0.25, 0.5, 1.0]; return MaterialApp( debugShowCheckedModeBanner: false, home: GridView( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: TileMode.values.length, ), children: <Widget>[ for (final mode in TileMode.values) DecoratedBox( decoration: BoxDecoration( gradient: LinearGradient( colors: colors, stops: stops, tileMode: mode, transform: DemoGradientTransform(), ), ), ), for (final mode in TileMode.values) DecoratedBox( decoration: BoxDecoration( gradient: RadialGradient( center: Alignment.topLeft, radius: 0.5, colors: colors, stops: stops, tileMode: mode, transform: DemoGradientTransform(), ), ), ), for (final mode in TileMode.values) DecoratedBox( decoration: BoxDecoration( gradient: SweepGradient( center: Alignment.topLeft, startAngle: 0.0, endAngle: 3.14, colors: colors, stops: stops, tileMode: mode, transform: DemoGradientTransform(), ), ), ), ], ), ); } } ``` </details> Fixes: https://github.com/flutter/flutter/issues/84245
Description
Flutter makes it easy and fast to build beautiful apps for mobile and beyond
androidapp-frameworkcross-platformdartdart-platformdesktopflutterflutter-packagefuchsiaioslinux-desktopmacosmaterial-designmobilemobile-developmentskiawebweb-frameworkwindows
2.5 GiB
Languages
Dart
75%
C++
16.5%
Objective-C++
2.9%
Java
2.8%
Objective-C
0.7%
Other
1.9%