Skip to content

Instantly share code, notes, and snippets.

import 'package:flutter/material.dart';
class RailTransition extends StatefulWidget {
const RailTransition({ super.key, required this.animation, required this.child });
final Animation<double> animation;
final Widget child;
@override
State<RailTransition> createState() => _RailTransition();
import 'package:flutter/material.dart';
enum GlideDirection {
startToEnd,
endToStart,
up,
down,
}
import 'package:flutter/material.dart';
enum GlideDirection {
startToEnd,
endToStart,
up,
down,
}
// animation.value == 0, child is not visible
import 'dart:math' as math;
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
typedef _NextChild = RenderBox? Function(RenderBox child);
import 'package:flutter/material.dart';
class Badge extends StatelessWidget {
const Badge({
super.key,
this.backgroundColor,
this.label,
this.child,
});
import 'package:flutter/material.dart';
class Star {
const Star({
this.fillColor = Colors.white,
this.borderColor = Colors.black,
this.borderWidth = 9,
this.points = 7,
this.innerRadiusRatio = 0.75,
this.pointRounding = 0.5,
import 'package:flutter/material.dart';
class Star {
const Star({
this.fillColor = Colors.white,
this.borderColor = Colors.black,
this.borderWidth = 9,
this.points = 7,
this.innerRadiusRatio = 0.75,
this.pointRounding = 0.5,
import 'package:flutter/material.dart';
class Star {
const Star(this.title);
final String title;
}
class StarView extends StatefulWidget {
const StarView({ super.key, required this.star, required this.onTitleChanged });
import 'package:flutter/material.dart';
class Star {
const Star({
this.fillColor = Colors.white,
this.borderColor = Colors.black,
this.borderWidth = 9,
this.points = 7,
this.innerRadiusRatio = 0.75,
this.pointRounding = 0.5,
// Add inflateRRect to EdgeInsets. #108908
// https://github.com/flutter/flutter/pull/108908
import 'package:flutter/material.dart';
class RRectPainter extends CustomPainter {
const RRectPainter(this.roundedRect);
final RRect roundedRect;