drawer_component 0.2.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 72

drawer_component #

A Flutter implementation of easy useable component used in drawer to design beautiful Applications.

Drawer Component

Features #

This library will allow you to design the drawer components without any additional hastle. The major type of componnets that could be designed include buttons, icons buttons, custom widgets, dividers and boolean check buttons. The basic idea is to use this libarary to reduce the coding effort while designing the drawer componnets of your android and IOS applications. New version 0.2.0 include an beautiful logo for Drawer as will the newer version also had fixed issue in ComponentDrawer and tranformed it to DrawerTile which is more flexible . Furthermore Logo contains many fetures that could customize the drawer including the gradient and custom text widgets designed to make programmers job easier .

How to use this Component #

Drawer #

It contain number of checks to make component more dynamic for example if you want to add gradient you could add true to gradient check. If you want to add many text widgets or your own widgets instead of the usual defult text widget provided by the DrawerComponent tou could check true to customTextwidgetsCheck . More there is a check for selection for asset image instead of network image checkNetworkAssets ;

It have 3 required parameters circleAvatarImageurl , checkNetworkAssets (use to select between asset image and network image ) , avatarradius ;

Drawer Component

 DrawerLogo(
                    avatarBackgroundColor: Colors.white,
                    circleAvatarImageurl:
                        "https://i.ytimg.com/vi/sK-8k1Dq1xM/hqdefault.jpg",
                    checkNetworkAssets: true,
                    color: Colors.blue,
                    text: "qwerty",
                    avatarradius: 50,
                  ),

Drawer Tile #

There is a divider check use to add or remove the divider set divideravailabilityCheck = true or false . I have 4 requied atributes name , tileSize , child , textOverflow . It was avalible in previous versions as well with the name DrawerComponent know in new version it is improved to drawerTile

Drawer Component

drawer: new Drawer(
    child: ListView(
    children: <Widget>[
            DrawerTile(
                    name: "call",
                    textOverflow: TextOverflow.ellipsis,
                    child: TestWidget(),
                    leading: Icon(Icons.call),
                    tileSize: 10,
                    dividerheight: 5,
                    dividerThickness: 1,
                    dividercolor: Colors.black,
                  ),
                ],
        ),
);

geting started #

  1. Add this to your package's pubspec.yaml file:
dependencies:
  drawer_component: ^0.2.1

  1. 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.

  1. Import it Now in your Dart code, you can use:
import 'package:drawer_component/drawer_component.dart';

[0.0.1] - Initial: 3/15/2020. #

[0.1.0] - Bugs Fixed : 3/16/2020. #

[0.2.0] - NewComponent : 3/16/2020. #

[0.2.1] - Improved Docs : 3/17/2022. #

  • TODO: Describe initial release.

example/lib/main.dart

import 'package:drawer_component/drawer_component.dart';

import 'package:flutter/material.dart';

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

class TestDrawer extends StatefulWidget {
  TestDrawer({Key key}) : super(key: key);

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

class _TestDrawerState extends State<TestDrawer> {
  final bool checkbox = true;
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: new Scaffold(
            appBar: AppBar(
              title: Text("Demo Component"),
            ),
            drawer: new Drawer(
              child: ListView(
                children: <Widget>[
                  DrawerLogo(
                    avatarBackgroundColor: Colors.white,
                    circleAvatarImageurl:
                        "https://i.ytimg.com/vi/sK-8k1Dq1xM/hqdefault.jpg",
                    checkNetworkAssets: true,
                    color: Colors.blue,
                    text: "qwerty",
                    gradientCheck: true,
                    begin: Alignment.bottomRight,
                    end: Alignment.topLeft,
                    gradientColors: [Colors.red, Colors.blue],
                    avatarradius: 50,
                  ),
                  DrawerTile(
                    name: "call",
                    textOverflow: TextOverflow.ellipsis,
                    child: TestWidget(),
                    leading: Icon(Icons.call),
                    tileSize: 10,
                    dividerheight: 5,
                    dividerThickness: 1,
                    dividercolor: Colors.black,
                  ),
                  DrawerTile(
                    name: "contect",
                    textOverflow: TextOverflow.ellipsis,
                    child: TestWidget(),
                    leading: Icon(Icons.contacts),
                    trailing: Icon(Icons.content_copy),
                    tileSize: 10,
                    tralingSelection: "Icon",
                    dividerheight: 5,
                    dividerThickness: 1,
                    dividercolor: Colors.black,
                  ),
                ],
              ),
            )));
  }
}

class TestWidget extends StatefulWidget {
  TestWidget({Key key}) : super(key: key);

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

class _TestWidgetState extends State<TestWidget> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Text("hello world"),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  drawer_component: ^0.2.1

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:drawer_component/drawer_component.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
44
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]
72
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [drawer_component] that is in a package requiring null.

Health issues and suggestions

Document public APIs. (-0.11 points)

63 out of 65 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/drawer_logo.dart. (-0.50 points)

Analysis of lib/drawer_logo.dart reported 1 hint:

line 3 col 7: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: DrawerLogo.color, DrawerLogo.gradientCheck, DrawerLogo.stops, DrawerLogo.gradientColors, DrawerLogo.end, DrawerLogo.begin, DrawerLogo.circleAvatarImageurl, DrawerLogo.checkNetworkAssets, DrawerLogo.avatarradius, DrawerLogo.avatarBackgroundColor, DrawerLogo.customTextwidgets, DrawerLogo.customTextwidgetsCheck, DrawerLogo.text, DrawerLogo.fontStyle, DrawerLogo.fontSize, DrawerLogo.textColor, DrawerLogo.fontfamily

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

Analysis of lib/drawer_tile.dart reported 1 hint:

line 3 col 7: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: DrawerTile.name, DrawerTile.child, DrawerTile.checkBoxValue

Dependencies

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