wagon_wheel 0.0.1 copy "wagon_wheel: ^0.0.1" to clipboard
wagon_wheel: ^0.0.1 copied to clipboard

A new Flutter package to create a custom wagon wheel widget for cricket applications.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:wagon_wheel/models/ball.dart';
import 'package:wagon_wheel/wagon_wheel.dart';

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

class WagonWheelExample extends StatefulWidget {
  const WagonWheelExample({Key? key}) : super(key: key);

  @override
  State<WagonWheelExample> createState() => _WagonWheelExampleState();
}

class _WagonWheelExampleState extends State<WagonWheelExample> {
  List<Ball> balls = [];
  @override
  void initState() {
    super.initState();
    for (int i = 0; i < 15; i++) {
      balls.add(
        Ball(
          angle: (20 * i).toDouble(),
          runs: i % 3 == 0 ? 4 : 6,
        ),
      );
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SizedBox(
          width: double.infinity,
          height: double.infinity,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              WagonWheel(
                balls: balls,
                fourColor: Colors.blue,
                sixColor: Colors.red,
                background: Stack(
                  children: [
                    Container(
                      color: Colors.green,
                    ),
                    Center(
                      child: Container(
                        width: 10,
                        height: 60,
                        color: Colors.amberAccent,
                      ),
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
6
likes
150
pub points
38%
popularity

Publisher

verified publishertauqeer.me

A new Flutter package to create a custom wagon wheel widget for cricket applications.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on wagon_wheel