clickable 0.0.1-dev copy "clickable: ^0.0.1-dev" to clipboard
clickable: ^0.0.1-dev copied to clipboard

outdated

Clickable components with cascading parameters for report

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: ReportParameterWidget(
          parameter: {'p1': 'p1', 'p2': 'p2'},
          child: Scaffold(
            appBar: AppBar(
              title: Text('Clickable Demo'),
            ),
            body: ReportParameterWidget(
              parameter: {'pp1': 'pp1', 'p2': 'pp2'},
              child: Center(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    Builder(
                      builder: (BuildContext context) {
                        return ClickableWidget(
                          name: 'clickable-text',
                          parameter: {'pp1': 'ppp1', 'p2': 'ppp2', 'ppp3': 'ppp3'},
                          onTap: () {
                            Scaffold.of(context).showSnackBar(SnackBar(
                              content: Text('tap text'),
                              duration: Duration(seconds: 1),
                            ));
                          },
                          onDoubleTap: () {
                            Scaffold.of(context).showSnackBar(SnackBar(
                              content: Text('double tap text'),
                              duration: Duration(seconds: 1),
                            ));
                          },
                          builder: (BuildContext context, bool isHighlight) {
                            return Text(
                              'You can click \nthis text',
                              style: TextStyle(color: isHighlight ? Colors.red : Colors.black),
                              textAlign: TextAlign.center,
                            );
                          },
                        );
                      },
                    ),
                  ],
                ),
              ),
            ), // This trailing comma makes auto-formatting nicer for build methods.
          )),
    );
  }
}
1
likes
0
points
35
downloads

Publisher

verified publishersongfei.org

Weekly Downloads

Clickable components with cascading parameters for report

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on clickable