empty_widget 0.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 88

empty_Widget pub package #

ScreenshotsScreenshots

1. Add library to your pubspec.yaml #

dependencies:
...
  empty_widget: ^0.0.1-dev.1 # such as version, you need use the latest version of pub.
...

2. Import library in dart file #

import 'package:empty_widget.dart';

3. Use of EmptyListWidget #

EmptyListWidget(
   title: 'No Notification',
   subTitle: 'No  notification available yet',
   image: 'assets/images/userIcon.png',
   titleTextStyle: Theme.of(context).typography.dense.display1.copyWith(color: Color(0xff9da9c7)),
   subtitleTextStyle: Theme.of(context).typography.dense.body2.copyWith(color: Color(0xffabb8d6))
);

Example #

import 'package:empty_widget/empty_widget.dart';
import 'package:flutter/material.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: 'Empty widget demo'),
    );
  }
}

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

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

class _MyHomePageState extends State<MyHomePage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Container(
            height: 500,
            width:350,
          child:  EmptyListWidget(
            image : null,
            packageImage: PackageImage.Image_1,
            title: 'No Notification',
            subTitle: 'No  notification available yet',
            titleTextStyle: Theme.of(context).typography.dense.display1.copyWith(color: Color(0xff9da9c7)),
            subtitleTextStyle: Theme.of(context).typography.dense.body2.copyWith(color: Color(0xffabb8d6))
         ),
        )
      ),
    );
  }
}

Parameters and Value #

Images

Image path can be assets image or null.

title

title can be string or null

subTitle

subTitle can be string or null

packageImage

Available image assets in package Type : PackageImage

Values
  • PackageImage.Image_1
  • PackageImage.Image_2
  • PackageImage.Image_3
  • PackageImage.Image_4

titleTextStyle

Text style of Title

subtitleTextStyle

Text style of Subtitle

Download App #

Credits #

Developed by sonu.sharma045@gmail.com

Contributing #

Feel free to help

Changelog #

0.0.1-dev.1 #

  • empty widget added

0.0.1-dev.2 #

  • changelog updated

0.0.1-dev.3 #

  • add image assets

0.0.1-dev.4 #

  • add demo example

0.0.1 #

  • Add default images in package
  • Add title text style
  • add Subtitle text style

example/lib/main.dart

import 'package:empty_widget/empty_widget.dart';
import 'package:flutter/material.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: 'Empty widget demo'),
    );
  }
}

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

 final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Container(
            height: 500,
            width:350,
          child:  EmptyListWidget(
            image : null,
            packageImage: PackageImage.Image_1,
            title: 'Title here',
            subTitle: 'Some text  here',
            titleTextStyle: Theme.of(context).typography.dense.display1.copyWith(color: Color(0xff9da9c7)),
            subtitleTextStyle: Theme.of(context).typography.dense.body2.copyWith(color: Color(0xffabb8d6))
         ),
        )
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  empty_widget: ^0.0.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:empty_widget/empty_widget.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
80
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]
88
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • empty_widget that is a package requiring null.

Health suggestions

Fix lib/empty_widget.dart. (-1 points)

Analysis of lib/empty_widget.dart reported 2 hints:

line 138 col 83: 'display1' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is headline4. This feature was deprecated after v1.13.8..

line 139 col 89: 'body2' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is bodyText1. This feature was deprecated after v1.13.8..

Fix lib/src/helper.dart. (-0.50 points)

Analysis of lib/src/helper.dart reported 1 hint:

line 33 col 79: 'body1' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is bodyText2. This feature was deprecated after v1.13.8..

Format lib/src/images.dart.

Run flutter format to format lib/src/images.dart.

Format lib/src/utility.dart.

Run flutter format to format lib/src/utility.dart.

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.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test