cursor_follow 0.0.0 copy "cursor_follow: ^0.0.0" to clipboard
cursor_follow: ^0.0.0 copied to clipboard

A cursor follow in desktop

example/lib/main.dart

// ignore_for_file: library_private_types_in_public_api

import 'package:cursor_follow/cursor_follow.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.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: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const AnimatedCursor(child: MyHomePage(title: 'Flutter Demo Home Page')),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            AnimatedCursorMouseRegion(
              decoration: BoxDecoration(
                border: Border.all(color: Colors.white54, width: 2),
                borderRadius: BorderRadius.circular(8),
                color: Colors.white10,
              ),
              child: CupertinoButton(
                color: Colors.redAccent,
                onPressed: () {
                  if (kDebugMode) {
                    print('Hello');
                  }
                },
                child: const Text('Click me!'),
              ),
            ),
            const SizedBox(height: 50),
            AnimatedCursorMouseRegion(
              decoration: BoxDecoration(
                border: Border.all(color: Colors.white54, width: 2),
                color: Colors.white10,
              ),
              child: Container(
                height: 50,
                width: 50,
                color: Colors.blue,
                child: const Center(child: Text('Hello')),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
1
likes
130
points
15
downloads

Publisher

unverified uploader

Weekly Downloads

A cursor follow in desktop

Documentation

API reference

License

MIT (license)

Dependencies

cupertino_icons, flutter, provider

More

Packages that depend on cursor_follow