row_item 1.2.0+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 57

Row Item #

Package Build Patreon License

This package allows developers to display compat information inside a row widget.

As a highly customizable widget, you can place as a title and description whatever you want. But the preferred way to use this package is using a Text widget as the 'title', and another Text or Icon widget as the 'description' portion of the view.

You can check the of these examples down below.

Example #

If you want to take a deeper look at the example, take a look at the example folder provided with the project.

RowItem #

This is the vanilla widget. You can place whatever widget you want inside both titleand descriptionparameters.

RowItem(
    title: Text('title'),
    description: Text('description'),
)

RowItem.text #

The text variant simplifies the action of display text information inside the widget. It also has styles for both title and description text labels.

RowItem.text(
  'title',
  'description',
)

RowItem.boolean #

You can show a boolean state (true, false or null) using this variant of the widget. Color and size of the icon placed inside the description place are both customizable.

Use the outline parameter to use the outlined version of each icon, instead of the default one.

RowItem.boolean(
  'Displays a checked icon',
  true,
)

RowItem.tap #

This last variant makes the description text clickable, using the onTap parameter. If this parameters is not null, the description text will be underlined.

RowItem.tap(
  'This item is clickable',
  'Tap me!',
  onTap: () => print("Hello world!"),
)

Getting Started #

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Built with #

Authors #

License #

This project is licensed under the GNU GPL v3 License - see the LICENSE file for details.

[1.2.0+1] - April 27th, 2020 #

  • Added outline parameter inside RowItem.boolean (false by default).

[1.1.0] - April 4th, 2020 #

  • Added new default text style.
  • Improvde code quality.
  • Added maxLines& textOverflow parameters.
  • Solved some issues.
  • Added more tests to the package.

[1.0.0+1] - March 31st, 2020 #

  • First release of this package!

example/lib/main.dart

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'row_item',
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  Widget get _spacer => SizedBox(height: 12);
  Widget get _cardSpacer => SizedBox(height: 4);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Row item')),
      body: ListView(
        padding: EdgeInsets.all(8),
        children: <Widget>[
          Column(children: <Widget>[
            Card(
              child: Padding(
                padding: EdgeInsets.all(8),
                child: Column(children: <Widget>[
                  RowItem.text('English', 'Hello'),
                  _spacer,
                  RowItem.text('Español', 'Hola'),
                  _spacer,
                  RowItem.text('English', 'Bye'),
                  _spacer,
                  RowItem.text('Español', 'Adiós'),
                ]),
              ),
            ),
            _cardSpacer,
            Card(
              child: Padding(
                padding: EdgeInsets.all(8),
                child: Column(children: <Widget>[
                  RowItem.text(
                    'English',
                    'Hello',
                    titleStyle: TextStyle(color: Colors.blue),
                    descriptionStyle: TextStyle(fontSize: 18),
                  ),
                  _spacer,
                  RowItem.text(
                    'Español',
                    'Hola',
                    titleStyle: TextStyle(color: Colors.red),
                    descriptionStyle: TextStyle(fontWeight: FontWeight.bold),
                  ),
                  _spacer,
                  RowItem.text(
                    'English',
                    'Bye',
                    titleStyle: TextStyle(color: Colors.blue),
                    descriptionStyle: TextStyle(fontStyle: FontStyle.italic),
                  ),
                  _spacer,
                  RowItem.text(
                    'Español',
                    'Adiós',
                    titleStyle: TextStyle(color: Colors.red),
                    descriptionStyle: TextStyle(letterSpacing: 3),
                  ),
                ]),
              ),
            ),
            _cardSpacer,
            Card(
              child: Padding(
                padding: EdgeInsets.all(8),
                child: Column(children: <Widget>[
                  RowItem.boolean('Firefox', true),
                  _spacer,
                  RowItem.boolean(
                    'Chrome',
                    false,
                    outline: true,
                  ),
                  _spacer,
                  RowItem.boolean(
                    'Firefox',
                    true,
                    iconColor: Theme.of(context).accentColor,
                    outline: true,
                  ),
                  _spacer,
                  RowItem.boolean(
                    'Chrome',
                    false,
                    iconColor: Theme.of(context).accentColor,
                  ),
                ]),
              ),
            ),
            _cardSpacer,
            Card(
              child: Padding(
                padding: EdgeInsets.all(8),
                child: Column(children: <Widget>[
                  RowItem.tap(
                    'Android',
                    'Click here',
                    onTap: () => print('Clicked!'),
                  ),
                  _spacer,
                  RowItem.tap(
                    'iOS',
                    'Click here',
                    onTap: () => print('Clicked!'),
                  ),
                  _spacer,
                  RowItem.tap(
                    'Windows Phone',
                    'Don\'t click',
                  ),
                  _spacer,
                  RowItem.tap(
                    'Symbian',
                    'Don\'t click',
                  ),
                ]),
              ),
            ),
          ]),
        ],
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  row_item: ^1.2.0+1

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

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

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • row_item that is a package requiring null.

Health suggestions

Fix lib/row_item.dart. (-0.50 points)

Analysis of lib/row_item.dart reported 1 hint:

line 221 col 42: 'subhead' is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. The modern term is subtitle1. This feature was deprecated after v1.13.8..

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test