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

A new Flutter package for slide animation.

'flutter_slide_animation' is a package that provides animated slide transitions for widgets in Flutter.

Installation #

To use this package, add flutter_slide_animation as a dependency in your pubspec.yaml file: dependencies: flutter: sdk: flutter flutter_slide_animation: ^0.0.1 # Replace with the latest version

Getting started #

Import

    import 'package:flutter_slide_animation/flutter_slide_animation.dart';

Usage #

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Slide Animation',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

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


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

class _MyHomePageState extends State<MyHomePage> {
  bool animate = false;

  void _animateButton() {
    setState(() {
      animate = !animate;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const Text('Slide Animation'),
      ),
      body: Center(
        child: SlideAnimation(
            isAnimate: animate,
            slideDirection: SlideDirection.up,
            child: ElevatedButton(onPressed: () {
              _animateButton();
            }, child: const Text('Animate me'),)
        ),
      ),
    );
  }
}

Buy Me A Coffee

Additional information #

Developer: Baqar Naqvi Email: naqvibaqar74@gmail.com

0
likes
130
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter package for slide animation.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_slide_animation