folder 1.0.0 folder: ^1.0.0 copied to clipboard
A Flutter package to easy expand and fold widget .
/// create by 张风捷特烈 on 2020/7/16
/// contact me by email 1981462002@qq.com
/// 说明:
import 'package:flutter/material.dart';
import 'package:folder/folder.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(),
body: Folder(
// initiallyExpanded: true,
duration: 300,
// foldCurve: Curves.bounceInOut,
child: Container(
height: 60,
color: Colors.greenAccent,
),
children: _buildContent(),
onExpansionChanged: (v) {
print(v);
},
),
));
}
List<Widget> _buildContent() => <Widget>[
Container(
height: 40,
color: Colors.red,
),
Container(
height: 40,
color: Colors.blue,
),
Container(
height: 40,
color: Colors.yellow,
)
];
}