linear_gradient 0.1.12

  • Readme
  • Changelog
  • Example
  • Installing
  • 83

linear_gradient #

Linear gradient with 300+ different color combination. Also, it will options for change gradient orientation Vertical and Horizontal. Now you can use Gradients style color as theme. By using getColorCombination() to get Gradients color list by passing gradient type.

Feedback and Pull Requests are most welcome!

Installation #

Add to pubspec.yaml.

dependencies:
  ...
  linear_gradient: ^0.1.12

How to use. #

import custom_gradient.dart

import 'package:linear_gradient/linear_gradient.dart';

Usage Example. #

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  /// This is an example app which make use of
  /// How to use Custom Gradient Box Decoration

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Container(
        decoration: BoxDecoration(
            gradient: LinearGradientStyle.linearGradient(
                orientation: LinearGradientStyle.ORIENTATION_HORIZONTAL,
                gradientType: LinearGradientStyle.GRADIENT_TYPE_AMIN)),
      ),
    );
  }
}

Screenshot #

Gradient Orientation. #

LinearGradientStyle.ORIENTATION_HORIZONTAL
LinearGradientStyle.ORIENTATION_VERTICAL

Gradient Type (300+ Type are available). #

Here is Some Examples.

LinearGradientStyle.GRADIENT_TYPE_GRADE_GREY
LinearGradientStyle.GRADIENT_TYPE_PIGGY_PINK
LinearGradientStyle.GRADIENT_TYPE_COOL_BLUES
LinearGradientStyle.GRADIENT_TYPE_MEGATRON
LinearGradientStyle.GRADIENT_TYPE_MOONLIT_ASTEROID.
LinearGradientStyle.GRADIENT_TYPE_JSHINE
LinearGradientStyle.GRADIENT_TYPE_EVENING_SUNSHINE.
LinearGradientStyle.GRADIENT_TYPE_DARK_OCEAN
LinearGradientStyle.GRADIENT_TYPE_COOL_SKY
LinearGradientStyle.GRADIENT_TYPE_YODA
LinearGradientStyle.GRADIENT_TYPE_MEMARIANI

Get Gradients color list by passing gradient type #

List<Color> colorCombination = LinearGradientStyle.getColorCombination(
      gradientType: LinearGradientStyle.GRADIENT_TYPE_ROYAL);

Video #

Watch Video

0.1.12 #

  • Clean code.

0.1.11 #

  • Added code snips for get Gradients color list by passing gradient type.

0.1.10 #

  • Added Documents.
  • Update README file.

0.1.9 #

  • Added new method getColorCombination() to get Gradients color list by passing gradient type.
  • Now you can use Gradients style color as theme.

0.1.8 #

  • Update README.

0.1.7 #

  • Added Screenshot in README.

0.1.6 #

  • Added Documents.
  • Update README file.

0.1.5 #

  • Added new gradients.
  • Update README file.

0.1.4 #

  • Added new gradients.
  • Removed unused file and code.

0.1.3 #

  • Added new gradients.
  • Minor bug fix.

0.1.2 #

  • Updated README file.

0.1.1 #

  • Updated README file.

0.1.0 #

  • Published Initial Version.

example/main.dart

import 'package:flutter/material.dart';

import '../lib/linear_gradient.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  /// This is an example app which make use of
  /// How to use `Custom Gradient Box Decoration`
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Container(
        decoration: BoxDecoration(
            gradient: LinearGradientStyle.linearGradient(
                orientation: LinearGradientStyle.ORIENTATION_HORIZONTAL,
                gradientType: LinearGradientStyle.GRADIENT_TYPE_AMIN)),
      ),
    );
  }

  /// Get Gradients color list by passing gradient type
  List<Color> colorCombination = LinearGradientStyle.getColorCombination(
      gradientType: LinearGradientStyle.GRADIENT_TYPE_ROYAL);
}

Use this package as a library

1. Depend on it

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


dependencies:
  linear_gradient: ^0.1.12

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support 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:linear_gradient/linear_gradient.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
67
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
83
Learn more about scoring.

We analyzed this package on Dec 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.13.1+4
  • Flutter: 1.12.13+hotfix.2

Health issues and suggestions

Document public APIs. (-0.74 points)

335 out of 338 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test