mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-08-03 09:10:13 +08:00
36
lib/common/widgets/simple_app_bar.dart
Normal file
36
lib/common/widgets/simple_app_bar.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:PiliPlus/utils/extension/theme_ext.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart' show SystemUiOverlayStyle;
|
||||
|
||||
class SimpleAppBar extends StatelessWidget {
|
||||
const SimpleAppBar({
|
||||
super.key,
|
||||
required this.height,
|
||||
required this.brightness,
|
||||
Brightness? statusBarIconBrightness,
|
||||
this.backgroundColor = Colors.black,
|
||||
}) : statusBarIconBrightness = statusBarIconBrightness ?? .light;
|
||||
|
||||
final double height;
|
||||
final Brightness brightness;
|
||||
final Brightness statusBarIconBrightness;
|
||||
final Color backgroundColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
value: SystemUiOverlayStyle(
|
||||
statusBarBrightness: .light,
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarIconBrightness: statusBarIconBrightness,
|
||||
systemStatusBarContrastEnforced: false,
|
||||
systemNavigationBarColor: Colors.transparent,
|
||||
systemNavigationBarIconBrightness: brightness.reverse,
|
||||
),
|
||||
child: ColoredBox(
|
||||
color: backgroundColor,
|
||||
child: SizedBox(height: height, width: .infinity),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user