rotation_stage 0.3.0 copy "rotation_stage: ^0.3.0" to clipboard
rotation_stage: ^0.3.0 copied to clipboard

A four-sided stage for representing 3D objects with four widgets

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Rotation Stage Example',
      theme: ThemeData(
        useMaterial3: true,
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
      ),
      home: const MyHomePage(title: 'Rotation Stage'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({required this.title, super.key});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: SafeArea(
        child: RotationStage(
          contentBuilder: (
            int index,
            RotationStageSide side,
            double currentPage,
          ) =>
              Padding(
            padding: const EdgeInsets.all(64),
            child: SizedBox.expand(
              child: Card(
                elevation: 0,
                color: Theme.of(context).colorScheme.inverseSurface,
                child: Center(
                  child: Card(
                    color: Colors.white,
                    child: Padding(
                      padding: const EdgeInsets.all(8),
                      child: Text(
                        side.map(
                          front: "Front",
                          left: "Left",
                          back: "Back",
                          right: "Right",
                        ),
                      ),
                    ),
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
5
likes
160
pub points
49%
popularity

Publisher

verified publisherwhynotmake.it

A four-sided stage for representing 3D objects with four widgets

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on rotation_stage