collaction_common 0.0.1

SDKflutter
Platformandroidioswindowslinuxmacosweb

This package provides a set of reusable widgets that can be used across all platforms. These widgets are designed to simplify and speed up the development process for creating collaction applications in Flutter.

collaction_common

This package provides a set of reusable widgets that can be used across all platforms. These widgets are designed to simplify and speed up the development process for creating collaction applications in Flutter.

Installation

To use this package, add collaction_common as a dependency in your pubspec.yaml file.

Usage

Import the package in your Dart code using:

import 'package:collaction_common/widgets/<widget>.dart';

Then, you can use any of the widgets provided in the package, such as:

CountryIcon(
    countryCode: 'UG',
    radius: 10,
),

Widgets

The following widgets are included in this package:

CountryIcon

Display the flag of a country in an avatar shape.

CountryFlagAvatar(
  countryCode: 'US',
  radius: 32.0,
)

Parameters

ParameterDescription
keyWidget access key.
countryCode*Valid two-letter country code as defined in ISO 3166-1.
radiusCircular avatar radius.

AccentChip

Display a text label in a chip with an optional avatar leading and delete button.

AccentChip(
  text: 'Hello World',
  leading: Icon(Icons.ac_unit),
  onDeleted: () => print('Chip deleted'),
  labelColor: Colors.white,
  color: Colors.blue,
  noMaterialTapTargetSize: true,
)

Parameters

ParameterDescription
keyWidget access key.
text*Label text.
onDeletedDeletion callback.
labelColorLabel text color.
colorBackground color.
noMaterialTapTargetSizeSets the the [MaterialTapTargetSize] used for the chip will be set to [MaterialTapTargetSize.shrinkWrap] when true, otherwise [MaterialTapTargetSize.padded] will be used.

PillButton

[ElevatedButton] wrapper to display a pill-shaped button with text and an optional leading widget.

// Elevated button
PillButton(
  text: 'Click me',
  leading: Icon(Icons.ac_unit),
  onTap: () => print('Button tapped'),
  isEnabled: true,
  isLoading: false,
)

// Elevated Icon button
PillButton.icon(
  text: 'Click me',
  leading: Icon(Icons.ac_unit),
  onTap: () => print('Button tapped'),
  isEnabled: true,
  isLoading: false,
)

Parameters

ParameterDescription
keyWidget access key.
text*Button label.
leadingWidget to prepend to the button label. Most preferably an icon.
Only required when using the PillButton.icon factory.
onTapButton click callback.
isEnabledWhether the button is allowing user interaction or not.
isLoadingWhether the button is loading.

Contributing

All contributions are welcome, whether it is filing a bug report, filing a feature request, opening a pull request, or any other contribution.

We have a couple of documents which will guide you towards a good first contribution, our contributing documentation walks you through all of our conventions that we require you to uphold when contributing.

Additionally, if you want to do development, we have written a document that will help you setup your local environment.