feat: improve terminal page ui

This commit is contained in:
Udhay-Adithya
2025-09-11 01:22:28 +05:30
parent d5ba4ab463
commit e43550345d
6 changed files with 613 additions and 31 deletions

View File

@@ -0,0 +1,51 @@
import 'package:flutter/material.dart';
class ExpandableSection extends StatefulWidget {
const ExpandableSection(
{super.key, required this.title, required this.child});
final String title;
final Widget child;
@override
State<ExpandableSection> createState() => _ExpandableSectionState();
}
class _ExpandableSectionState extends State<ExpandableSection> {
bool _open = false;
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InkWell(
enableFeedback: false,
borderRadius: BorderRadius.circular(3),
onTap: () => setState(() => _open = !_open),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Row(
children: [
Expanded(
child: Text(
widget.title,
style: Theme.of(context).textTheme.titleSmall,
),
),
Icon(
_open ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
),
],
),
),
),
if (_open)
Padding(
padding: const EdgeInsets.fromLTRB(12, 0, 12, 12),
child: widget.child,
),
],
);
}
}