perspective_pageview 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 76

Perspective Pageview #

Easy to use 3D-Perspective PageView built upon the regular PageView provided by Flutter SDK.

Current Features #

  • Supports 2 Aspect Ratios [1:1 & 16:9]
  • Enable/Disable Shadow
  • Change Shadow Color

Demo #

Usage #

To Use, simply add Perspective PageView to your widget tree like this:

Container(
          child: Center(
            // Adding Child Widget of Perspective PageView
            child: PerspectivePageView(
              hasShadow: true, // Enable-Disable Shadow
              shadowColor: Colors.black12, // Change Color
              aspectRatio: PVAspectRatio.ONE_ONE, // Aspect Ratio of 1:1 (Default)
              children: <Widget>[
                GestureDetector(
                  onTap: () {
                    debugPrint("Statement One");
                  },
                  child: Container(
                    color: Colors.red,
                  ),
                ),
                GestureDetector(
                  onTap: () {
                    debugPrint("Statement Two");
                  },
                  child: Container(
                    color: Colors.green,
                  ),
                )
              ],

            ),
          ),
        ),

You can use any of the below mentioned Enums for AspectRatio:

PVAspectRatio.ONE_ONE //for 1:1
PVAspectRatio.SIXTEEN_NINE // for 16:9

Roadmap #

Plans to add more variations to PageView transitions.

License #

MIT

[0.1.1] - April 13, 2020 #

  • Support for Aspect Ratio 1:1 & 16:9
  • Disable/Enable Shadow and Change Shadow Color

example/lib/main.dart

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

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

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

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        body: Container(
          child: Center(
            child: PerspectivePageView(
              hasShadow: true, // Enable-Disable Shadow
              shadowColor: Colors.black12, // Change Color
              aspectRatio: PVAspectRatio.ONE_ONE, // Add Aspect Ratio
              children: <Widget>[
                GestureDetector(
                  onTap: () {
                    debugPrint("Statement One");
                  },
                  child: Container(
                    color: Colors.red,
                  ),
                ),
                GestureDetector(
                  onTap: () {
                    debugPrint("Statement Two");
                  },
                  child: Container(
                    color: Colors.green,
                  ),
                )
              ],
              
            ),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  perspective_pageview: ^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:perspective_pageview/perspective_pageview.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
51
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]
76
Learn more about scoring.

We analyzed this package on Jul 11, 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:

  • perspective_pageview that is a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
flutter 0.0.0
provider ^4.0.4 4.3.1
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
nested 0.0.4
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test