Files
packages.dart/deprecated/golden_layout/lib/src/theme.dart
T
2026-01-15 14:38:46 -08:00

44 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
class GoldenLayoutThemeData {
final Color tabSelectedBackgroundColor;
Color tabBackgroundColor;
Color backgroundColor;
final Color draggableBarsHoveredColor;
final Color tabIconColor;
GoldenLayoutThemeData({
this.tabSelectedBackgroundColor = Colors.grey,
this.backgroundColor,
this.draggableBarsHoveredColor = Colors.grey,
this.tabIconColor = Colors.white,
this.tabBackgroundColor,
}) {
tabBackgroundColor ??= Colors.grey.shade700;
backgroundColor ??= Colors.grey.shade800;
}
}
class GoldenLayoutTheme extends InheritedWidget {
GoldenLayoutTheme({
Key key,
@required this.child,
@required this.data,
}) : super(key: key, child: child);
final GoldenLayoutThemeData data;
@override
final Widget child;
GoldenLayoutThemeData get theme => data ?? GoldenLayoutThemeData();
static GoldenLayoutTheme of(BuildContext context) {
return (context.dependOnInheritedWidgetOfExactType<GoldenLayoutTheme>());
}
@override
bool updateShouldNotify(GoldenLayoutTheme oldWidget) {
return data != oldWidget.data;
}
}