flutter_cursor 0.1.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 87

flutter_cursor pub package #

Custom cursor support for Flutter Web.

Wrap your widgets with HoverCursor and pass a cursor, and it will be updated when entering/leaving the hover zone.

Pub - API Docs - GitHub

Install #

Install by adding this package to your pubspec.yaml:

dependencies:
  flutter_cursor: ^0.1.3

Usage #

See Flutter example for a full overview.

HoverCursor #

Changes cursor when entering/leaving the widget's hover zone on the web. This is safe to add on mobile (will have no effect).

import 'package:flutter_cursor/flutter_cursor.dart';

HoverCursor(
    cursor: Cursor.move,
    child: RaisedButton(
      child: Text("Move Cursor"),
    ),
)

Cursors #

The Cursor enum has all the possible CSS cursor values.

You may also pass a customCursor argument to set a custom cursor (such as a URL), this will be passed directly to cursor.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

[0.1.3] - 2020-05-27 #

  • Add exitOnDispose option for when navigating away (enabled by default)

[0.1.2] - 2020-05-06 #

  • Add license

[0.1.1] - 2020-05-06 #

  • Update description & links

[0.1.0] - 2020-05-06 #

  • Initial release

example/flutter_cursor_example.dart

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

void main() => runApp(new CursorExample());

class CursorExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'flutter_cursor example',
      home: Scaffold(
        appBar: AppBar(
          title: Text('flutter_cursor example'),
        ),
        body: Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: <Widget>[
            Center(
              child: HoverCursor(
                cursor: Cursor.move,
                child: RaisedButton(
                  child: Text("Move Cursor"),
                  onPressed: () {},
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_cursor: ^0.1.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_cursor/flutter_cursor.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
74
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
87
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • flutter_cursor that is a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
flutter 0.0.0
universal_html ^1.2.0 1.2.3
Transitive dependencies
async 2.4.2
charcode 1.1.3
collection 1.14.12 1.14.13
csslib 0.16.1
html 0.14.0+3
meta 1.1.8 1.2.2
path 1.7.0
sky_engine 0.0.99
source_span 1.7.0
term_glyph 1.1.0
typed_data 1.1.6 1.2.0
universal_io 1.0.1
vector_math 2.0.8 2.1.0-nullsafety
zone_local 0.1.2