Fix SafeArea DartPad sample (#159344)

This pull request fixes a bug I introduced in
https://github.com/flutter/flutter/pull/158019.

<br>

<h3 align="center">Before</h3>
<p align="center">
  <img 

src="https://github.com/user-attachments/assets/fcb68fac-9c63-445d-8d2b-afc28c685053"
    alt="RenderFlex overflowed"
    width="523px"
  />
</p>

<h3 align="center">After</h3>
<p align="center">
  <img 

src="https://github.com/user-attachments/assets/82091c6a-b3c5-4994-978e-5e76cbb7edfd"
    alt="RenderFlex overflowed"
    width="523px"
  />
</p>

<br><br>

- fixes https://github.com/flutter/flutter/issues/159340
This commit is contained in:
Nate Wilson
2024-12-09 12:54:08 -07:00
committed by GitHub
parent f7871352fb
commit dc5809309a
2 changed files with 31 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ class SafeAreaExampleApp extends StatelessWidget {
scaffoldBackgroundColor: const Color(0xFFD0FFE8),
listTileTheme: const ListTileThemeData(
tileColor: Colors.white70,
contentPadding: EdgeInsets.all(6.0),
visualDensity: VisualDensity(horizontal: -4, vertical: -4),
),
appBarTheme: AppBarTheme(
backgroundColor: colors.secondary,
@@ -65,7 +65,7 @@ class SafeAreaExample extends StatelessWidget {
static final Widget controls = Column(
children: <Widget>[
const SizedBox(height: 14),
const SizedBox(height: 6),
Builder(
builder: (BuildContext context) => Text(
Toggle.safeArea.of(context) ? 'safe area!' : 'no safe area',