搜索插件、代码仓与 APP 分类

GitHub 代码仓zeeshanayaz/custom_accordion

custom_accordion

具有大量自定义选项的自定义折叠面板小部件。

custom_accordion 项目封面
星标
2
复刻
2
最近推送(UTC)
2023年10月16日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

Supported platforms
Pub package version. Open Source Love. Custom Accordion is released under the MIT license.

Custom Accordion

Create dynamic, interactive, and visually appealing accordions in your Flutter app with ease using the "Custom Accordion" package. This powerful library simplifies the process of adding collapsible sections to your UI, making it a breeze to manage and customize accordions to suit your design and functionality needs.

Table of contents

Demo Preview

Get Started

Add to your project
dependencies:
  custom_accordion: ^version

or simply run the command in your terminal at project root directory

flutter pub add custom_accordion
Import and use it!
import 'package:custom_accordion/custom_accordion.dart';

How to use

Basic Accordion

    CustomAccordion(
        title: 'Accordion',
        ),

Accordion with no child

    CustomAccordion(
        title: 'Accordion with no child',
        subTitle: 'Accordion Sub Title',
        headerBackgroundColor: Colors.blue,
        titleStyle: const TextStyle(
          fontSize: 18,
          fontWeight: FontWeight.bold,
          color: Colors.white,
        ),
        subTitleStyle: const TextStyle(
          fontSize: 16,
          fontWeight: FontWeight.normal,
          color: Colors.white,
        ),
        toggleIconOpen: Icons.keyboard_arrow_down_sharp,
        toggleIconClose: Icons.keyboard_arrow_up_sharp,
        headerIconColor: Colors.white,
        accordionElevation: 0,
        showContent: true,
        ),

Accordion with one child

    CustomAccordion(
        title: 'Accordion with one child',
        subTitle: 'Accordion Sub Title',
        headerBackgroundColor: Colors.blue,
        titleStyle: const TextStyle(
          fontSize: 18,
          fontWeight: FontWeight.bold,
          color: Colors.white,
        ),
          subTitleStyle: const TextStyle(
          fontSize: 16,
          fontWeight: FontWeight.normal,
          color: Colors.white,
        ),
        toggleIconOpen: Icons.keyboard_arrow_down_sharp,
        toggleIconClose: Icons.keyboard_arrow_up_sharp,
        headerIconColor: Colors.white,
        accordionElevation: 0,
        widgetItems: const Text(
          'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.',
          ),
        ),

Accordion with many child

    CustomAccordion(
        title: 'Accordion with many child',
        headerBackgroundColor: Colors.blue,
        titleStyle: const TextStyle(
          fontSize: 18,
          fontWeight: FontWeight.bold,
          color: Colors.white,
        ),
        toggleIconOpen: Icons.keyboard_arrow_down_sharp,
        toggleIconClose: Icons.keyboard_arrow_up_sharp,
        headerIconColor: Colors.white,
        accordionElevation: 0,
        widgetItems: Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              Text(
                'Lorem Ipsum',
                style: Theme.of(context).textTheme.titleMedium,
              ),
              ElevatedButton(
                onPressed: () {},
                child: const Text(
                  'ELEVATED BUTTON',
                ),
              )
            ],
          ),
        ),

Accordion with List Items and disabled toggle example

        CustomAccordion(
            title: 'Accordion with List Items',
            subTitle: 'Accordion toggle disabled',
            headerBackgroundColor: Colors.blue,
            titleStyle: const TextStyle(
              fontSize: 18,
              fontWeight: FontWeight.bold,
              color: Colors.white,
            ),
            subTitleStyle: const TextStyle(
              fontSize: 16,
              fontWeight: FontWeight.normal,
              color: Colors.white,
            ),
            toggleIconOpen: Icons.keyboard_arrow_down_sharp,
            toggleIconClose: Icons.keyboard_arrow_up_sharp,
            headerIconColor: Colors.white,
            accordionElevation: 0,
            disableToggle: true,
            widgetItems: Column(
                crossAxisAlignment: CrossAxisAlignment.stretch,
                children: List<Widget>.generate(5, (int index) {
                return Text('Item $index');
                }),
            ),
        ),

Please see example project for code.

Properties

The following properties can be set for the widget.

Property Description Type Required Default value
title Title of Accordion String Yes
subTitle Sub Title of Accordion String No
headerBackgroundColor Header background color Color No Theme.of(context).splashColor
titleStyle Header text style TextStyle No Theme.of(context).textTheme.titleLarge
subTitleStyle Sub Title text style TextStyle No Theme.of(context).textTheme.titleSmall
toggleIconOpen Toggle icon to expand/open widgets IconData No Icons.arrow_drop_down
toggleIconClose Toggle icon to collapse/close widgets IconData No Icons.arrow_drop_up
headerIconColor Icon Color Color No Theme.of(context).iconTheme.color
backgroundColor Background color of widget Color No Theme.of(context).cardColor
accordionElevation Elevation of accordion widget double No Theme.of(context).cardTheme.elevation
widgetItems Child Widget(s) of accordion Widget No Text()
widgetItemsPadding Padding arround children of accordion EdgeInsetsGeometry No EdgeInsets.all(10)
showContent Make default behaviour of accordion children visible or hidden bool No false
disableToggle Make default behaviour of accordion toggle bool No false

Contribution

🚀 We believe in the power of collaboration and welcome contributions from our amazing community to make Custom Accordion even more awesome!

Whether you're a developer, designer, or just an enthusiast, you can contribute in various ways:

  • 💡 Feature Ideas: Have a cool feature in mind? Share your ideas with us. We love fresh perspectives!
  • 🐛 Bug Reports: Spotted a bug? Let us know! Help us squash those pesky little critters.
  • 📖 Documentation: Improve our documentation. Clear and concise docs make a world of difference.
  • 🛠 Code Contributions: If you're a developer, dive into the codebase. Tackle open issues or implement new features.
  • 💬 Community Support: Share your knowledge! Help others by answering questions and engaging in discussions.
  • ✏️ Design: If you have design skills, contribute by enhancing our UI/UX.

Dig into CONTRIBUTING.MD, which covers submitting bugs, requesting new features, preparing your code for a pull request, etc.

Please don't forget to like, follow, and star our repo!.

Support the package (optional)

If you find this package useful, you can support it for free by giving it a thumbs up at the top of this page.

Bugs or Requests

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket. Pull request are also welcome.

License

This package is available under the MIT License.

Muhammad Zeeshan GitHub avatar
GitHub 作者

Muhammad Zeeshan ↗

Mobile Application Developer

Genetech SolutionsKarachi, Pakistan.官方网站 ↗
语言C++CMakeDartCHTMLSwiftShellObjective-CJavaKotlin

分类

此仓库发布的插件

使用的依赖

依赖清单 3 项

  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}
  • flutter_lints开发依赖^2.0.0

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗