slick_list_items 1.0.3

A collection of ListItems primarily to be used within a ListView #

pub package

pub package

About #

Collection of ListItem widgets.

Description #

This package contains a collection of ListItem widgets that are primarily designed to be used within ListViews. Some ListItems are optimized to display only textual information, some to display graphical information, while as some are optimized to display both textual as well as graphical information. Though, these ListItems are typically used within ListViews, however, there use in any case is not limited only to ListViews.

Using #

Simply import package: slick_list_items/slick_list_items.dart and choose one or all from the following:-

  • FlatListItem: A FlatListItem is a StatelessWidget which displays textual information. A FlatListItems is divided into three columns, wherein, first one on the left displays an icon, the second and the third columns both have 2 rows. The first row displays the label of the data it represents and the second row displays the data itself. Columns may be separted using a hanging divider in a FlatListItem. The rightDataText can be customized to choose between 10 different font families.
  • BrickListItem: A BrickListItem is a StatelessWidget that is created on the analogy of a wall and bricks. The container that holds all the widgets is called a 'wall' and the individual widgets within the wall are called 'bricks'. When bricks are added to the wall they automatically resize and position themselves to fit the wall. It also allows for nesting, i.e. you can nest BrickListItems within one another.
  • InfoListItem: An InfoListItem is a StatelessWidget which displays textual information. An InfoListItem displays an icon on the left and title, subTitle, and footer texts on the right. The text on the right adapts to the size of the icon on the left. It allows for nesting and automatically resizes itself if added to a widget with padding. It supports 10 different fonts for title, subtitle, and footer texts.

Using FlatListItem #

import 'package:flutter/material.dart';
import 'package:slick_list_items/slick_list_items.dart';

class TransactionsList extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemBuilder: _buildList,
    );
  }

  Widget _buildList(BuildContext context, int index) {
    return FlatListItem.transparent(
      context: context,
      scalePreset: ScalePreset.minimal,
      icon: Icon(Icons.monetization_on, color: Colors.black,),
      leftLabelText: 'Amount',
      leftDataText: '0123456789',
      rightLabelText: 'Description',
      rightDataText: 'Bought grocery at...',
    );
  }
}

Using BrickListItem #

import 'package:flutter/material.dart';
import 'package:slick_list_items/slick_list_items.dart';

class TestPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Widget Test'),
      ),
      body: ListView.builder(
        itemBuilder: _buildList,
      ),
    );
  }

  Widget _buildList(BuildContext context, int index) {
    return BrickListItem.ocean(
      widgets: <Widget>[
        Icon(
          Icons.android,
          color: Colors.black,
        ),
        Text(
          'BrickListItem',
          style: TextStyle(color: Colors.brown),
        ),
      ],
    );
  }
}

Using InfoListItem #

import 'package:flutter/material.dart';
import 'package:slick_list_items/slick_list_items.dart';

class TestPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Widget Test'),
      ),
      body: ListView.builder(
        itemBuilder: _buildList,
      ),
    );
  }

  Widget _buildList(BuildContext context, int index) {
    return InfoListItem.whitePro(
      icon: Icon(Icons.android, size: 48.0,),
      titleText: 'When things go...',
      subTitleText: 'wrong as they sometimes will, when the road you are trudging',
      footerText: 'May 15th, 2019',
    );
  }
}

Screenshots #

FlatListItem

FlatListItem

FlatListItem

FlatListItem

InfoListItem

InfoListItem

InfoListItem

InfoListItem

InfoListItem

InfoListItem

Feedback #

Please share your valuable feedback either through email or follow me on twitter.

ChangeLog #

1.0.3 #

21-05-2019 #

  • Breaking Change for FlatListItem. Now, the argument 'context' does not need to be provided while constructing a FlatListItem. The onTap() and indexWithinList arguments are deprecated.
  • Fixed TextOverflow for FlatListItem.

1.0.2 #

14-05-2019 #

  • Added InfoListItem.
  • Few README.md changes.
  • Example updated. Includes example for InfoListItem.
  • Renamed few optional arguments in FlatListItem to match the convention used.
  • rightDataText in FlatListItem can now be styled with any custom fontFamily.

1.0.1 #

04-05-2019 #

  • Added BrickListItem.
  • Few Documentation changes.
  • Few README.md changes.
  • Example updated. Includes example for BrickListItem.

1.0.0 #

30-04-2019 #

  • Initial release.
  • Added FlatListItem.

example/main.dart

import 'package:flutter/material.dart';
import 'package:slick_list_items/slick_list_items.dart';

main() => MyApp();

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('FlatListItem'),
        ),
        body: ListView.builder(
          itemBuilder: buildFlatListItems,
        ),
      ),
    );
  }

  Widget buildFlatListItems(BuildContext context, int index) {
    return FlatListItem.purple(
      scalePreset: ScalePreset.normal,
      leftLabelText: 'Amount',
      leftDataText: '20.0',
      rightLabelText: 'Description',
      rightDataText: 'Shopping for...',
    );
  }

  Widget buildBrickListItems(BuildContext context, int index) {
    return BrickListItem.ocean(
      widgets: <Widget>[
        Icon(
          Icons.android,
          color: Colors.black,
        ),
        Text(
          'BrickListItem',
          style: TextStyle(color: Colors.brown),
        ),
      ],
    );
  }

  Widget buildInfoListItem(BuildContext context, int index) {
    return InfoListItem.whitePro(
      icon: Icon(Icons.android, size: 48.0,),
      titleText: 'When things go...',
      subTitleText: 'wrong as they sometimes will, when the road you are trudging',
      footerText: 'May 15th, 2019',
    );
  }
}

Use this package as a library

1. Depend on it

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


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

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

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
cupertino_icons ^0.1.2 0.1.2
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

Admin