touchable 1.0.2 copy "touchable: ^1.0.2" to clipboard
touchable: ^1.0.2 copied to clipboard

Flutter library to add various gesture callbacks to each Shape you draw on your canvas in your CustomPainter

example/lib/main.dart

import 'package:example/screens/screen1.dart';
import 'package:example/screens/screen2.dart';
import 'package:example/screens/screen3.dart';
import 'package:flutter/material.dart';
import 'package:touchable/touchable.dart';

void main() {
  runApp(MaterialApp(
    routes: {
      'screen1': (ctx) => Screen1(),
      'screen2': (ctx) => Screen2(),
      'screen3': (ctx) => Screen3(),
    },
    home: Scaffold(
      body: MyExampleWidget(),
    ),
  ));
}

class MyExampleWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          ElevatedButton(
            onPressed: () {
              Navigator.pushNamed(context, 'screen1');
            },
            child: Text('Screen 1'),
          ),
          ElevatedButton(
            onPressed: () {
              Navigator.pushNamed(context, 'screen2');
            },
            child: Text('Screen 2'),
          ),
          ElevatedButton(
            onPressed: () {
              Navigator.pushNamed(context, 'screen3');
            },
            child: Text('Screen 3'),
          ),
        ],
      ),
    );
  }
}
225
likes
130
points
18.2k
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter library to add various gesture callbacks to each Shape you draw on your canvas in your CustomPainter

Repository (GitHub)
View/report issues

Documentation

API reference

License

MPL-2.0 (license)

Dependencies

flutter

More

Packages that depend on touchable