circular_motion 0.0.6 copy "circular_motion: ^0.0.6" to clipboard
circular_motion: ^0.0.6 copied to clipboard

A package to create a circular positioned widgets and can be scrolled to rotate them in the desired circular way.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Circular Motion',
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          title: const Text(
            'Circular Motion',
            style: TextStyle(color: Colors.black),
          ),
          elevation: 0,
          backgroundColor: Colors.transparent,
        ),
        body: Center(
          child: SizedBox(
            width: 390,
            height: 390,
            child: SafeArea(
              // Here's the magic.
              child: CircularMotion(
                behavior: HitTestBehavior.translucent,
                centerWidget: Container(
                  width: 100,
                  height: 100,
                  decoration: BoxDecoration(
                    color: Colors.red,
                    borderRadius: BorderRadius.circular(30),
                  ),
                  child: const Center(
                    child: Text('center'),
                  ),
                ),
                children: List.generate(
                  6,
                  (index) {
                    return Container(
                      width: 100,
                      height: 100,
                      decoration: BoxDecoration(
                        color: Colors.primaries[index],
                        shape: BoxShape.circle,
                      ),
                      child: Center(
                        child: Text('${index + 1}'),
                      ),
                    );
                  },
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
26
likes
160
pub points
81%
popularity

Publisher

verified publisherlewiseman.com

A package to create a circular positioned widgets and can be scrolled to rotate them in the desired circular way.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on circular_motion