A collection of ListItems primarily to be used within a ListView
Description
This package contains a number of slick and adaptable list items that are primarily to be used within ListViews
Using
Simply import package: slick_list_items/slick_list_items.dart and choose one or all from the following:-
- FlatListItem: A FlatListItem is typically added to a ListView to display 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.
- BrickListItem: A BrickListItem 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 as '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.
Using FlatListItem
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:brick_list_items/brick_list_item.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),
),
],
);
}
}
Screenshots
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. [...]