flutter_buttons 0.0.4

flutter_buttons #

Ready-made various button styles for Flutter.

Various buttons #

Finished App

Usage #

Use raised button:

    KRaisedButton(
        radius: 30.0,
        color: Colors.teal,
        text: 'Raised Button',
        textColor: Colors.white,
        textFontWeight: FontWeight.bold,
        onPressed: () => {},
    ),

Use outline button:

    KOutlineButton(
        radius: 30.0,
        borderColor: Colors.teal,
        text: 'Outline Button',
        textColor: Colors.teal,
        textFontWeight: FontWeight.bold,
        onPressed: () => {},
    ),

Use flat button:

    KFlatButton(
        radius: 30.0,
        color: Colors.teal,
        text: 'Flat Button',
        textColor: Colors.white,
        textFontWeight: FontWeight.bold,
        onPressed: () => {},
    ),

Use custom button with gradient:

    GradientButton(
        buttonColorGradient: [ Colors.teal.shade100, Colors.teal.shade900 ],
        buttonBorderColor: Colors.teal,
        buttonText: 'Custom button',
        buttonTextColor: Colors.white,
        highlightColor: Colors.white30,
        splashColor: Colors.white,
        onPressed: () {},
    )

Use selected button:

    SelectedButton(
        radius: 30.0,
        unselectedButtonColor: Colors.white,
        selectedButtonColor: Colors.teal,
        text: 'Selected Button',
        unselectedTextColor: Colors.teal,
        selectedTextColor: Colors.white,
        textFontWeight: FontWeight.bold,
        iconData: Icons.email,
        unselectedIconColor: Colors.teal,
        selectedIconColor: Colors.white,
        onPressed: () {},
    ),

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

[0.0.1] - TODO: Add release date.

  • TODO: Describe initial release.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:flutter_buttons/flutter_buttons.dart';

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

class FlutterButtonsDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Buttons Demo',
      theme: ThemeData(primaryColor: Colors.red),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Buttons Demo'),
          centerTitle: true,
        ),
        body: Container(
          alignment: Alignment.center,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: <Widget>[
              KRaisedButton(
                radius: 30.0,
                color: Colors.teal,
                text: 'Raised Button',
                textColor: Colors.white,
                textFontWeight: FontWeight.bold,
                onPressed: () => {},
              ),
              KOutlineButton(
                radius: 30.0,
                borderColor: Colors.teal,
                text: 'Outline Button',
                textColor: Colors.teal,
                textFontWeight: FontWeight.bold,
                onPressed: () => {},
              ),
              KFlatButton(
                radius: 30.0,
                color: Colors.teal,
                text: 'Flat Button',
                textColor: Colors.white,
                textFontWeight: FontWeight.bold,
                onPressed: () => {},
              ),
              GradientButton(
                buttonColorGradient: [
                  Colors.teal.shade100,
                  Colors.teal.shade900
                ],
                buttonBorderColor: Colors.teal,
                buttonText: 'Gradient button',
                buttonTextColor: Colors.white,
                highlightColor: Colors.white30,
                splashColor: Colors.white,
                onPressed: () {},
              ),
              SelectedButton(
                radius: 30.0,
                unselectedButtonColor: Colors.white,
                selectedButtonColor: Colors.teal,
                text: 'Selected Button',
                unselectedTextColor: Colors.teal,
                selectedTextColor: Colors.white,
                textFontWeight: FontWeight.bold,
                iconData: Icons.email,
                unselectedIconColor: Colors.teal,
                selectedIconColor: Colors.white,
                onPressed: () {},
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_buttons: ^0.0.4

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://dart.dev/dart-2#migration.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <2.0.0