这是indexloc提供的服务,不要输入任何密码
Skip to content

jesusrp98/expand_widget

 
 

Repository files navigation

Expand Widget

Package License Patreon Stars

This Dart package offers developers a streamlined library of Flutter widgets, useful for expanding widgets and text views, when users interact with them.

When the users clicks the 'expand' arrow, the hidden widgets or content unfold with a cool animation. You can swipe down, or click directly on them, setting expandOnGesture to true.

There are three main 'expand' widgets:

  • Expand Child: Useful to show more widgets related to the content already visible by the user.
  • Expand Text: Useful when texts can be quite big for a certain screen. It adds the ability to show the full content when the user wants to.
  • Show Child: In contrast to the 'Expand Child' widget, it doesn't have the ability to hide again the content.

Example

Here is an example of a simple use of this package, featuring the ExpandChild, ExpandText & ShowChild widgets.

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

  • ExpandChild widget
ExpandChild(
  child: Column(
    children: <Widget>[
      OutlineButton(
        child: Text('Button1'),
        onPressed: () => print('Pressed button1'),
      ),
      OutlineButton(
        child: Text('Button2'),
        onPressed: () => print('Pressed button2'),
      ),
      OutlineButton(
        child: Text('Button3'),
        onPressed: () => print('Pressed button3'),
      ),
    ],
  ),
),
  • ExpandText widget
ExpandText(
  'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
  textAlign: TextAlign.justify,
),
  • ShowChild widget
ShowChild(
indicator: Padding(
  padding: EdgeInsets.all(8),
  child: Text(
    "SHOW MORE",
    style: TextStyle(
      color: Theme.of(context).textTheme.caption.color,
    ),
  ),
),
child: Column(
  children: <Widget>[
    OutlineButton(
      child: Text('Button1'),
      onPressed: () => print('Pressed button1'),
    ),
    OutlineButton(
      child: Text('Button2'),
      onPressed: () => print('Pressed button2'),
    ),
    OutlineButton(
      child: Text('Button3'),
      onPressed: () => print('Pressed button3'),
    ),
  ],
),

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.

About

Ability to easily expand and retract a widget collection or text

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 3

  •  
  •  
  •