gradient_toolbar 0.0.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 71

gradient_toolbar #

A Flutter package to add a gradient toolbar with a lot of customization.

Usage #

To use this plugin, add gradient_toolbar as a dependency in your pubspec.yaml file.

  dependencies:
    flutter:
      sdk: flutter
    gradient_toolbar: ^0.0.1

Example #

Please find the example:


class ExampleApp extends StatefulWidget {
  @override
  _ExampleAppState createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      backgroundColor: Colors.white,
      /// Define Column in body and then add GradientToolBar widget as a child
      body: Column(
        children: <Widget>[
        ///This is the Gradient tool bar widget
          GradientToolBar(
            title: "Gradient Toolbar", // Toolbar Title Text
            textColor: Colors.white, // Toolbar Title Text Color
            fontSize: 22.0, // Toolbar Title Text Font Size
            fontStyle: FontStyle.normal, // Toolbar Title Text Font Style
            fontWeight: FontWeight.w600, // Toolbar Title Text Font Weight
            needLeadingButton: true, // Toolbar Back Button Visibility Flag
            needTrailingButton: true, // Toolbar Trailing Button Visibility Flag
            trailingIcon: Icons.search, // Toolbar Trailing Button Icon
            leadingIconColor: Colors.white, // Toolbar Leading Button Color
            trailingIconColor: Colors.white, // Toolbar Trailing Button Color
            onLeadingIconClick: _handleLeadingButtonClick, // Toolbar Leading Button Callback
            onTrailingIconClick: _handleTrailingButtonClick, // Toolbar Trailing Button Callback
            toolbarStartColor: Color(0xFF414345), // Toolbar Gradient Start Color
            toolbarEndColor: Color(0xFF232526), // Toolbar Gradient End Color
            gradientTileMode: TileMode.clamp, // Toolbar Gradient Tile Mode
          ),
          // Use Expanded widget to use rest of the screen.
          Expanded(
              child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[Text("Gradient Toolbar")],
          ))
        ],
      ),
    );
  }

  void _handleLeadingButtonClick(bool clickStatus) {
    //TODO: Do something
  }

  void _handleTrailingButtonClick(bool clickStatus) {
    //TODO: Do something
  }
}


Created & Maintained By

Rohit Gupta

Getting Started #

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

[0.0.2]

  • Fixed Nullable attributes bugs

[0.0.1]

  • First Release

example/README.md

example #

Use the Gradient Tool Bar according to this example.


class ExampleApp extends StatefulWidget {
  @override
  _ExampleAppState createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      backgroundColor: Colors.white,
      /// Define Column in body and then add GradientToolBar widget as a child
      body: Column(
        children: <Widget>[
        ///This is the Gradient tool bar widget
          GradientToolBar(
            title: "Gradient Toolbar", // Toolbar Title Text
            textColor: Colors.white, // Toolbar Title Text Color
            fontSize: 22.0, // Toolbar Title Text Font Size
            fontStyle: FontStyle.normal, // Toolbar Title Text Font Style
            fontWeight: FontWeight.w600, // Toolbar Title Text Font Weight
            needLeadingButton: true, // Toolbar Back Button Visibility Flag
            needTrailingButton: true, // Toolbar Trailing Button Visibility Flag
            trailingIcon: Icons.search, // Toolbar Trailing Button Icon
            leadingIconColor: Colors.white, // Toolbar Leading Button Color
            trailingIconColor: Colors.white, // Toolbar Trailing Button Color
            onLeadingIconClick: _handleLeadingButtonClick, // Toolbar Leading Button Callback
            onTrailingIconClick: _handleTrailingButtonClick, // Toolbar Trailing Button Callback
            toolbarStartColor: Color(0xFF414345), // Toolbar Gradient Start Color
            toolbarEndColor: Color(0xFF232526), // Toolbar Gradient End Color
            gradientTileMode: TileMode.clamp, // Toolbar Gradient Tile Mode
          ),
          // Use Expanded widget to use rest of the screen.
          Expanded(
              child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[Text("Gradient Toolbar")],
          ))
        ],
      ),
    );
  }

  void _handleLeadingButtonClick(bool clickStatus) {
    //TODO: Do something
  }

  void _handleTrailingButtonClick(bool clickStatus) {
    //TODO: Do something
  }
}


Use this package as a library

1. Depend on it

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


dependencies:
  gradient_toolbar: ^0.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:gradient_toolbar/gradient_toolbar.dart';
  
Version Uploaded Documentation Archive
0.1.0 Dec 12, 2018 Go to the documentation of gradient_toolbar 0.1.0 Download gradient_toolbar 0.1.0 archive
0.0.4 Dec 12, 2018 Go to the documentation of gradient_toolbar 0.0.4 Download gradient_toolbar 0.0.4 archive
0.0.3 Dec 12, 2018 Go to the documentation of gradient_toolbar 0.0.3 Download gradient_toolbar 0.0.3 archive
0.0.2 Dec 12, 2018 Go to the documentation of gradient_toolbar 0.0.2 Download gradient_toolbar 0.0.2 archive
0.0.1 Dec 12, 2018 Go to the documentation of gradient_toolbar 0.0.1 Download gradient_toolbar 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
47
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
71
Learn more about scoring.

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

  • Dart: 2.3.0
  • pana: 0.12.15
  • Flutter: 1.5.8

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-0.25 points)

38 out of 39 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.

Fix lib/gradient_toolbar.dart. (-0.50 points)

Analysis of lib/gradient_toolbar.dart reported 1 hint:

line 7 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: GradientToolBar.title, GradientToolBar.fontSize, GradientToolBar.gradientTileMode, GradientToolBar.fontStyle, GradientToolBar.fontWeight, GradientToolBar.trailingIcon, GradientToolBar.needLeadingButton, GradientToolBar.needTrailingButton, GradientToolBar.textColor, GradientToolBar.toolbarStartColor, GradientToolBar.toolbarEndColor, GradientToolBar.leadingIconColor, GradientToolBar.trailingIconColor

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test