uic 0.0.2 copy "uic: ^0.0.2" to clipboard
uic: ^0.0.2 copied to clipboard

outdated

UI Components

uic #

UIC (UI Components) #

A set of Flutter widgets that simplifies implementing most used UI cases.

Currently includes the following UI components:

  • ListUic - Wrapper of ListView, which implements related data loading and state management logic.
  • ProgressUic - Wrapper of ProgressIndicator with additional text.

ListUic #

Almost each app has screens that display a list of items. Simple task at first look, but often it requires much related staff to be implemented. Progress indicator while data for the list is loading, separate views for empty data, error loading data, etc. All those boilerplate can be simplified with ListUic widget.

ListUic Demo ListUic Demo ListUic Demo ListUic Demo

Usage #

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
  uic: ^0.0.1

ListUic #

Import the package

import 'package:uic/list_uic.dart';

Add ListUicController to your page's state:


class _MyHomePageState extends State

Add ListUic widget to your widget tree:


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: ListUic<int>(
        controller: _controller,
        itemBuilder: (item) {
          return ListTile(
            title: Text('Title ${item}'),
            subtitle: Text('Subtitle ${item}'),
          );
        },
      ),
    );
  }

Implement a function that will return a list of items:


  Future<List<int>> _getItems(int page) async {
    ...
  }

Read the docs for available customization options.

Also you can check demo app for details of using ListUic widget.