corner_bouncer 0.0.1-beta.2 copy "corner_bouncer: ^0.0.1-beta.2" to clipboard
corner_bouncer: ^0.0.1-beta.2 copied to clipboard

A simple Flutter widget that bounces around the boundaries of its container, ala that classic DVD menu icon

corner_bouncer #

A simple Flutter widget that bounces around the boundaries of its container, ala that classic DVD menu icon.

Getting Started #

To use the CornerBouncer widget in your Flutter project, you need only wrap it in a LayoutBuilder and then a Stack. These are excellent for adding a little life to a Scaffold background, or for programming a Pong client.

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Corner Bouncer Demo',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Corner Bouncer'),
        ),
        body: LayoutBuilder(
          builder: (BuildContext context, BoxConstraints constraints) {
            return Stack(
              children: <Widget>[
                CornerBouncer(
                  child: FlutterLogo(
                    size: 100,
                  ),
                  childHeight: 100,
                  childWidth: 100,
                  containerWidth: constraints.maxWidth,
                  containerHeight: constraints.maxHeight,
                ),
              ],
            );
          },
        )
      ),
    );
  }
}
Example
1
likes
40
pub points
0%
popularity

Publisher

unverified uploader

A simple Flutter widget that bounces around the boundaries of its container, ala that classic DVD menu icon

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on corner_bouncer