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.

Libraries

slick_list_items