feat: Update layout structure to use Stack for project list overlay and adjust spacing in dashboard
This commit is contained in:
parent
56efbe8869
commit
b38d987eac
@ -50,10 +50,9 @@ class _DashboardScreenState extends State<DashboardScreen> with UIMixin {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
MyText.titleMedium("Dashboard", fontWeight: 600),
|
||||
MySpacing.height(12),
|
||||
_buildDashboardStats(),
|
||||
MySpacing.height(350),
|
||||
MySpacing.height(300),
|
||||
if (!hasMpin) ...[
|
||||
MyCard(
|
||||
borderRadiusAll: 12,
|
||||
|
@ -46,17 +46,44 @@ class _LayoutState extends State<Layout> {
|
||||
endDrawer: UserProfileBar(),
|
||||
floatingActionButton: widget.floatingActionButton,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
child: Stack(
|
||||
children: [
|
||||
_buildHeader(context, isMobile),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
key: controller.scrollKey,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 0, vertical: isMobile ? 16 : 32),
|
||||
child: widget.child,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
_buildHeader(context, isMobile),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
key: controller.scrollKey,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 0, vertical: isMobile ? 16 : 32),
|
||||
child: widget.child,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// Overlay project list below header
|
||||
Obx(() {
|
||||
if (!projectController.isProjectSelectionExpanded.value) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return Positioned(
|
||||
top: 95, // Adjust based on header card height
|
||||
left: 16,
|
||||
right: 16,
|
||||
child: Material(
|
||||
elevation: 4,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: _buildProjectList(context, isMobile),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -81,15 +108,15 @@ class _LayoutState extends State<Layout> {
|
||||
return Card(
|
||||
elevation: 4,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(isExpanded ? 16 : 12),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
margin: EdgeInsets.zero,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
clipBehavior: Clip.antiAlias, // important for overlap inside card
|
||||
child: Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
@ -158,16 +185,27 @@ class _LayoutState extends State<Layout> {
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.menu),
|
||||
icon: const Icon(Icons.menu),
|
||||
onPressed: () =>
|
||||
controller.scaffoldKey.currentState?.openEndDrawer(),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
if (isExpanded) _buildProjectList(context, isMobile),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
/// Expanded Project List inside card
|
||||
if (isExpanded)
|
||||
Positioned(
|
||||
top: 70, // slightly below the row
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: _buildProjectList(context, isMobile),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
@ -178,7 +216,6 @@ class _LayoutState extends State<Layout> {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Divider(),
|
||||
MyText.titleSmall("Switch Project", fontWeight: 600),
|
||||
const SizedBox(height: 4),
|
||||
ConstrainedBox(
|
||||
|
Loading…
x
Reference in New Issue
Block a user