From 0c1c0ad4007453d316028a6adf9f58b5b369d5b6 Mon Sep 17 00:00:00 2001 From: Ashil <77285023+ashilkn@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:20:50 +0530 Subject: [PATCH] [mobile][photos] Home widget UI tweaks (#1060) --- mobile/lib/services/home_widget_service.dart | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mobile/lib/services/home_widget_service.dart b/mobile/lib/services/home_widget_service.dart index 1d6892bb8..c8082b448 100644 --- a/mobile/lib/services/home_widget_service.dart +++ b/mobile/lib/services/home_widget_service.dart @@ -1,6 +1,8 @@ import "dart:math"; +import "package:figma_squircle/figma_squircle.dart"; import "package:flutter/material.dart"; +import "package:flutter/scheduler.dart"; import 'package:home_widget/home_widget.dart' as hw; import "package:logging/logging.dart"; import "package:photos/core/configuration.dart"; @@ -95,13 +97,18 @@ class HomeWidgetService { await PreloadImage.loadImage(img.image); - final widget = ClipRRect( - borderRadius: BorderRadius.circular(32), + final platformBrightness = + SchedulerBinding.instance.platformDispatcher.platformBrightness; + + final widget = ClipSmoothRect( + radius: SmoothBorderRadius(cornerRadius: 32, cornerSmoothing: 1), child: Container( width: size, height: size, decoration: BoxDecoration( - color: Colors.black, + color: platformBrightness == Brightness.light + ? const Color.fromRGBO(251, 251, 251, 1) + : const Color.fromRGBO(27, 27, 27, 1), image: DecorationImage(image: img.image, fit: BoxFit.cover), ), ),