A expandable widget, Developed using Flutter.
- Android Studio or Visual Studio Code
- Clone the repo
git clone https://github.com/Mobile-Apps-Academy/ExpandableWidgetFlutter.git- How to use the widget
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: Colors.amberAccent,
body: SafeArea(
child: Padding(
padding: EdgeInsets.all(4),
child: ExpandableWidget(
header: expandableHeader(),
child: expandableChild(),
),
),
),
),
);
}
Widget expandableHeader() {
return Container(
height: 60,
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.black// Adjust the radius as needed
),
child: Text('Mobile Apps Academy', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: Colors.white),)
);
}
Widget expandableChild() {
return Container(
height: 160,
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.black // Adjust the radius as needed
),
child: const Padding (
padding: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Mobile Apps Academy', style: TextStyle(fontSize: 28,
fontWeight: FontWeight.bold,
color: Colors.white),),
Divider(),
Text(
'Welcome to Mobile Apps Academy, your go-to channel for all things mobile app development!',
style: TextStyle(fontSize: 18, color: Colors.white))
],
),
)
);
}
}Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt for more information.
