routes property
The route definitions
Implementation
@override
List<RouteDefinition> get routes => [
NamedRouteDefinition(
route: '/home',
builder: (ctx, settings) => Material(
color: Color.fromARGB(255, 48, 48, 72),
child: LayoutBuilder(
builder: (ctx, constraints) => PeriodicWidget(
callback: (idx) {
final t =
DateTime.now().millisecondsSinceEpoch / 500.0;
final w = constraints.maxWidth;
final h = constraints.maxHeight;
final hw = w / 2;
final hh = h / 2;
final r = min(hw, hh) * 0.8;
Particles.instance.addLayer(FireParticleLayer(
cos(t) * r + hw,
sin(t) * r + hh,
));
Particles.instance.addLayer(RainbowParticleLayer(
cos(t + 3.15) * r + hw,
sin(t + 3.15) * r + hh,
cos((t - 1) + 3.15) * r + hw,
sin((t - 1) + 3.15) * r + hh,
));
},
duration: Duration(milliseconds: 1),
child: nil),
),
)),
];