NeoPOP is CRED's inbuilt library for using NeoPOP components in your app

Overview

NeoPOP

NeoPOP is CRED's inbuilt library for using NeoPOP components in your app.

What really is NeoPOP?

NeoPOP was created with one simple goal; to create the next generation of a beautiful, affirmative design system. NeoPOP stays true to everything that design at CRED stands for.

NeoPOP is built for Android, iOS, Flutter and Web

NeoPOP Banner

Installation

Add neopop as a dependency in your pubspec.yaml file.

dependencies:
    neopop: ^1.0.2

NeoPopButton

Configs NeoPopButton render 5 surfaces, top, left, right, bottom and center. NeoPopButton widget gives you mutliple configs that you can use for your widget.

Elevated

Elevated elevated

NeoPopButton(
    color: Colors.white,
    onTapUp: () => HapticFeedback.vibrate(),
    onTapDown: () => HapticFeedback.vibrate(),
    child: Padding(
        padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
        child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
                Text("Pay now"),
            ],
        ),
    ),
),

Flat

Flat flatButton

By specifying the buttonPosition as Position.center, NeoPOP will compute right and bottom surface's color according to color. Top and left surface's color is computed w.r.t parentColor and grandparentColor

NeoPopButton(
    color: Colors.white,
    onTapUp: () => HapticFeedback.vibrate(),
    onTapDown: () => HapticFeedback.vibrate(),
    parentColor: Colors.transparent,
    buttonPosition: Position.center,
    child: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
        child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: const [
                Text("Pay Now"),
            ],
        ),
    ),
),

Shimmer

const NeoPopShimmer(
    shimmerColor: Colors.yellow,
    child: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 100, vertical: 15),
        child: Text("Hello"),
    ),
),

Flat Strokes

Flat Strokes flatStroked

To add border on a flat button, add border

NeoPopButton(
    color: const Color.fromRGBO(0, 0, 0, 1),
    buttonPosition: Position.center,
    onTapUp: () {},
    border: const Border.fromBorderSide(
        BorderSide(color: kBorderColorWhite, width: kButtonBorderWidth),
    ),
    child: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
        child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: const [
                Text("Pay Now", style: TextStyle(color: Colors.white)),
            ],
        ),
    ),
),

Elevated Strokes

Elevated Strokes elevatedStroked

NeoPopButton(
    color: kSecondaryButtonLightColor,
    bottomShadowColor: ColorUtils.getVerticalShadow(kBorderColorGreen).toColor(),
    rightShadowColor: ColorUtils.getHorizontalShadow(kBorderColorGreen).toColor(),
    animationDuration: kButtonAnimationDuration,
    depth: kButtonDepth,
    onTapUp: () {},
    border: Border.all(
        color: kBorderColorGreen,
        width: kButtonBorderWidth,
    ),
    child: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
        child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: const [
                Text("Scan & Pay", style: TextStyle(color: Colors.white)),
            ],
        ),
    ),
),

Adjacent Buttons

Adjacent Buttons

Vertically Aligned Buttons

Column(
    mainAxisSize: MainAxisSize.min,
    children: [
        NeoPopButton(
        color: kSecondaryButtonLightColor,
        bottomShadowColor: kShadowColorDarkGreen,
        rightShadowColor: kShadowColorGreen,
        buttonPosition: Position.fullBottom,
        onTapUp: () {},
        border: Border.all(
            color: kBorderColorGreen, width: kButtonBorderWidth,
        ),
        child:  const Padding(
                    padding: EdgeInsets.symmetric(horizontal: 8.0, vertical: 15.0),
                    child: Text(
                    "Button",
                    style: TextStyle(color: Colors.white),
                ),
            ),
        ),
        NeoPopButton(
            color: kPrimaryButtonColor,
            buttonPosition: Position.fullBottom,
            onTapUp: () {},
            child:  const Padding(
                padding: EdgeInsets.symmetric(horizontal: 8.0, vertical: 15.0),
                child: Text("Button"),
            ),
        ),
    ],
),

Horizontally Aligned Buttons

Row(
    mainAxisSize: MainAxisSize.min,
    children: [
        Expanded(
        child: NeoPopButton(
            color: kPrimaryButtonColor,
            buttonPosition: Position.fullBottom,
            depth: kButtonDepth,
            onTapUp: () {},
            child: const Center(
            child:  Padding(
                    padding: EdgeInsets.symmetric(
                        horizontal: 8.0, vertical: 15.0),
                    child: Text("Button"),
                    ),
                ),
            ),
        ),
        Expanded(
            child: NeoPopButton(
                color: kSecondaryButtonLightColor,
                bottomShadowColor: kShadowColorDarkGreen,
                rightShadowColor: kShadowColorGreen,
                buttonPosition: Position.fullBottom,
                depth: kButtonDepth,
                onTapUp: () {},
                border: Border.all(
                    color: kBorderColorGreen, width: kButtonBorderWidth,
                ),
                child: const Center(
                child: Padding(
                    padding: EdgeInsets.symmetric( horizontal: 8.0, vertical: 15.0),
                    child: Text(
                            "Button",
                            style: TextStyle(color: Colors.white),
                        ),
                    ),
                ),
            ),
        ),
    ],
),

NeoPopButton Attributes

Attribute Type Description
child Widget The child of button widget
color Color Color of the button
depth double The depth of the button if it is elevated
onTapUp VoidCallback? Callback triggered when the forward & reverse button animation is finished
onTapDown VoidCallback? Callback triggered as soon as the user clicks the enabled button
onLongPress VoidCallback? Callback triggered when user has long pressed the cta
disabledColor Color Color of the button when it is disabled
parentColor Color Button's immediate ancestor's color
grandparentColor Color Button's second level ancestor's color
buttonPosition Position The position of button in reference to parent view. default - Position.fullBottom
animationDuration Duration Animation duration of the button click. default - const Duration(milliseconds: 50)
forwardDuration Duration? If you want different forward duration for button click, use forwardDuration
reverseDuration Duration? If you want different reverse duration for button click, use reverseDuration
border Border? The border to be painted around the button
enabled bool If set to false, the button will be disabled. default - true
shadowColor Color? The base color of the shadow. The shadow colors will be derived from this
rightShadowColor Color? The color of the right shadow.
leftShadowColor Color? The color of the left shadow.
topShadowColor Color? The color of the top shadow.
bottomShadowColor Color? The color of the bottom shadow.

NeoPopTiltedButton

NeoPopTiltedButton

Non Floating

Non Floating tiltNonFloating

 NeoPopTiltedButton(
    color: kPrimaryButtonColor,
    onTapUp: () {},
    child: Padding(
        padding: const EdgeInsets.symmetric(
        horizontal: 80.0,
        vertical: 15,
        ),
        child: SvgPicture.asset('assets/svg/cta_text_view.svg'),
    ),
),

Floating

Floating tiltFloating

NeoPopTiltedButton(
    isFloating: true,
    onTapUp: () => HapticFeedback.vibrate(),
    onTapDown: () => HapticFeedback.vibrate(),
    decoration: const NeoPopTiltedButtonDecoration(
        color: kPopYellowColor,
        plunkColor: kPlunkColorYellow,
        shadowColor: kTiltedButtonShadowColor,
    ),
    child: Padding(
        padding: const EdgeInsets.symmetric(
        horizontal: 70.0,
        vertical: 15,
        ),
        child: SvgPicture.asset('assets/svg/cta_text_play_now.svg'),
    ),
),

Strokes

Strokes TiltStroked

NeoPopTiltedButton(
    isFloating: true,
    onTapUp: () {},
    decoration: const NeoPopTiltedButtonDecoration(
        color: Color(0xFF0D0D0D),
        plunkColor: Color(0xFF3F6915),
        shadowColor: Colors.black,
        border: Border.fromBorderSide(
        BorderSide(color: Color(0xFF8DD04A), width: 1),
        ),
    ),
    child: const Padding(
        padding: EdgeInsets.symmetric(horizontal: 70.0, vertical: 15),
        child: Text('Play Now', style: TextStyle(color: Colors.white)),
    ),
),

Shimmer

shimmer

NeoPopTiltedButton(
    isFloating: true,
    onTapUp: () {},
    decoration: const NeoPopTiltedButtonDecoration(
        color: Color.fromRGBO(255, 235, 52, 1),
        plunkColor: Color.fromRGBO(255, 235, 52, 1),
        shadowColor: Color.fromRGBO(36, 36, 36, 1),
        showShimmer: true,
    ),
    child: const Padding(
        padding: EdgeInsets.symmetric(
        horizontal: 70.0,
        vertical: 15,
        ),
        child: Text('Play Now'),
    ),
),

NeoPopTiltedButton Attributes

Attribute Type Description
child Widget The child of the button
color Color? Color of the button
decoration NeoPopTiltedButtonDecoration? The decoration to paint the button. The color and decoration arguments cannot both be supplied, since it would potentially result in the decoration drawing over the background color. To supply a decoration with a color, use decoration.
buttonDepth double? The depth of the tilted button. default: 8.0
onTapUp VoidCallback? A callback triggered when a pointer that will trigger a tap with button has stopped contacting the screen
onTapDown VoidCallback? A callback triggered when a pointer that might cause a tap with button has contacted the screen
shadowDistance double? The maximum distance from the button at which the shadow is painted. default: 20
yPosFactor double? Factor that defines the floating positions of buttons and shadow along vertical-axis. default: 5
isFloating bool Whether the button is floating. default: false
floatingDuration Duration? The duration of the floating animation. One floating cycle i.e to-and-fro movement of the button and shadow accounts for two floating durations. default: Duration(milliseconds: 1500)
floatingDelay Duration? The delay between two floating cycles. default: Duration(milliseconds: 750)
tapDuration Duration? The duration of the animation when button is pressed or released. default: Duration(milliseconds: 100)
enabled bool Whether the button is enabled. default: true

Contributing

Pull requests are welcome! We'd love help improving this library. Feel free to browse through open issues to look for things that need work. If you have a feature request or bug, please open a new issue so we can track it.

License

Copyright 2022 Dreamplug Technologies Private Limited.  
  
Licensed under the Apache License, Version 2.0 (the "License");  
you may not use this file except in compliance with the License.  
You may obtain a copy of the License at  
  
 http://www.apache.org/licenses/LICENSE-2.0  
Unless required by applicable law or agreed to in writing, software  
distributed under the License is distributed on an "AS IS" BASIS,  
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
See the License for the specific language governing permissions and  
limitations under the License.  
You might also like...

AtmConsultoria - Learning how components work for navigation between screens

AtmConsultoria - Learning how components work for navigation between screens

Aplicativo ATM Consultoria Aprendendo o funcionamento dos seguintes recursos: Na

May 27, 2022

Greentick assignment - State management tool provider and UI components like ListView etc

Greentick assignment - State management tool provider and UI components like ListView etc

greentick_assignment This project is a part of assignment, which demonstrate the

Feb 11, 2022

Scaff is a simple command-line utility for generating Dart and Flutter components from template files.

Introduction Scaffold Generator for Dart and Flutter. scaff is a simple command-line utility for generating Dart and Flutter components from template

Jul 17, 2022

A set of utilities, themes and components for RTU MIREA applications by Mirea Ninja.

A set of utilities, themes and components for RTU MIREA applications by Mirea Ninja.

rtu-app-core - это красиво оформленный пакет компонентов графического интерфейса и многоцелевой набор утилит, разработанный для Flutter. rtu-app-core

Aug 10, 2022

Flutter Control is complex library to maintain App and State management. Library merges multiple functionality under one hood. This approach helps to tidily bound separated logic into complex solution.

Flutter Control is complex library to maintain App and State management. Library merges multiple functionality under one hood. This approach helps to tidily bound separated logic into complex solution.

Flutter Control is complex library to maintain App and State management. Library merges multiple functionality under one hood. This approach helps to

Feb 23, 2022

Flutter-Animated-Library-of-Books - Flutter App - Animated Book Library

bookshelf A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

Dec 4, 2022

[Flutter Library] Flamingo is a firebase firestore model framework library. 🐤

[Flutter Library] Flamingo is a firebase firestore model framework library. 🐤

Flamingo Flamingo is a firebase firestore model framework library. https://pub.dev/packages/flamingo 日本語ドキュメント Example code See the example directory

Sep 22, 2022

Flutter book library - Book Library Application with Flutter and Google Book API

Book Library Application Flutter iOS, Android and Web with Google Book API Demo

Jan 25, 2022

A middleware library for Dart's http library.

http_middleware A middleware library for Dart http library. Getting Started http_middleware is a module that lets you build middleware for Dart's http

Oct 23, 2021
Comments
  • fix: on tap cancel floating button

    fix: on tap cancel floating button

    When we drag away from floating button, it doesn't move back to its expected position.

    https://user-images.githubusercontent.com/72645766/177755915-d07814a3-bf2b-4ec5-8d21-48a3ea75582c.mp4

    https://user-images.githubusercontent.com/72645766/177755932-c3dda058-bf4f-4e5b-98a0-d9b37354564a.mp4

    status: in progress 
    opened by himanshugarg08 0
  • Rounded button?

    Rounded button?

    Hello,

    Was experimenting with this library and would like to know if there is a way to make the buttons rounded with all the effects?

    That would make a nice addition.

    Thanks.

    opened by smunshimi 1
Releases(1.0.2)
News App developed with Flutter featuring beautiful UI, category-based news, story for faster news reading, inbuilt article viewer, share feature, and more.

Ariel News App developed with Flutter featuring beautiful UI, category-based news, story for faster news reading, inbuilt article viewer, share featur

Hash Studios 30 Nov 9, 2022
An incremental DOM library, with support for virtual DOM and components, written in Dart.

domino - a DOM library in Dart Inspired by Google's incremental-dom library, package:domino is a Dart-native DOM library supporting incremental DOM up

null 17 Dec 26, 2022
Magpie-fly is a component library produced by 58 Group, which encapsulates a variety of common components to meet the needs of developers

[toc] magpie_fly Magpie-fly 是58集体出品组件库,封装了多种常用组件,以满足开发者需求。(Magpie-fly is a component library produced by 58 Group, which encapsulates a variety of com

Wuba 40 Mar 18, 2022
SoundVolumeView that displays general information and the current volume level for all active sound components in your system, and allows you to instantly mute and unmute them

SoundVolumeView that displays general information and the current volume level for all active sound components in your system, and allows you to instantly mute and unmute them

Domingo 4 Mar 4, 2022
A collection of templates to make new Flutter components using the Mason build tool.

Mason Flutter Templates A collection of templates to make new Flutter components using the Mason build tool. Setup in Project To use these templates i

Marcus Twichel 5 Jun 21, 2022
We created Flappy Bird, a straightforward game based on flutter animation, from scratch using only Dart & Flutter and no third-party games or animation components.

Flappy-Bird Description A ridiculous game created by Flutter, all you have to do is touch the screen to make the bird leap as long as you avoid the ba

hab 15 Dec 25, 2022
Netflix type clone app to learn animation and basic UI components..

netflix_clone A new Flutter application to learn animation and basic ui components.. Assets credit to dribbble artist Getting Started This project is

Divyam joshi 169 Dec 9, 2022
Components that optimize Flutter fluency.(Flutter 流畅度优化的通用方案,轻松解决卡顿问题)

Flutter fluency optimization component "Keframe" Page switching fluency improved: How to use Project depend on: Quick learning Constructor Description

Ke Technologies 793 Dec 30, 2022
A collection of pixel-perfect iOS-styled components and properties for Flutter, following the official guidelines.

cupertinew ⚠️ Experimental and work in progress ⚠️ A collection of pixel-perfect iOS-styled components and properties for Flutter, following the offic

Jeroen Meijer (Jay) 30 Nov 10, 2022
An enterprise-class package of Flutter components for mobile applications.

Bruno 一套企业级移动端 Flutter 组件库 简体中文 | English ✨ 特性 提炼自企业级移动端产品的交互和视觉风格 开箱即用的高质量 Flutter 组件 提供满足业务差异的主题定制能力 设计工具赋能开发全链路 Demo 下载 适配 Flutter 版本 Bruno 版本 Flut

Ke Technologies 2.2k Jan 2, 2023