at_common_flutter 2.0.14 copy "at_common_flutter: ^2.0.14" to clipboard
at_common_flutter: ^2.0.14 copied to clipboard

A Flutter package to provide common widgets used by other atPlatform Flutter packages.

example/example.md

The Atsign FoundationThe Atsign Foundation

at_common_flutter example #

In this example app we demo at_common_flutter - A Flutter package to provide common widgets used by other atPlatform Flutter packages.

Give it a try #

This package includes a working sample application in the example directory that demonstrates the key features of the package. To create a personalized copy, use at_app create as shown below or check it out on GitHub.

$ flutter pub global activate at_app 
$ at_app create --sample=<package ID> <app name> 
$ cd <app name>
$ flutter run

Notes:

  1. You only need to run flutter pub global activate once
  2. Use at_app.bat for Windows

How it works #

The package includes the following UI components:

  • CustomAppBar
  • CustomInputField
  • CustomButton

and a size configuration service:

  • SizeConfig

The sample usage of these widgets are as follows:

CustomAppBar

    return Scaffold(
      appBar: CustomAppBar(
        showBackButton: false,
        showTitle: true,
        titleText: widget.title,
        onTrailingIconPressed: () {
          print('Trailing icon of appbar pressed');
        },
        showTrailingIcon: true,
        trailingIcon: Center(
          child: Icon(
            Icons.add,
            color: Theme.of(context).brightness == Brightness.light
                ? Colors.black
                : Colors.white,
          ),
        ),
      ),
    );

CustomButton

CustomButton(
    height: 50.0,
    width: 200.0,
    buttonText: 'Add',
    onPressed: () {
    print('Custom button pressed');
    },
    buttonColor: Theme.of(context).brightness == Brightness.light
        ? Colors.black
        : Colors.white,
    fontColor: Theme.of(context).brightness == Brightness.light
        ? Colors.white
        : Colors.black,
),

CustomInputField

CustomInputField(
    icon: Icons.emoji_emotions_outlined,
    width: 200.0,
    initialValue: "initial value",
    value: (String val) {
    print('Current value of input field: $val');
    },
),

SizeConfig service

This service is used to adjust height of widget based upon the screen size. This service needs to be initialised before usage.

import 'package:at_common_flutter/at_common_flutter.dart' as CommonWidgets;

CommonWidgets.SizeConfig().init(context);

Like everything else we do, this package and even the sample application are open source software which means we love it when you gift us with your feedback, contributions and even any bugs that you help us to discover. See CONTRIBUTING.md for detailed guidance on how to setup tools, tests and make a pull request.

9
likes
160
points
2.25k
downloads

Publisher

verified publisheratsign.org

Weekly Downloads

A Flutter package to provide common widgets used by other atPlatform Flutter packages.

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

Documentation
API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on at_common_flutter