[Android] Fixed system navigation bar color

This commit is contained in:
Vadim 2023-02-11 20:33:08 +03:00
parent e4deac0fee
commit afdbc92ac4
3 changed files with 11 additions and 2 deletions

View file

@ -1,11 +1,18 @@
package com.vodemn.lightmeter
import android.os.Bundle
import android.view.WindowManager
import androidx.core.view.WindowCompat
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
class MainActivity : FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
WindowCompat.setDecorFitsSystemWindows(window, false)
}
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
MethodChannel(

View file

@ -57,7 +57,7 @@ class Application extends StatelessWidget {
? Brightness.dark
: Brightness.light,
statusBarIconBrightness: systemIconsBrightness,
systemNavigationBarColor: context.watch<ThemeData>().colorScheme.surface,
systemNavigationBarColor: Colors.transparent,
systemNavigationBarIconBrightness: systemIconsBrightness,
),
child: MaterialApp(

View file

@ -25,6 +25,7 @@ class SettingsScreen extends StatelessWidget {
return Scaffold(
body: SafeArea(
top: false,
bottom: false,
child: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
@ -51,7 +52,7 @@ class SettingsScreen extends StatelessWidget {
),
SliverList(
delegate: SliverChildListDelegate(
<SettingsSection>[
<Widget>[
SettingsSection(
title: S.of(context).metering,
children: const [
@ -84,6 +85,7 @@ class SettingsScreen extends StatelessWidget {
VersionListTile(),
],
),
SizedBox(height: MediaQuery.of(context).padding.bottom),
],
),
),