configurable_expansion_tile_plus 1.0.0 copy "configurable_expansion_tile_plus: ^1.0.0" to clipboard
configurable_expansion_tile_plus: ^1.0.0 copied to clipboard

Allows to configure Expansion Tile

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:configurable_expansion_tile/configurable_expansion_tile.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  ///it needed to manually collapse, exapnd or toggle Expansion tile
  final GlobalKey<ConfiguarableExpansionTileState> _globalKey = GlobalKey();

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Column(
          children: [
            ConfigurableExpansionTile(
              key: _globalKey,
              title: const Text("Expansion Tile Title"),
              children: [
                Container(
                  height: 50,
                  color: Colors.green,
                )
              ],
              onTap: () {

              },
            ),
          ],
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            ///toggle expansion tile
            _globalKey.currentState?.toggle();
          },
          child: const Icon(
            Icons.add
          ),
        ),
      ),
    );
  }
}