fix: bottom appbar inset padding

This commit is contained in:
DenserMeerkat
2024-06-19 12:49:30 +05:30
parent afd9c1c38a
commit 6db2968557
2 changed files with 101 additions and 90 deletions

View File

@ -8,6 +8,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
import '../../home_page/collection_pane.dart'; import '../../home_page/collection_pane.dart';
import '../../home_page/editor_pane/url_card.dart'; import '../../home_page/editor_pane/url_card.dart';
import '../../home_page/editor_pane/details_card/code_pane.dart'; import '../../home_page/editor_pane/details_card/code_pane.dart';
import '../../home_page/editor_pane/editor_default.dart';
import '../../common/main_editor_widgets.dart'; import '../../common/main_editor_widgets.dart';
import '../widgets/page_base.dart'; import '../widgets/page_base.dart';
import 'request_response_tabs.dart'; import 'request_response_tabs.dart';
@ -56,7 +57,9 @@ class _RequestResponsePageState extends ConsumerState<RequestResponsePage>
), ),
leftDrawerContent: const CollectionPane(), leftDrawerContent: const CollectionPane(),
actions: const [Padding(padding: kPh8, child: EnvironmentDropdown())], actions: const [Padding(padding: kPh8, child: EnvironmentDropdown())],
mainContent: RequestResponseTabs( mainContent: id == null
? const RequestEditorDefault()
: RequestResponseTabs(
controller: requestResponseTabController, controller: requestResponseTabController,
), ),
bottomNavigationBar: RequestResponsePageBottombar( bottomNavigationBar: RequestResponsePageBottombar(
@ -77,7 +80,10 @@ class RequestResponsePageBottombar extends ConsumerWidget {
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
return Container( final selecetdId = ref.watch(selectedIdStateProvider);
return Padding(
padding: MediaQuery.of(context).viewInsets,
child: Container(
height: 60 + MediaQuery.paddingOf(context).bottom, height: 60 + MediaQuery.paddingOf(context).bottom,
width: MediaQuery.sizeOf(context).width, width: MediaQuery.sizeOf(context).width,
padding: EdgeInsets.only( padding: EdgeInsets.only(
@ -103,7 +109,9 @@ class RequestResponsePageBottombar extends ConsumerWidget {
borderRadius: BorderRadius.all(Radius.circular(12)), borderRadius: BorderRadius.all(Radius.circular(12)),
), ),
), ),
onPressed: () { onPressed: selecetdId == null
? null
: () {
Navigator.of(context).push( Navigator.of(context).push(
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const PageBase( builder: (context) => const PageBase(
@ -126,6 +134,7 @@ class RequestResponsePageBottombar extends ConsumerWidget {
), ),
], ],
), ),
),
); );
} }
} }

View File

@ -143,6 +143,7 @@ class TwoDrawerScaffold extends StatelessWidget {
return Container( return Container(
padding: (kIsWindows || kIsMacOS) ? kPt28 : EdgeInsets.zero, padding: (kIsWindows || kIsMacOS) ? kPt28 : EdgeInsets.zero,
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,
child: SafeArea(
child: Scaffold( child: Scaffold(
key: scaffoldKey, key: scaffoldKey,
backgroundColor: Theme.of(context).colorScheme.surface, backgroundColor: Theme.of(context).colorScheme.surface,
@ -189,6 +190,7 @@ class TwoDrawerScaffold extends StatelessWidget {
body: mainContent, body: mainContent,
bottomNavigationBar: bottomNavigationBar, bottomNavigationBar: bottomNavigationBar,
), ),
),
); );
} }
} }