magnetic 0.0.2 copy "magnetic: ^0.0.2" to clipboard
magnetic: ^0.0.2 copied to clipboard

The main attractive functionality of these widget is that they are magnetic and basically follow the mouse pointer when it moves on the button area and when the mouse leaves the button area it will re [...]

example/lib/main.dart

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

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const HomePage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return const Scaffold(
      body: Center(
        child: MagneticWidget(
          duration: Duration(milliseconds: 100),
          child: Icon(
            Icons.thumb_up,
            size: 100,
          ),
        ),
      ),
    );
  }
}
5
likes
140
pub points
0%
popularity

Publisher

unverified uploader

The main attractive functionality of these widget is that they are magnetic and basically follow the mouse pointer when it moves on the button area and when the mouse leaves the button area it will reset the button transform styles to zero.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on magnetic