From 1895a9a8c8ee961eaade8f54b784004a81947d43 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 26 Nov 2020 09:41:21 +0800 Subject: [PATCH] fix scaffold appBar height without appBarBottom --- example/lib/example_scaffold.dart | 14 +++++++++++++- lib/scaffold/as_scaffold.dart | 6 +++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/example/lib/example_scaffold.dart b/example/lib/example_scaffold.dart index 70d1fca..c691fb9 100644 --- a/example/lib/example_scaffold.dart +++ b/example/lib/example_scaffold.dart @@ -1,5 +1,6 @@ import 'package:ansu_ui/ansu_ui.dart'; import 'package:flutter/material.dart'; +import 'package:get/get.dart'; class ExampleScaffold extends StatefulWidget { ExampleScaffold({Key key}) : super(key: key); @@ -48,7 +49,18 @@ class _ExampleScaffoldState extends State child: Text('open drawer'), ); }, - ) + ), + TextButton( + onPressed: () { + Get.dialog( + ASScaffold( + title: '框架 Scaffold', + ), + useSafeArea: false, + ); + }, + child: Text('open drawer'), + ), ], ), ); diff --git a/lib/scaffold/as_scaffold.dart b/lib/scaffold/as_scaffold.dart index 6211f84..25a2a5d 100644 --- a/lib/scaffold/as_scaffold.dart +++ b/lib/scaffold/as_scaffold.dart @@ -76,7 +76,11 @@ class _ASScaffoldState extends State { ? Text(widget.title) : widget.title ?? SizedBox(), ), - bottom: widget.appBarBottom, + bottom: widget.appBarBottom ?? + PreferredSize( + child: SizedBox(), + preferredSize: Size.fromHeight(0), + ), ), body: widget.body, );