feat: implement dynamic theme palette selection
- Introduced a new feature allowing users to select from multiple accent color palettes for buttons, cards, and chat bubbles. - Added `AppThemePalette` provider to manage the current theme palette and persist user selections. - Updated the `AppTheme` class to utilize the selected palette for light and dark themes, enhancing visual customization. - Enhanced the `AppCustomizationPage` to include a palette selector, improving user experience and personalization options. - Updated localization files to support new palette selection UI elements in multiple languages.
This commit is contained in:
@@ -21,7 +21,7 @@ class ConduitLoading {
|
||||
}) {
|
||||
return _LoadingIndicator(
|
||||
size: size,
|
||||
color: color ?? BrandService.primaryBrandColor,
|
||||
color: color,
|
||||
message: message,
|
||||
type: _LoadingType.primary,
|
||||
);
|
||||
@@ -40,7 +40,7 @@ class ConduitLoading {
|
||||
color ??
|
||||
(context?.conduitTheme.loadingIndicator ??
|
||||
context?.conduitTheme.buttonPrimary ??
|
||||
AppTheme.brandPrimary),
|
||||
BrandService.primaryBrandColor(context: context)),
|
||||
message: message,
|
||||
type: _LoadingType.inline,
|
||||
);
|
||||
@@ -91,30 +91,35 @@ enum _LoadingType { primary, inline, button }
|
||||
|
||||
class _LoadingIndicator extends StatelessWidget {
|
||||
final double size;
|
||||
final Color color;
|
||||
final Color? color;
|
||||
final String? message;
|
||||
final _LoadingType type;
|
||||
|
||||
const _LoadingIndicator({
|
||||
required this.size,
|
||||
required this.color,
|
||||
this.color,
|
||||
this.message,
|
||||
required this.type,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final resolvedColor = color ?? context.conduitTheme.loadingIndicator;
|
||||
|
||||
Widget indicator;
|
||||
|
||||
if (Platform.isIOS) {
|
||||
indicator = CupertinoActivityIndicator(color: color, radius: size / 2);
|
||||
indicator = CupertinoActivityIndicator(
|
||||
color: resolvedColor,
|
||||
radius: size / 2,
|
||||
);
|
||||
} else {
|
||||
indicator = SizedBox(
|
||||
width: size,
|
||||
height: size,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: size / 8,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(color),
|
||||
valueColor: AlwaysStoppedAnimation<Color>(resolvedColor),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user