INNER CODE UNIT · Dart

BubblePainter

LanarsInc/animated-bottom-navigation-bar-flutter · lib/src/bubble_selection_painter.dart:3

class BubblePainter extends CustomPainter {
  final double bubbleRadius;
  final double maxBubbleRadius;
  final Color? bubbleColor;
  final Color? endColor;

  BubblePainter({
    required this.bubbleRadius,
    required this.maxBubbleRadius,
    this.bubbleColor = Colors.purple,
  })  : endColor = Color.lerp(bubbleColor, Colors.white, 0.8),
        super();

  @override
  void paint(Canvas canvas, Size size) {
    if (bubbleRadius == maxBubbleRadius) return;

    var animationProgress = bubbleRadius / maxBubbleRadius;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…