flutter_expandable 0.0.1+1 copy "flutter_expandable: ^0.0.1+1" to clipboard
flutter_expandable: ^0.0.1+1 copied to clipboard

outdated

A new Flutter package project.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_expandable/expandable_widget.dart';
import 'package:flutter_expandable/expander_widget.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
  AnimationController controller;
  @override
  void initState() {
    controller = AnimationController(
      vsync: this,
      duration: const Duration(
        milliseconds: 300,
      ),
    );
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Expander example'),
        ),
        body: Column(
          children: [
            ExpanderWidget(
              rotateArrow: true,
              rotatingArrowSize: 40,
              arrowRotationDuration: const Duration(milliseconds: 300),
              triggerWidgets: [
                Container(
                  width: 300,
                  child: Text(
                    'This is the widget that will trigger the expansion of the other widgets',
                    maxLines: 2,
                  ),
                )
              ],
              controller: controller,
            ),
            SizedBox(
              height: 30,
            ),
            ExpandableWidget(
              height: 20,
              controller: controller,
              child: Text('This should only expand vertically'),
            ),
            ExpandableWidget(
              height: 30,
              animateWidth: true,
              animateHeight: true,
              width: 200,
              controller: controller,
              child: Text('This should expand vertical and horizontally'),
            ),
          ],
        ),
      ),
    );
  }
}
6
likes
0
points
25
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter package project.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_expandable