rotation_stage 0.1.0 copy "rotation_stage: ^0.1.0" to clipboard
rotation_stage: ^0.1.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({Key? key}) : super(key: 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({Key? key, required this.title}) : super(key: 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.0),
                      child: Text(
                        side.map(
                          front: "Front",
                          left: "Left",
                          back: "Back",
                          right: "Right",
                        ),
                      ),
                    ),
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
4
likes
110
pub points
62%
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