animated_slider_button 0.0.1
animated_slider_button: ^0.0.1 copied to clipboard
Animated Slider Button is a Flutter package offering a customizable, interactive slider button with smooth animations, allowing users to trigger actions through sliding."
Animated Slider Button #
animated_slider_button
is a Flutter package that provides an interactive slider button with smooth animations. This widget allows users to perform an action by sliding a button, giving a dynamic and engaging user experience.
Features #
- Smooth Animations: Features animated transitions for size, color, and text opacity.
- Customizable: Easily adjust the width, height, colors, and animation duration.
- Interactive: Provides visual feedback during dragging and sliding actions.
Installation #
To use animated_slider_button
, add it to your pubspec.yaml
file:
dependencies:
animated_slider_button: ^0.0.1
Usage #
import 'package:flutter/material.dart';
import 'package:animated_slider_button/animated_slider_button.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Animated Slider Button'),
),
body: Center(
child: AnimatedSliderButton(
width: 240,
height: 60,
buttonText: 'Slide to Continue',
backgroundColor: Colors.blue,
afterSlideColor: Colors.green,
iconColor: Colors.white,
onPress: () {
// Action to be performed after slide
print('Slider button pressed');
},
),
),
),
);
}
}
Parameters #
- width: double - The width of the slider button. Default is 240.
- height: double - The height of the slider button. Default is 60.
- buttonText: String - The text displayed on the slider button. Default is 'Slide to Continue'.
- backgroundColor: Color - The background color of the slider button before sliding.
- afterSlideColor: Color - The background color of the slider button after sliding.
- iconColor: Color - The color of the slider icon after the slide.
- onPress: VoidCallback - The callback function executed after the slider button is successfully