Added open in system viewer, updated translations.

This commit is contained in:
Anton Stubenbord
2023-01-21 01:20:33 +01:00
parent 2e0730ce2f
commit 78aefb05eb
18 changed files with 201 additions and 89 deletions

View File

@@ -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;
}
}