easy_pip 0.0.2

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

easy_pip #

A widget for creating a Picture-In-Picture interface in Flutter. Note that this is not a plugin for enabling the PIP mode in Android. EasyPIP makes it easy to construct a YouTube like interface in Flutter.

Usage #

Import the package #

To use this package, add easy_pip as a dependency in your pubspec.yaml

Use the package #

import 'package:easy_pip/easy_pip.dart';

The main widget to use is PIPStack.

The PIPStack has three elements:

  1. Background Widget (Displays behind the pip widget)
  2. PIP Widget (The widget which shrinks to go into PIP mode)
  3. PIP Expanded Content (The content below the PIP widget when the widget is expanded)

Important: The pipEnabled field needs to be set to 'true' to make the pipWindow visible.

Note: If the pipExpandedContent field is left blank, the pipWidget will fill the entire screen when expanded.

Taking an analogy of the YouTube app:

The backgroundWidget would be the master list of all videos.

The pipWidget would be the video player which would be shrinkable and expandable.

The pipExpandedContent would be the list of recommended videos.

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

[0.0.2] - 31/07/2018

  • Corrected required params.
  • Fixed annotations.
  • Corrected examples.
  • Better documentation.

example/lib/main.dart

// Copyright 2017 Deven Joshi. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

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

void main() {
  runApp(new MaterialApp(
    home: new MyHomePage(),
  ));
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  var isEnabled = true;

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(),
      body: PIPStack(
        backgroundWidget: Center(
          child: RaisedButton(
            onPressed: () {
              setState(() {
                isEnabled = !isEnabled;
              });
            },
            child: Text("Click here to enable PIP"),
          ),
        ),
        pipWidget: isEnabled
            ? Container(
          color: Colors.pink,
        )
            : Container(),
        pipEnabled: isEnabled,
        pipExpandedContent: Card(
          color: Colors.white,
          child: Column(
            children: <Widget>[Text("Hello World"), Row()],
          ),
        ),
        onClosed: () {
          setState(() {
            isEnabled = !isEnabled;
          });
        },
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  easy_pip: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or 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:easy_pip/easy_pip.dart';
  
Version Uploaded Documentation Archive
0.1.0 Feb 9, 2019 Go to the documentation of easy_pip 0.1.0 Download easy_pip 0.1.0 archive
0.0.2 Jul 31, 2018 Go to the documentation of easy_pip 0.0.2 Download easy_pip 0.0.2 archive
0.0.1 Jul 30, 2018 Go to the documentation of easy_pip 0.0.1 Download easy_pip 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
54
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
27
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://dart.dev/dart-2#migration.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.