GithubHelp home page GithubHelp logo

caspertrack69 / popup_banner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yusriltakeuchi/popup_banner

0.0 0.0 0.0 551 KB

License: MIT License

C++ 35.74% C 2.44% Objective-C 0.06% Kotlin 0.21% Dart 25.48% Swift 1.98% HTML 3.11% CMake 30.99%

popup_banner's Introduction

Popup Banner

Popup Banner is a package to show banner slider using modal dialog. We can set the image location, auto slide settings, dots indicator and others.

Popup Banner

Features

  • Customizable Popup
  • Custom Close Button
  • Load Image From Network & Local
  • Auto Slider & Timer
  • Custom Dots Indicator Position & Color

Getting started

You must add the library as a dependency to your project.

dependencies:
 popup_banner: ^1.0.0

You should then run flutter packages get

Example Project

There is a detailed example project in the example folder. You can directly run and play on it. There are code snippets from example project below.

Default Popup

PopupBanner(
  context: context,
  images: [
    "https://tinyurl.com/popup-banner-image",
    "https://tinyurl.com/popup-banner-image2",
    "https://tinyurl.com/popup-banner-image3",
    "https://tinyurl.com/popup-banner-image4"
  ],
  onClick: (index) {
    debugPrint("CLICKED $index");
  },
).show();

Hide Dots Popup

PopupBanner(
  context: context,
  images: [
    "https://tinyurl.com/popup-banner-image",
    "https://tinyurl.com/popup-banner-image2",
    "https://tinyurl.com/popup-banner-image3",
    "https://tinyurl.com/popup-banner-image4"
  ],
  useDots: false,
  onClick: (index) {
    debugPrint("CLICKED $index");
  },
).show();

Customize Dots Popup

PopupBanner(
  context: context,
  images: [
    "https://tinyurl.com/popup-banner-image",
    "https://tinyurl.com/popup-banner-image2",
    "https://tinyurl.com/popup-banner-image3",
    "https://tinyurl.com/popup-banner-image4"
  ],
  dotsAlignment: Alignment.bottomCenter,
  dotsColorActive: Colors.blue,
  dotsColorInactive: Colors.grey.withOpacity(0.5),
  onClick: (index) {
    debugPrint("CLICKED $index");
  },
).show();

Disable Auto Slide & Custom Close Popup

PopupBanner(
  context: context,
  images: [
    "https://tinyurl.com/popup-banner-image",
    "https://tinyurl.com/popup-banner-image2",
    "https://tinyurl.com/popup-banner-image3",
    "https://tinyurl.com/popup-banner-image4"
  ],
  autoSlide: false,
  customCloseButton: ElevatedButton(
    onPressed: () => Navigator.pop(context),
    style: ElevatedButton.styleFrom(
      primary: Colors.blue,
    ),
    child: const Text(
      "Close",
      style: TextStyle(
        color: Colors.white,
      ),
    ),
  ),
  onClick: (index) {
      debugPrint("CLICKED $index");
  },
).show();

Local Asset Popup

PopupBanner(
  context: context,
  images: [
    "assets/images/popup-banner-local-image.jpg",
    "assets/images/popup-banner-local-image2.jpg",
    "assets/images/popup-banner-local-image3.jpeg",
    "assets/images/popup-banner-local-image4.jpg"
  ],
  fromNetwork: false,
  onClick: (index) {},
).show()

Contributions

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Version compatability

See CHANGELOG for all breaking (and non-breaking) changes.


Made with โค by Yusril Rapsanjani

popup_banner's People

Contributors

yusriltakeuchi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.