fix: removed the parent padding and instead applied padding individually. (#3814)

* fix: Removed the parent padding and instead applied individual padding to each child to ensure it doesn't affect the sidebar divider.

* chore: Addressed comments and made changes
This commit is contained in:
Kritarth Sharma 2023-10-28 16:41:52 +05:30 committed by GitHub
parent e28e5a0649
commit 197da5f425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 25 deletions

View File

@ -87,6 +87,7 @@ class HomeSideBar extends StatelessWidget {
List<ViewPB> views,
List<ViewPB> favoriteViews,
) {
const menuHorizontalInset = EdgeInsets.symmetric(horizontal: 12);
return DecoratedBox(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceVariant,
@ -94,19 +95,25 @@ class HomeSideBar extends StatelessWidget {
right: BorderSide(color: Theme.of(context).dividerColor),
),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
// top menu
const SidebarTopMenu(),
// user, setting
SidebarUser(user: user, views: views),
const VSpace(20),
// scrollable document list
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
// top menu
const Padding(
padding: menuHorizontalInset,
child: SidebarTopMenu(),
),
// user, setting
Padding(
padding: menuHorizontalInset,
child: SidebarUser(user: user, views: views),
),
const VSpace(20),
// scrollable document list
Expanded(
child: Padding(
padding: menuHorizontalInset,
child: SingleChildScrollView(
child: SidebarFolder(
views: views,
@ -114,17 +121,17 @@ class HomeSideBar extends StatelessWidget {
),
),
),
const VSpace(10),
// trash
const SidebarTrashButton(),
const VSpace(10),
// new page button
const Padding(
padding: EdgeInsets.only(left: 6.0),
child: SidebarNewPageButton(),
),
],
),
),
const VSpace(10),
// trash
const Padding(
padding: menuHorizontalInset,
child: SidebarTrashButton(),
),
const VSpace(10),
// new page button
const SidebarNewPageButton(),
],
),
);
}

View File

@ -48,7 +48,10 @@ class SidebarNewPageButton extends StatelessWidget {
height: 60,
child: TopBorder(
color: Theme.of(context).dividerColor,
child: child,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 18),
child: child,
),
),
);
}