thumb_slider 0.1.0-dev.1 copy "thumb_slider: ^0.1.0-dev.1" to clipboard
thumb_slider: ^0.1.0-dev.1 copied to clipboard

A slider that supports with custom thumb

example/lib/main.dart

// Copyright (c) 2022 Dewin J. Martínez
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  var _value = 1.0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Thumb Slider Example'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ThumbSlider(
              value: _value,
              thumbHeight: 32,
              thumbWidth: 40,
              minValue: 1,
              maxValue: 200,
              onChanged: (value) {
                setState(() {
                  _value = value;
                });
              },
            ),
            Text('The value is: $_value'),
          ],
        ),
      ),
    );
  }
}
2
likes
150
points
9
downloads

Documentation

API reference

Publisher

verified publisherdewinmartinez.com

Weekly Downloads

A slider that supports with custom thumb

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on thumb_slider