snapclip_pageview 0.0.1

snapclip_pageview #

Awesome PageView that provides flexible and customizable Widget for Flutter. A pageview library for building foreground and background UI. Clipping background for pageview.

Getting Started #

Very easily usable and customizable library. Colors and curves can be customised.

snap clip sample

How to use.

goto pubspec.yaml file add

  snapclip_pageview : 0.0.1

import inside your project.

import 'package:snapclip_pageview/snapclip_pageview.dart';

Inside Scaffold Use the widget.

 Scaffold(
      backgroundColor: Colors.blue,
      body: SnapClipPageView(
        backgroundBuilder: buildBackground,
        itemBuilder: buildChild,
        length: movieList.length,
      ),
    );

Item Builder is used for foreground.

    PageViewItem(
      key: Key(index.toString()),
      child:   Text(
            movie.title,
            style: Theme.of(context).textTheme.headline,
          ),
      height: 405,
      index: index,
    );

Using Background Builder.

    BackgroundWidget(
      key: Key(index.toString()),
      child: Image.network(movie.url, fit: BoxFit.fill),
      index: index,
    );

Full Example. #

class MoviePage extends StatefulWidget {
  @override
  _MoviePageState createState() => _MoviePageState();
}

class _MoviePageState extends State<MoviePage> {
  var movieList = <Movie>[];

  @override
  void initState() {
    movieList.addAll([
      Movie(
        "https://www.movieposters4u.com/images/b/BladeRunner2049Final.jpg",
        "Blade Runner",
      ),
      Movie(
        "https://images-na.ssl-images-amazon.com/images/I/51%2Bzb74v-TL.jpg",
        "Star Wars",
      ),
      Movie(
        "https://d13ezvd6yrslxm.cloudfront.net/wp/wp-content/images/EJWDEpFXsAMm9gJ.jpg",
        "6 Underground",
      ),
    ]);
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.blue,
      body: SnapClipPageView(
        backgroundBuilder: buildBackground,
        itemBuilder: buildChild,
        length: movieList.length,
      ),
    );
  }

  BackgroundWidget buildBackground(_, index) {
    final movie = movieList[index];
    return BackgroundWidget(
      key: Key(index.toString()),
      child: Image.network(movie.url, fit: BoxFit.fill),
      index: index,
    );
  }

  PageViewItem buildChild(_, int index) {
    final movie = movieList[index];
    return PageViewItem(
      key: Key(index.toString()),
      child: Column(
        children: <Widget>[
          ClipRRect(
            borderRadius: BorderRadius.circular(25),
            child: Image.network(
              movie.url,
            ),
          ),
          SizedBox(
            height: 15,
          ),
          Text(
            movie.title,
            style: Theme.of(context).textTheme.headline,
          )
        ],
      ),
      height: 405,
      index: index,
    );
  }
}

[0.0.1] - Initial Release

  • Initial Release

Use this package as a library

1. Depend on it

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


dependencies:
  snapclip_pageview: ^0.0.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:snapclip_pageview/snapclip_pageview.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
27
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
62
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and snapclip_pageview.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

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