-
-
Notifications
You must be signed in to change notification settings - Fork 877
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[auth] Add Support for Custom Icons (#4395)
## Description This PR introduces a new feature allowing users to select and assign custom icons to their codes.
- Loading branch information
Showing
7 changed files
with
433 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
enum IconType { simpleIcon, customIcon } | ||
|
||
class AllIconData { | ||
final String title; | ||
final IconType type; | ||
final String? color; | ||
final String? slug; | ||
|
||
AllIconData({ | ||
required this.title, | ||
required this.type, | ||
required this.color, | ||
this.slug, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import 'package:ente_auth/theme/ente_theme.dart'; | ||
import 'package:ente_auth/ui/utils/icon_utils.dart'; | ||
import 'package:ente_auth/utils/totp_util.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class CustomIconWidget extends StatelessWidget { | ||
final String iconData; | ||
|
||
CustomIconWidget({ | ||
super.key, | ||
required this.iconData, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
width: 70, | ||
height: 70, | ||
decoration: BoxDecoration( | ||
border: Border.all( | ||
width: 1.5, | ||
color: getEnteColorScheme(context).tagChipSelectedColor, | ||
), | ||
borderRadius: const BorderRadius.all(Radius.circular(12.0)), | ||
), | ||
padding: const EdgeInsets.all(8), | ||
child: FittedBox( | ||
fit: BoxFit.contain, | ||
child: IconUtils.instance.getIcon( | ||
context, | ||
safeDecode(iconData).trim(), | ||
width: 50, | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.