mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 06:07:54 -06:00
Added open in system viewer, updated translations.
This commit is contained in:
@@ -1,23 +1,35 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
///
|
||||
/// Workaround class to change background color of chips without losing ripple effect.
|
||||
/// Currently broken in flutter m3.
|
||||
/// Applies only to light theme if [applyToDarkTheme] is not explicitly set to true.
|
||||
///
|
||||
class ColoredChipWrapper extends StatelessWidget {
|
||||
////
|
||||
final Color? backgroundColor;
|
||||
final Widget child;
|
||||
final bool applyToDarkTheme;
|
||||
|
||||
const ColoredChipWrapper({
|
||||
super.key,
|
||||
this.backgroundColor,
|
||||
required this.child,
|
||||
this.applyToDarkTheme = false,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Color color = backgroundColor ?? Colors.lightGreen[50]!;
|
||||
|
||||
return Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
canvasColor: color,
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
final brightness = Theme.of(context).brightness;
|
||||
if ((brightness == Brightness.dark && applyToDarkTheme) ||
|
||||
brightness == Brightness.light) {
|
||||
return Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
canvasColor: backgroundColor ?? Colors.lightGreen[50]!,
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user