Flutter UI #87: Fun with Bubble Slider in Flutter

Tutorial and code of Bubble Slider in Flutter. Copy and paste the below code as per your requirements.

bubble_slider: ^0.0.6

import 'package:bubble_slider/bubble_slider.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Bubble slider',
      theme: ThemeData(
      home: const BubbleDemo(),

class BubbleDemo extends StatefulWidget {
  const BubbleDemo({Key? key}) : super(key: key);

  BubbleDemoState createState() => BubbleDemoState();

class BubbleDemoState extends State<BubbleDemo> with TickerProviderStateMixin {
  double _value = 100.0;
  final double _min = 50.0;
  final double _max = 150.0;

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Center(child: Text(
          'Bubble Slider',
          style: TextStyle(
              color: Colors.white, fontWeight: FontWeight.bold, fontSize: 18),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(30.0),
          child: SizedBox(
            height: 20,
            child: BubbleSlider(
              value: _value,
              min: _min,
              max: _max,
              bubbleSize: BubbleSize.medium,
              thumbRadiusSpeed: ThumbRadiusSpeed.veryFast,
              bubblesSpeed: BubbleSpeed.veryFast,
              isBubbleVisible: true,
              onChanged: (val) {
                _value = val;
              onChangeEnd: (s) {},

No responses yet

Leave a Reply

Your email address will not be published.