cubef 1.0.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new66

Flutter CubeF #

A 3D Cube Widget, which simulate animation (roll-up, roll-down, roll-left, and roll-right), and you can also skinning the sides. This widget is inspired by [https://github.com/deven98/flip_box_bar].

Demo #

Install and how to use it. #

Please visit my blog [https://dev.jas-tip.com/flutter-cube-widget].

[1.0.3] - 04-APR-2019.

  • Change 6 childs parameter into List<Widget> sides.
  • Format the code, (remove unused variable)

[1.0.2] - 04-APR-2019.

  • Intial publish

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Cubef Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Cubef Widget Example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  GlobalKey<CubefState> cubefKey = new GlobalKey<CubefState>();
  
  void rollDown() {
    cubefKey.currentState.rollDown();
  }

  void rollUp() {
    cubefKey.currentState.rollUp();
  }

  void rollLeft() {
    cubefKey.currentState.rollLeft();
  }

  void rollRight() {
    cubefKey.currentState.rollRight();
  }

  static double _width = 100.0, _height = 100.0;

  List<Widget> sides = [
    Container(
      height: _height,
      width: _width,
      decoration: BoxDecoration(
        color: Colors.black
      ),
      child: Text("1"),
    ),
    Container(
      height: _height,
      width: _width,
      decoration: BoxDecoration(
        color: Colors.green[500],
      ),
      child: Text("2"),
    ),
    Container(
      height: _height,
      width: _width,
      decoration: BoxDecoration(
        color: Colors.orange[500],
      ),
      child: Text("3"),
    ),
    Container(
      height: _height,
      width: _width,
      decoration: BoxDecoration(
        color: Colors.blue[500],
      ),
      child: Text("4"),
    ),
    Container(
      height: _height,
      width: _width,
      decoration: BoxDecoration(
        color: Colors.pink[500],
      ),
      child: Text("5"),
    ),
    Container(
      height: _height,
      width: _width,
      decoration: BoxDecoration(
        color: Colors.purple[500],
      ),
      child: Text("6"),
    ),
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Cubef(
            key: cubefKey,
            animationDuration: 2000,
            sides: sides,
            width: _width,
            height: _height,
          ),
          Divider(),
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
            RaisedButton(onPressed: rollUp, child: Text('Roll Up')),
            RaisedButton(onPressed: rollDown, child: Text('Roll Down')),
            RaisedButton(onPressed: rollLeft, child: Text('Roll Left')),
            RaisedButton(onPressed: rollRight, child: Text('Roll Right')),
          ],)
        ],
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  cubef: ^1.0.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:cubef/cubef.dart';
  
Version Uploaded Documentation Archive
1.0.3 Apr 6, 2019 Go to the documentation of cubef 1.0.3 Download cubef 1.0.3 archive
1.0.2 Apr 4, 2019 Go to the documentation of cubef 1.0.2 Download cubef 1.0.2 archive
1.0.1+1 Apr 4, 2019 Go to the documentation of cubef 1.0.1+1 Download cubef 1.0.1+1 archive
1.0.1 Apr 4, 2019 Go to the documentation of cubef 1.0.1 Download cubef 1.0.1 archive
1.0.0+1 Apr 4, 2019 Go to the documentation of cubef 1.0.0+1 Download cubef 1.0.0+1 archive
0.1.0+1 Apr 4, 2019 Go to the documentation of cubef 0.1.0+1 Download cubef 0.1.0+1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
32
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
66
Learn more about scoring.

We analyzed this package on Apr 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.4.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/cubef.dart.

Run flutter format to format lib/cubef.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
cupertino_icons ^0.1.2 0.1.2
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test