asset_button 1.0.0 copy "asset_button: ^1.0.0" to clipboard
asset_button: ^1.0.0 copied to clipboard

outdated

image button library,include imagebutton & image loader & asset image,etc

example/lib/main.dart

import 'package:asset_button/widget_asset_image.dart';
import 'package:asset_button/widget_image_button.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: MyHomePage());
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('image button example')),
      body: Center(
        child: Column(
          children: [
            WidgetAssetImage(assetPath: 'assets/images/bkg_code.png'),
            WidgetImageButton(
              imageNormal:
                  WidgetAssetImage(assetPath: 'assets/images/icon_normal.png'),
              imageHover:
                  WidgetAssetImage(assetPath: 'assets/images/icon_hover.png'),
              onTap: () {
                print('independent icon image button');
              },
            ),
            WidgetImageButton(
              imageNormal: WidgetAssetImage(
                  assetPath: 'assets/images/icons.png',
                  cropRect: Rect.fromLTWH(61, 168, 92, 92)),
              imageHover: WidgetAssetImage(
                  assetPath: 'assets/images/icons.png',
                  cropRect: Rect.fromLTWH(173, 167, 92, 92)),
              onTap: () {
                print('image button icon crop from one image');
              },
            )
          ],
        ),
      ),
    );
  }
}
4
likes
0
points
58
downloads

Publisher

unverified uploader

Weekly Downloads

image button library,include imagebutton & image loader & asset image,etc

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, image, path

More

Packages that depend on asset_button