wilin52 / popup_window

a library to present popup window.

Home Page:https://pub.dev/packages/popup_window

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

popup_window

Screenshot

A library to display a view like window in android native.

Getting Started

1.Install

dependencies:
  popup_window: ^1.1.2

2.Import

import 'package:popup_window/popup_window.dart';

3.Usage


/// call directly
showWindow<T>(
        context: context,
        position: position, /// RelativeRect
        duration: widget.duration,
        windowBuilder: widget.windowBuilder,
        onWindowShow: widget.onWindowShow,
        onWindowDismiss: widget.onWindowDismiss);

or

/// windowHeigh = 200;
PopupWindowButton(
  offset: Offset(0, windowHeight),
  buttonBuilder: (BuildContext context) {
    return PopupWindowBtn();
  },
  windowBuilder: (BuildContext context, Animation<double> animation,
     Animation<double> secondaryAnimation) {
    return FadeTransition(
      opacity: animation,
      child: SizeTransition(
        sizeFactor: animation,
        child: Container(
          color: Colors.greenAccent,
          height: windowHeight,
        ),
      ),
    );
  },
  onWindowShow: () {
    print('PopupWindowButton window show');
  },
  onWindowDismiss: () {
     print('PopupWindowButton window dismiss');
  },
)

More detail see example: main.dart

About

a library to present popup window.

https://pub.dev/packages/popup_window

License:Other


Languages

Language:Dart 79.4%Language:Objective-C 11.6%Language:Kotlin 5.2%Language:Shell 3.8%