Skip to content

Commit

Permalink
fix: changed statusBar color to have light theme
Browse files Browse the repository at this point in the history
* Fixed statusbar visiblity by changing its brightness
* Bump version 1.1.1
  • Loading branch information
rafayali committed Jul 9, 2023
1 parent 9334217 commit 02653a7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
13 changes: 13 additions & 0 deletions lib/app/theme.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

const lightColorScheme = ColorScheme(
brightness: Brightness.light,
Expand Down Expand Up @@ -75,6 +76,12 @@ final lightTheme = ThemeData(
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(elevation: MaterialStateProperty.all(0)),
),
appBarTheme: AppBarTheme(
systemOverlayStyle: SystemUiOverlayStyle.light.copyWith(
statusBarIconBrightness: Brightness.light,
systemNavigationBarColor: Colors.transparent,
),
),
);

final darkTheme = ThemeData(
Expand All @@ -84,6 +91,12 @@ final darkTheme = ThemeData(
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(elevation: MaterialStateProperty.all(0)),
),
appBarTheme: AppBarTheme(
systemOverlayStyle: SystemUiOverlayStyle.light.copyWith(
statusBarIconBrightness: Brightness.light,
systemNavigationBarColor: Colors.transparent,
),
),
);

const pageTransitionsTheme = PageTransitionsTheme(
Expand Down
9 changes: 6 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ import 'app/app.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();

SystemChrome.setEnabledSystemUIMode(
SystemUiMode.edgeToEdge,
overlays: [SystemUiOverlay.top],
SystemChrome.setSystemUIOverlayStyle(
const SystemUiOverlayStyle(
systemNavigationBarColor: Colors.transparent,
),
);

SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);

final state = await _initializeState();

_setupLogging();
Expand Down
1 change: 0 additions & 1 deletion lib/ui/login/view/auth_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class _AuthPageState extends State<AuthPage> {

webviewController = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setBackgroundColor(const Color(0x00000000))
..loadRequest(Uri.parse(
'https://www.themoviedb.org/authenticate/${widget.requestToken}',
));
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.1.0+5
version: 1.1.1+6

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down

0 comments on commit 02653a7

Please sign in to comment.