Compare commits

...

5 Commits

Author SHA1 Message Date
Neeraj Gupta
ec895546f6 Bump version to 2.0.12 2023-10-19 12:50:48 +05:30
Neeraj Gupta
f5b7894cb1 Show placeholder icons when icon is missing (#301) 2023-10-19 12:48:31 +05:30
Neeraj Gupta
3f5ef23e1b Update ui 2023-10-19 12:46:03 +05:30
Neeraj Gupta
d496adaed2 Show placeholder icons when icon is missing 2023-10-19 12:38:27 +05:30
Neeraj Gupta
016e85f350 Bump version to 2.0.11 2023-10-19 12:20:03 +05:30
5 changed files with 75 additions and 4 deletions

View File

Before

Width:  |  Height:  |  Size: 822 B

After

Width:  |  Height:  |  Size: 822 B

View File

@@ -47,7 +47,7 @@ class EnteColorScheme {
final Color warning800;
final Color caution500;
final List<Color> avatarColors;
const EnteColorScheme(
this.backgroundBase,
this.backgroundElevated,
@@ -69,7 +69,8 @@ class EnteColorScheme {
this.strokeFainter,
this.blurStrokeBase,
this.blurStrokeFaint,
this.blurStrokePressed, {
this.blurStrokePressed,
this.avatarColors, {
this.primaryGreen = _primaryGreen,
this.primary700 = _primary700,
this.primary500 = _primary500,
@@ -105,6 +106,7 @@ const EnteColorScheme lightScheme = EnteColorScheme(
blurStrokeBaseLight,
blurStrokeFaintLight,
blurStrokePressedLight,
avatarLight,
);
const EnteColorScheme darkScheme = EnteColorScheme(
@@ -129,6 +131,7 @@ const EnteColorScheme darkScheme = EnteColorScheme(
blurStrokeBaseDark,
blurStrokeFaintDark,
blurStrokePressedDark,
avatarDark,
);
// Background Colors
@@ -204,3 +207,55 @@ const Color warning500 = Color.fromRGBO(255, 101, 101, 1);
const Color _warning400 = Color.fromRGBO(255, 111, 111, 1);
const Color _caution500 = Color.fromRGBO(255, 194, 71, 1);
const List<Color> avatarLight = [
Color.fromRGBO(118, 84, 154, 1),
Color.fromRGBO(223, 120, 97, 1),
Color.fromRGBO(148, 180, 159, 1),
Color.fromRGBO(135, 162, 251, 1),
Color.fromRGBO(198, 137, 198, 1),
Color.fromRGBO(198, 137, 198, 1),
Color.fromRGBO(50, 82, 136, 1),
Color.fromRGBO(133, 180, 224, 1),
Color.fromRGBO(193, 163, 163, 1),
Color.fromRGBO(193, 163, 163, 1),
Color.fromRGBO(66, 97, 101, 1),
Color.fromRGBO(66, 97, 101, 1),
Color.fromRGBO(66, 97, 101, 1),
Color.fromRGBO(221, 157, 226, 1),
Color.fromRGBO(130, 171, 139, 1),
Color.fromRGBO(155, 187, 232, 1),
Color.fromRGBO(143, 190, 190, 1),
Color.fromRGBO(138, 195, 161, 1),
Color.fromRGBO(168, 176, 242, 1),
Color.fromRGBO(176, 198, 149, 1),
Color.fromRGBO(233, 154, 173, 1),
Color.fromRGBO(209, 132, 132, 1),
Color.fromRGBO(120, 181, 167, 1),
];
const List<Color> avatarDark = [
Color.fromRGBO(118, 84, 154, 1),
Color.fromRGBO(223, 120, 97, 1),
Color.fromRGBO(148, 180, 159, 1),
Color.fromRGBO(135, 162, 251, 1),
Color.fromRGBO(198, 137, 198, 1),
Color.fromRGBO(147, 125, 194, 1),
Color.fromRGBO(50, 82, 136, 1),
Color.fromRGBO(133, 180, 224, 1),
Color.fromRGBO(193, 163, 163, 1),
Color.fromRGBO(225, 160, 89, 1),
Color.fromRGBO(66, 97, 101, 1),
Color.fromRGBO(107, 119, 178, 1),
Color.fromRGBO(149, 127, 239, 1),
Color.fromRGBO(221, 157, 226, 1),
Color.fromRGBO(130, 171, 139, 1),
Color.fromRGBO(155, 187, 232, 1),
Color.fromRGBO(143, 190, 190, 1),
Color.fromRGBO(138, 195, 161, 1),
Color.fromRGBO(168, 176, 242, 1),
Color.fromRGBO(176, 198, 149, 1),
Color.fromRGBO(233, 154, 173, 1),
Color.fromRGBO(209, 132, 132, 1),
Color.fromRGBO(120, 181, 167, 1),
];

View File

@@ -325,6 +325,7 @@ class _CodeWidgetState extends State<CodeWidget> {
? const EdgeInsets.only(left: 16)
: const EdgeInsets.all(0),
child: IconUtils.instance.getIcon(
context,
safeDecode(widget.code.issuer).trim(),
width: _shouldShowLargeIcon ? 42 : 24,
),

View File

@@ -1,8 +1,8 @@
import 'dart:convert';
import 'package:ente_auth/theme/ente_theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_svg/svg.dart';
class IconUtils {
@@ -19,6 +19,7 @@ class IconUtils {
}
Widget getIcon(
BuildContext context,
String provider, {
double width = 24,
}) {
@@ -37,6 +38,20 @@ class IconUtils {
_simpleIcons[title],
width,
);
} else if (title.isNotEmpty) {
bool showLargeIcon = width > 24;
return CircleAvatar(
radius: width / 2,
backgroundColor: getEnteColorScheme(context).avatarColors[
title.hashCode % getEnteColorScheme(context).avatarColors.length],
child: Text(
title.toUpperCase()[0],
// fixed color
style: showLargeIcon
? getEnteTextTheme(context).h3Bold.copyWith(color: Colors.white)
: getEnteTextTheme(context).body.copyWith(color: Colors.white),
),
);
} else {
return const SizedBox.shrink();
}

View File

@@ -1,6 +1,6 @@
name: ente_auth
description: ente two-factor authenticator
version: 2.0.10+210
version: 2.0.12+212
publish_to: none
environment: