Yin and yang: Difference between revisions
Content added Content deleted
m (→Flutter: minimized) |
(→Flutter (without CustomPaint): refactoring) |
||
Line 2,187: | Line 2,187: | ||
const color = [Colors.black, Colors.white]; |
const color = [Colors.black, Colors.white]; |
||
Widget cR(int iColor, double r, {Widget? child}) => DecoratedBox( |
|||
decoration: |
decoration: BoxDecoration(color: color[iColor], shape: BoxShape.circle), |
||
⚫ | |||
constraints: BoxConstraints.tight(Size.fromRadius(r)), |
|||
clipBehavior: main ? Clip.hardEdge : Clip.none, |
|||
⚫ | |||
⚫ | |||
Widget yinYang(double r, [double th = 1.0]) => Padding( |
|||
⚫ | |||
main: true, |
|||
child: |
child: ClipOval( |
||
child: |
child: cR(0, r + th, |
||
child: cR(1, r, |
|||
child: Stack(alignment: Alignment.center, children: [ |
|||
Container(color: color[0], margin: EdgeInsets.only(left: r)), |
|||
⚫ | |||
Column(children: List.generate(2, (i) => cR(1 - i, r / 2, child: cR(i, r / 6)))) |
|||
⚫ | |||
void main() => runApp(MaterialApp( |
void main() => runApp(MaterialApp( |