-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enables edge to edge support in material 3 demo.
Edge to edge is coming by default to Flutter 3.26+ or so when the targetSdk is raised to Android 15(API 35). In the meantime, it can be done manually by adjusting the theme and setting `WindowCompat.setDecorFitsSystemWindows`. Fixes #1720 .
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
material_3_demo/android/app/src/main/kotlin/com/example/material_3_demo/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
package com.example.material_3_demo | ||
|
||
import io.flutter.embedding.android.FlutterActivity | ||
import android.os.Bundle | ||
import androidx.core.view.WindowCompat | ||
|
||
class MainActivity: FlutterActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
WindowCompat.setDecorFitsSystemWindows(window, false) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters