gradient_app_bar 0.1.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 87

Gradient App Bar #

Love the material AppBar? Do you want to add more color to the appbar? Here's a gradientAppBar.

It works just like the normal AppBar. Also with actions, back buttons, titles. So it's just your normal AppBar, but with a twist!

Screenshots #

image image

Getting Started #

  1. Depend on it by adding this to your pubspec.yaml file: gradient_app_bar: ^0.0.1

  2. Import it: import 'package:gradient_app_bar/gradient_app_bar.dart'

  3. Replace your current AppBar (In the scaffold) to GradientAppBar. Add a backgroundColorStart and a backgroundColorEnd and you have a gradient appbar!

[0.1.3] - 15 Juli 2019 #

  • Remove obsolete import

[0.1.2] - 15 Juli 2019 #

  • Updated description

[0.1.1] - 15 Juli 2019 #

  • Update the testing app

[0.1.0] - 14 Juli 2019 #

  • [BREAKING] Changed way of adding the gradient with using the gradient directly instead of making a LinearGradient in app

[0.0.1] - 8 August 2018 #

  • Initial commit

example/lib/main.dart

import 'package:flutter/material.dart';

import './../../lib/gradient_app_bar.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 2,
      child: Scaffold(
        appBar: GradientAppBar(
          title: Text(widget.title),
          gradient: LinearGradient(colors: [Colors.red, Colors.purple]),
          bottom: TabBar(tabs: <Widget>[
            Tab(
              icon: Icon(Icons.home),
              text: 'Home',
            ),
            Tab(
              icon: Icon(Icons.store),
              text: 'Store',
            )
          ]),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                'You have pushed the button this many times:',
              ),
              Text(
                '$_counter',
                style: Theme.of(context).textTheme.display1,
              ),
            ],
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: _incrementCounter,
          tooltip: 'Increment',
          child: Icon(Icons.add),
          backgroundColor: Colors.red,
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  gradient_app_bar: ^0.1.3

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:gradient_app_bar/gradient_app_bar.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
95
Health:
Code health derived from static analysis. [more]
71
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
87
Learn more about scoring.

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

  • Dart: 2.8.1
  • pana: 0.13.8-dev
  • Flutter: 1.17.0

Health issues and suggestions

Fix lib/gradient_app_bar.dart. (-29.38 points)

Analysis of lib/gradient_app_bar.dart reported 6 warnings, 8 hints, including:

line 376 col 5: Missing case clause for 'linux'.

line 376 col 5: Missing case clause for 'macOS'.

line 376 col 5: Missing case clause for 'windows'.

line 467 col 7: Missing case clause for 'linux'.

line 467 col 7: Missing case clause for 'macOS'.

Maintenance suggestions

The description is too long. (-10 points)

Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 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