A collection of ListItems primarily to be used within a ListView
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
Feedback
Please share your valuable feedback either through email or follow me on twitter.
Libraries
Dart
- dart:ui
- Built-in types and core primitives for a Flutter application. [...]
- dart:async
- Support for asynchronous programming, with classes such as Future and Stream. [...]
- dart:collection
- Classes and utilities that supplement the collection support in dart:core. [...]
- dart:convert
- Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
- dart:core
- Built-in types, collections, and other core functionality for every Dart program. [...]
- dart:developer
- Interact with developer tools such as the debugger and inspector. [...]
- dart:math
- Mathematical constants and functions, plus a random number generator. [...]
- dart:typed_data
- Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]
- dart:io
- File, socket, HTTP, and other I/O support for non-web applications. [...]
- dart:isolate
- Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]