flutter_joystick_customisable 0.1.0 copy "flutter_joystick_customisable: ^0.1.0" to clipboard
flutter_joystick_customisable: ^0.1.0 copied to clipboard

A Flutter plugin for joystick with customisable options.

example/lib/main.dart

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

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  DragInfo? _dragInfo;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Container(
            color: Colors.black,
            child: Center(
                child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceAround,
              children: [
                Text(
                  "x: ${_dragInfo?.x ?? 0.0}, y: ${_dragInfo?.y ?? 0.0}",
                  style: const TextStyle(color: Colors.white),
                ),
                Joystick(dragCallback: (DragInfo? dragInfo) {
                  setState(() {
                    _dragInfo = dragInfo;
                  });
                })
              ],
            ))),
      ),
    );
  }
}
6
likes
0
points
29
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for joystick with customisable options.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface

More

Packages that depend on flutter_joystick_customisable