tridimensional_drawer 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 78

Tridimensional Drawer #

Tridimensional Drawer is an easy way to create a 3D Perspective drawer, where you can insert any type of widget.

Version 0.1.0 Note #

The version 0.1.0 solves the exception caused by the SingleTickerProviderStateMixin.

Demo #

drawing

Installing #

Add the package to your pubspec.yml file

dependencies:
    tridimensional_drawer: ^0.1.1

Example #

Full example available in the example folder.

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

class Example extends StatefulWidget {
  @override
  _ExampleState createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  final TridimensionalDrawerController controller =
      TridimensionalDrawerController();

  @override
  Widget build(BuildContext context) {
    return TridimensionalDrawer(
      controller: controller,
      mainPage: GestureDetector(
        onTap: () => controller.open(),
        child: MainPage(),
      ),
      drawer: CustomDrawer(),
      backgroundPage: GestureDetector(
        onTap: () => controller.close(),
        child: Container(
          color: Colors.white,
        ),
      ),
    );
  }
}

Hint #

If you use a widget containing a Scaffold as the mainPage, try to wrap the body of it inside a SingleChildScrollView, otherwise the rendering of the mainPage could go wrong at the end of the drawer opening animation.

[0.0.1] - April 09 2020. #

  • Testing publish.

[0.0.2] - April 09 2020. #

  • Update Readme.

[0.0.3] - April 09 2020. #

  • Update Demo gif.

[0.0.4] - April 09 2020. #

  • Resized Demo gif

[0.0.5] - April 18 2020. #

  • Added example folder with a full example

[0.0.6] - April 18 2020. #

  • Update README

[0.1.0] - May 18 2020. #

  • Fix Ticker issue

[0.1.1] - May 18 2020. #

  • Update description 0.1.0 release

example/example.dart

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

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

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

class Example extends StatefulWidget {
  @override
  _ExampleState createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  final TridimensionalDrawerController controller =
      TridimensionalDrawerController();

  @override
  void dispose() {
    controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return TridimensionalDrawer(
      controller: controller,
      mainPage: GestureDetector(
        onTap: () => controller.open(),
        child: MainPage(),
      ),
      drawer: CustomDrawer(),
      backgroundPage: GestureDetector(
        onTap: () => controller.close(),
        child: Container(
          color: Colors.white,
        ),
      ),
    );
  }
}

class MainPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        decoration: BoxDecoration(
          gradient: LinearGradient(
            colors: [
              Colors.blue[600],
              Colors.blue[800],
            ],
            begin: Alignment.topRight,
            end: Alignment.bottomLeft,
          ),
        ),
        child: Center(
          child: Text(
            'Main Page',
            style: TextStyle(color: Colors.white, fontSize: 24.0),
          ),
        ),
      ),
    );
  }
}

class CustomDrawer extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        decoration: BoxDecoration(
          gradient: LinearGradient(
            colors: [
              Colors.blue[600],
              Colors.blue[800],
            ],
            begin: Alignment.topLeft,
            end: Alignment.bottomRight,
          ),
        ),
        child: Center(
          child: Text(
            'Drawer',
            style: TextStyle(color: Colors.white, fontSize: 24.0),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  tridimensional_drawer: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:tridimensional_drawer/tridimensional_drawer.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
56
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]
78
Learn more about scoring.

We analyzed this package on Jul 7, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • tridimensional_drawer that is a package requiring null.

Health suggestions

Format lib/tridimensional_drawer.dart.

Run flutter format to format lib/tridimensional_drawer.dart.

Format lib/tridimensional_drawer_controller.dart.

Run flutter format to format lib/tridimensional_drawer_controller.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test