sliding_widget 0.0.1 copy "sliding_widget: ^0.0.1" to clipboard
sliding_widget: ^0.0.1 copied to clipboard

A sliding Flutter widget, which helps to start an event based on user interaction. Highly customizable and flexible.

pub package

A sliding Flutter widget, which helps to start an event based on user interaction. Highly customizable and flexible.

Screenshots #

[example/assets/image1.png]

Features #

  • Highly customizable
  • Easy to use

Getting started #

  1. Import the package.
 import 'package:sliding_widget/sliding_widget.dart';
  1. Use the widget in your code.
 SlidingWidget(
          width: 350,
          height: 60,
          backgroundColor: Colors.blue,
          foregroundColor: Colors.white,
          iconColor: Colors.blue,
          text: 'Slide to proceed',
          shadow: const BoxShadow(color: Colors.transparent),
          onConfirmation: () {},
          child: const Icon(Icons.arrow_forward_ios),
        ) 

Usage #

This full code is from the example folder. You can run the example to see.

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            SlidingWidget(
              width: 350,
              height: 60,
              backgroundColor: Colors.blue,
              foregroundColor: Colors.white,
              iconColor: Colors.blue,
              text: 'Slide to proceed',              
              shadow: const BoxShadow(color: Colors.transparent),
              onConfirmation: () {},
              child: const Icon(Icons.arrow_forward_ios),
            )
          ],
        ),
      ),
    );
  }
}

Custom Usage #

There are several options that allows for more control:

Properties Default Description
height null ?? 70 Gives a height to a widget
width null ?? 300 Gives a width to a widget
backgroundColor Colors.white Gives a background color to a widget
backgroundColorEnd null Gives a background color to a widget while dragged
foregroundColor Colors.blueAccent Gives a color to a slider button
label Slide to proceed A text widget which assigns a label
labelStyle Colors.white70, FontWeight.bold Assigns label TextStyle
shadow Colors.black38, Offset(0, 2), blurRadius: 2 Gives a shadow to a slider button
stickToEnd false Make it true if the Icon need to be placed in the end position
action null (required) Define an action after sliding a button
child Icons.chevron_right For more customizable button add your own widget


11
likes
0
points
39
downloads

Publisher

verified publishercooltechie.info

Weekly Downloads

A sliding Flutter widget, which helps to start an event based on user interaction. Highly customizable and flexible.

Repository (GitHub)
View/report issues

Topics

#slide-widget #slide-button #slide-to #sliding-widget

License

unknown (license)

Dependencies

flutter

More

Packages that depend on sliding_widget