[mobile][photos] Home widget UI tweaks (#1060)

This commit is contained in:
Ashil 2024-03-13 11:20:50 +05:30 committed by GitHub
parent 773f4cdca2
commit 0c1c0ad400
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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),
),
),