dynamic_slider 0.1.0-dev.3 copy "dynamic_slider: ^0.1.0-dev.3" to clipboard
dynamic_slider: ^0.1.0-dev.3 copied to clipboard

A custom implementation of Slider widget in Flutter that accepts values on a sliding scale.

example/lib/main.dart

import 'package:example/screens/custom_thumb_dynamic_slider_screen.dart';
import 'package:example/screens/dynamic_slider_screen.dart';
import 'package:example/screens/labeled_slider_screen.dart';
import 'package:example/screens/rating_dynamic_slider_screen.dart';
import 'package:flutter/material.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Dynamic Slider Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Dynamic Slider'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);
  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  void _navigateToScreen(BuildContext context, Widget widget) {
    Navigator.of(context).push(MaterialPageRoute(builder: (context) => widget));
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
                onPressed: () {
                  _navigateToScreen(context, const DynamicSliderScreen());
                },
                child: const Text("Dynamic Slider")),
            ElevatedButton(
                onPressed: () {
                  _navigateToScreen(context, const LabeledDynamicSliderScreen());
                },
                child: const Text("Labeled Dynamic Slider")),
            ElevatedButton(
                onPressed: () {
                  _navigateToScreen(context, const RatingDynamicSliderScreen());
                },
                child: const Text("Rating Dynamic Slider")),
            ElevatedButton(
                onPressed: () {
                  _navigateToScreen(context, const CustomThumbDynamicSliderScreen());
                },
                child: const Text("Custom Thumb Dynamic Slider")),
          ],
        ),
      ),
    );
  }
}
1
likes
150
pub points
3%
popularity

Publisher

verified publisheroaktreeapps.com

A custom implementation of Slider widget in Flutter that accepts values on a sliding scale.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on dynamic_slider