animated_floating_widget 1.0.0 copy "animated_floating_widget: ^1.0.0" to clipboard
animated_floating_widget: ^1.0.0 copied to clipboard

Floating animated widget that help user to show his widget as float with animation.

example/lib/main.dart

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

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

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

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

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const Text('Floating Widget'),
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Center(
              child: FloatingWidget(
            verticalSpace: 20,
            duration: const Duration(
              seconds: 3,
            ),
            reverseDuration: const Duration(seconds: 1),
            child: Container(
              width: 200,
              height: 60,
              decoration: BoxDecoration(
                  color: const Color(0xff27374D),
                  borderRadius: BorderRadius.circular(10)),
              child: const Center(
                child: Text(
                  "Floating widget",
                  style: TextStyle(fontSize: 15, color: Colors.white),
                ),
              ),
            ),
          )),
        ],
      ),
    );
  }
}
13
likes
150
points
213
downloads

Publisher

verified publisherbakrhw.com

Weekly Downloads

Floating animated widget that help user to show his widget as float with animation.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on animated_floating_widget