I was trying to test out the examples for TileMode in the DartPad experimental.
In using simple sample code, the TileMode is not working correctly. That is, when I use TileMode.mirror (or TileMode.repeated), I expect to get mirrored gradients in the sample code. Instead, I just get the last value repeated forever; i.e. like TileMode.clamp
import 'package:flutter/material.dart';
class ExampleScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Hey there, boo!'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [Aaa()],
),
);
}
}
class Aaa extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox(
width: 250,
height: 250,
child: Stack(
children: <Widget>[
Container(
width: 250,
height: 250,
color: Colors.white,
),
Container(
padding: EdgeInsets.all(15.0),
alignment: Alignment.bottomCenter,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment(-1.0,0),
end: Alignment(-0.8,0),
tileMode: TileMode.mirror,
colors: <Color>[
Colors.black,
// Colors.black.withAlpha(0),
Colors.red,
// Colors.blue,
],
),
),
child: Text(
"Foreground Text",
style: TextStyle(color: Colors.white, fontSize: 20.0),
),
),
],
),
);
}
}
I was trying to test out the examples for TileMode in the DartPad experimental.
In using simple sample code, the TileMode is not working correctly. That is, when I use TileMode.mirror (or TileMode.repeated), I expect to get mirrored gradients in the sample code. Instead, I just get the last value repeated forever; i.e. like TileMode.clamp
Instead, I wanted to get things like in the api docs (https://api.flutter.dev/flutter/dart-ui/TileMode-class.html) that look like this:
Here is sample code that I ran here: https://dartpad.dartlang.org/experimental/new_embeddings_demo.html