chore: adjust legacy space icon (#5886)

This commit is contained in:
Lucas.Xu 2024-08-06 15:10:44 +08:00 committed by GitHub
parent aab942d163
commit 41a346c7ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 4 deletions

View File

@ -500,7 +500,7 @@ class CurrentSpace extends StatelessWidget {
SpaceIcon(
dimension: 22,
space: space,
svgSize: 13,
svgSize: 12,
cornerRadius: 8.0,
),
const HSpace(10),

View File

@ -39,9 +39,10 @@ class SpaceIcon extends StatelessWidget {
height: dimension,
color: color,
child: Center(
child: svgSize == null
? svg
: SizedBox.square(dimension: svgSize!, child: svg),
child:
svgSize == null || space.spaceIcon?.contains('space_icon') == true
? svg
: SizedBox.square(dimension: svgSize!, child: svg),
),
),
);

View File

@ -119,6 +119,20 @@ class _SpaceIconPopupState extends State<SpaceIconPopup> {
dimension: 32,
iconDimension: 32,
);
} else if (value.contains('space_icon')) {
child = ClipRRect(
borderRadius: BorderRadius.circular(widget.cornerRadius),
child: Container(
color: Color(int.parse(color)),
child: Align(
child: FlowySvg(
FlowySvgData('assets/flowy_icons/16x/$value.svg'),
size: const Size.square(42),
color: Theme.of(context).colorScheme.surface,
),
),
),
);
} else {
final content = kIconGroups?.findSvgContent(value);
if (content == null) {