Coder Social home page Coder Social logo

armaan-miglani / glass_kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bharat-1809/glass_kit

0.0 0.0 0.0 6.82 MB

๐Ÿ’Ž A package containing widgets to implement glass morphism in flutter apps

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

License: MIT License

Ruby 2.58% Objective-C 0.07% Kotlin 0.24% Dart 96.34% Swift 0.77%

glass_kit's Introduction

Glass Kit

A package containing widgets to implement glass morphism in flutter apps


Platform Pub Package Build Status Codecov Coverage License: MIT Donate


Table of contents

About

GlassMorphism, is a new UI trend with a huge popularity among designers. Glass Kit provides you with widgets and other elements to implement this style in your flutter apps easily and efficiently.

Gallery:



ios-themed-glassmorphism ย  ย  ย  ย  glassmorphism-in-card

Source code for the above can be found in the example directory here


Getting Started

You should add the following to the pubspec.yaml file:

dependencies:
  glass_kit: ^2.0.1

You should then run flutter packages get in your terminal so as to get the package.

Now import the package in the dart file:

import 'package:glass_kit/glass_kit.dart';

Usage

To create a basic clear glass container you can use the clearGlass constructor. Just provide the height and width and you are good to go. The clearGlass and frostedGlass constructors assign default values to the properties if not provided.

GlassContainer.clearGlass(height: 200, width: 300, child: Child());

To create a frosted glass container use the frostedGlass constructor.

GlassContainer.frostedGlass(height: 200, width: 300, child: Child());

Depending on your requirements you can tweak with the properties and create awesome glass widgets. You can also use the GlassContainer constructor to create fully customizable glass widgets.

Note : GlassContainer comes with properties as in a regular Container but with some exceptions and additions. Checkout the docs for the list of properties and their default values.

Here's a fully customized GlassContainer with shape as circle:

GlassContainer(
      height: 300,
      width: 400,
      gradient: LinearGradient(
        colors: [Colors.white.withOpacity(0.40), Colors.white.withOpacity(0.10)],
        begin: Alignment.topLeft,
        end: Alignment.bottomRight,
      ),
      borderGradient: LinearGradient(
        colors: [Colors.white.withOpacity(0.60), Colors.white.withOpacity(0.10), Colors.lightBlueAccent.withOpacity(0.05), Colors.lightBlueAccent.withOpacity(0.6)],
        begin: Alignment.topLeft,
        end: Alignment.bottomRight,
        stops: [0.0, 0.39, 0.40, 1.0],
      ),
      blur: 15.0,
      borderWidth: 1.5,
      elevation: 3.0,
      isFrostedGlass: true,
      shadowColor: Colors.black.withOpacity(0.20),
      alignment: Alignment.center,
      frostedOpacity: 0.12,
      margin: EdgeInsets.all(8.0),
      padding: EdgeInsets.all(8.0),
    );

Note : You can also provide borderRadius but when the shape is BoxShape.rectangle.

Bugs or Requests

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on GitHub and I'll look into it. Pull requests are also welcome.

See Contributing.md.

Contributors

Thanks goes to these wonderful people (emoji key):


Kabilan VS

๐Ÿ› ๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind are welcome! See Contributing.md.

License

glass_kit is licensed under MIT License

glass_kit's People

Contributors

bharat-1809 avatar kabilan235 avatar allcontributors[bot] 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.