create widget for stuff that sticks to bottom

This commit is contained in:
Filip Krawczyk 2022-08-25 17:27:40 +02:00
parent 6729a040ea
commit b39d6b06d7
4 changed files with 33 additions and 35 deletions

View File

@ -142,18 +142,12 @@ class CreatePostPage extends HookWidget {
),
),
),
SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Spacer(),
EditorToolbar(
BottomSticky(
child: EditorToolbar(
editorFocusNode: editorFocusNode,
controller: bodyController,
instanceHost: context.read<CreatePostStore>().instanceHost,
),
],
),
),
],
),

View File

@ -384,19 +384,13 @@ class _ManageAccount extends HookWidget {
const BottomSafe(),
],
),
SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Spacer(),
EditorToolbar(
BottomSticky(
child: EditorToolbar(
editorFocusNode: bioFocusNode,
controller: bioController,
instanceHost: user.instanceHost,
),
],
),
),
)
],
);
}

View File

@ -87,7 +87,23 @@ class EditorToolbar extends HookWidget {
);
}
static Widget safeArea = const SizedBox(height: _height);
static const safeArea = SizedBox(height: _height);
}
class BottomSticky extends StatelessWidget {
final Widget child;
const BottomSticky({required this.child});
@override
Widget build(BuildContext context) => SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Spacer(),
child,
],
),
);
}
class _ToolbarBody extends HookWidget {

View File

@ -137,18 +137,12 @@ class WriteComment extends HookWidget {
EditorToolbar.safeArea,
],
),
SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Spacer(),
EditorToolbar(
BottomSticky(
child: EditorToolbar(
editorFocusNode: editorFocusNode,
controller: controller,
instanceHost: post.instanceHost,
),
],
),
),
],
),