sliding_widget 0.0.4
sliding_widget: ^0.0.4 copied to clipboard
A sliding Flutter widget, which helps to start an event based on user interaction. Highly customizable and flexible.
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>[
Center(
child: SlidingWidget(
width: 350,
height: 60,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
iconColor: Colors.blue,
label: 'Slide to proceed',
shadow: const BoxShadow(color: Colors.transparent),
action: () {},
child: const Icon(Icons.arrow_forward_ios),
),
)
],
),
),
);
}
}