Merge branch 'main' into my-changes
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
},
|
||||
{
|
||||
"title": "Control D",
|
||||
"slug": "controld",
|
||||
"hex": "5FD800"
|
||||
},
|
||||
{
|
||||
@@ -54,7 +55,8 @@
|
||||
"title": "Firefox"
|
||||
},
|
||||
{
|
||||
"title": "GitHub"
|
||||
"title": "GitHub",
|
||||
"hex": "858585"
|
||||
},
|
||||
{
|
||||
"title": "Google"
|
||||
@@ -88,9 +90,9 @@
|
||||
"title": "KuCoin",
|
||||
"hex": "01BC8D"
|
||||
},
|
||||
{
|
||||
{
|
||||
"title": "La Poste",
|
||||
"slug": "laposte"
|
||||
"slug": "laposte"
|
||||
},
|
||||
{
|
||||
"title": "Microsoft"
|
||||
@@ -137,10 +139,12 @@
|
||||
"color": "EF8300"
|
||||
},
|
||||
{
|
||||
"title": "Privacy Guides"
|
||||
"title": "Privacy Guides",
|
||||
"slug": "privacyguides"
|
||||
},
|
||||
{
|
||||
"title": "Privacy.com"
|
||||
"title": "Privacy.com",
|
||||
"slug": "privacy"
|
||||
},
|
||||
{
|
||||
"title": "Proton"
|
||||
@@ -157,6 +161,7 @@
|
||||
},
|
||||
{
|
||||
"title": "Standard Notes",
|
||||
"slug": "standardnotes",
|
||||
"hex": "2173E6"
|
||||
},
|
||||
{
|
||||
@@ -168,6 +173,7 @@
|
||||
},
|
||||
{
|
||||
"title": "Trading 212",
|
||||
"slug": "trading212",
|
||||
"hex": "4BA4DE"
|
||||
},
|
||||
{
|
||||
@@ -191,7 +197,8 @@
|
||||
"slug": "x"
|
||||
},
|
||||
{
|
||||
"title": "Ubisoft"
|
||||
"title": "Ubisoft",
|
||||
"hex": "4285f4"
|
||||
},
|
||||
{
|
||||
"title": "Unity",
|
||||
|
||||
@@ -1,5 +1 @@
|
||||
<svg width="500" height="500" viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g style="mix-blend-mode:difference">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M250.207 5C111.849 5 0 117.52 0 256.723C0 367.996 71.6655 462.186 171.084 495.522C183.514 498.028 188.067 490.106 188.067 483.442C188.067 477.606 187.658 457.603 187.658 436.761C118.056 451.767 103.562 406.754 103.562 406.754C92.3769 377.581 75.8037 370.083 75.8037 370.083C53.0231 354.662 77.463 354.662 77.463 354.662C102.733 356.329 115.992 380.501 115.992 380.501C138.358 418.84 174.398 408.007 188.897 401.338C190.966 385.084 197.599 373.832 204.641 367.582C149.128 361.746 90.7227 340.075 90.7227 243.385C90.7227 215.879 100.658 193.374 116.402 175.872C113.918 169.622 105.217 143.779 118.891 109.189C118.891 109.189 140.017 102.519 187.653 135.028C208.047 129.517 229.079 126.714 250.207 126.691C271.333 126.691 292.869 129.611 312.756 135.028C360.396 102.519 381.523 109.189 381.523 109.189C395.197 143.779 386.491 169.622 384.007 175.872C400.165 193.374 409.691 215.879 409.691 243.385C409.691 340.075 351.285 361.326 295.358 367.582C304.474 375.499 312.341 390.5 312.341 414.257C312.341 448.013 311.931 475.105 311.931 483.437C311.931 490.106 316.49 498.028 328.914 495.527C428.333 462.18 499.999 367.996 499.999 256.723C500.409 117.52 388.15 5 250.207 5Z" fill="white"/>
|
||||
</g>
|
||||
</svg>
|
||||
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 822 B |
@@ -1,5 +1 @@
|
||||
<svg width="500" height="500" viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g style="mix-blend-mode:difference">
|
||||
<path d="M234.915 0C79.5084 0 12.429 138.162 12.429 138.162L32.1744 152.281C32.1744 152.281 7.3264 199.477 8.01401 260.013C8.01401 383.59 106.503 500 251.486 500C383.198 500 492 392.923 492 260.317C492 87.3677 357.722 0 234.916 0H234.915ZM236.263 42.1591C357.682 42.1591 451.9 139.886 451.9 253.497C451.9 373.933 361.21 457.689 255.53 457.689C177.753 457.689 107.59 398.53 107.59 317.419C107.59 270.572 132.52 237.911 160.456 220.504L164.544 224.935C156.899 230.91 135.1 265.885 135.1 300.261C135.1 364.077 185.205 408.275 248.333 408.275C328.747 408.275 382.377 339.771 382.377 260.231C382.377 167.686 300.59 89.1181 202.165 89.1181C147.726 89.1181 101.521 112.502 74.9709 133.145L70.8393 129.41C105.574 75.9175 165.725 42.1591 236.263 42.1591ZM200.034 130.691C262.843 130.691 324.165 172.193 339.471 231.103L333.904 233.21C306.421 196.961 261.388 166.92 208.21 166.92C110.357 166.92 58.9672 255.732 66.5114 329.908L60.749 332.016C60.749 332.016 49.9411 308.197 49.9411 279.952C49.9411 198.161 117.19 130.691 200.034 130.691ZM241.548 233.34C271.284 233.34 295.066 257.414 295.066 285.991C295.066 309.639 279.864 323.654 279.864 323.654L297.87 336.229C297.87 336.229 280.015 364.227 243.57 364.227C208.707 364.227 177.875 336.122 177.875 298.327C177.875 259.384 211.412 233.34 241.548 233.34Z" fill="white"/>
|
||||
</g>
|
||||
</svg>
|
||||
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Ubisoft</title><path d="M23.561 11.988C23.301-.304 6.954-4.89.656 6.634c.282.206.661.477.943.672a11.747 11.747 0 00-.976 3.067 11.885 11.885 0 00-.184 2.071C.439 18.818 5.621 24 12.005 24c6.385 0 11.556-5.17 11.556-11.556v-.455zm-20.27 2.06c-.152 1.246-.054 1.636-.054 1.788l-.282.098c-.108-.206-.37-.932-.488-1.908C2.163 10.308 4.7 6.96 8.57 6.33c3.544-.52 6.937 1.68 7.728 4.758l-.282.098c-.087-.087-.228-.336-.77-.878-4.281-4.281-11.002-2.32-11.956 3.74zm11.002 2.081a3.145 3.145 0 01-2.59 1.355 3.15 3.15 0 01-3.155-3.155 3.159 3.159 0 012.927-3.144c1.018-.043 1.972.51 2.416 1.398a2.58 2.58 0 01-.455 2.95c.293.205.575.4.856.595zm6.58.12c-1.669 3.782-5.106 5.766-8.77 5.712-7.034-.347-9.083-8.466-4.38-11.393l.207.206c-.076.108-.358.325-.791 1.182-.51 1.041-.672 2.081-.607 2.732.369 5.67 8.314 6.83 11.045 1.214C21.057 8.217 11.822.401 3.626 6.374l-.184-.184C5.599 2.808 9.816 1.3 13.837 2.309c6.147 1.55 9.453 7.956 7.035 13.94z"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1022 B |
@@ -128,23 +128,7 @@ class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
|
||||
_showIncorrectDetailsDialog(context, message: message);
|
||||
return;
|
||||
}
|
||||
if (widget.code == null) {
|
||||
_saveCode();
|
||||
return;
|
||||
}
|
||||
ButtonResult? result = await showChoiceActionSheet(
|
||||
context,
|
||||
title: context.l10n.warning,
|
||||
body: context.l10n.confirmUpdatingkey,
|
||||
firstButtonLabel: context.l10n.yes,
|
||||
secondButtonAction: ButtonAction.cancel,
|
||||
secondButtonLabel: context.l10n.cancel,
|
||||
);
|
||||
|
||||
if (result == null) return;
|
||||
if (result.action == ButtonAction.first) {
|
||||
_saveCode();
|
||||
}
|
||||
await _saveCode();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
@@ -163,11 +147,25 @@ class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
|
||||
);
|
||||
}
|
||||
|
||||
void _saveCode() {
|
||||
Future<void> _saveCode() async {
|
||||
try {
|
||||
final account = _accountController.text.trim();
|
||||
final issuer = _issuerController.text.trim();
|
||||
final secret = _secretController.text.trim().replaceAll(' ', '');
|
||||
if (widget.code != null && widget.code!.secret != secret) {
|
||||
ButtonResult? result = await showChoiceActionSheet(
|
||||
context,
|
||||
title: context.l10n.warning,
|
||||
body: context.l10n.confirmUpdatingkey,
|
||||
firstButtonLabel: context.l10n.yes,
|
||||
secondButtonAction: ButtonAction.cancel,
|
||||
secondButtonLabel: context.l10n.cancel,
|
||||
);
|
||||
if (result == null) return;
|
||||
if (result.action != ButtonAction.first) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
final Code newCode = widget.code == null
|
||||
? Code.fromAccountAndSecret(
|
||||
account,
|
||||
|
||||
@@ -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),
|
||||
];
|
||||
|
||||
@@ -8,11 +8,11 @@ import 'package:ente_auth/l10n/l10n.dart';
|
||||
import 'package:ente_auth/models/code.dart';
|
||||
import 'package:ente_auth/onboarding/view/setup_enter_secret_key_page.dart';
|
||||
import 'package:ente_auth/onboarding/view/view_qr_page.dart';
|
||||
import 'package:ente_auth/services/local_authentication_service.dart';
|
||||
import 'package:ente_auth/services/preference_service.dart';
|
||||
import 'package:ente_auth/store/code_store.dart';
|
||||
import 'package:ente_auth/ui/code_timer_progress.dart';
|
||||
import 'package:ente_auth/ui/utils/icon_utils.dart';
|
||||
import 'package:ente_auth/utils/auth_util.dart';
|
||||
import 'package:ente_auth/utils/dialog_util.dart';
|
||||
import 'package:ente_auth/utils/toast_util.dart';
|
||||
import 'package:ente_auth/utils/totp_util.dart';
|
||||
@@ -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,
|
||||
),
|
||||
@@ -371,8 +372,9 @@ class _CodeWidgetState extends State<CodeWidget> {
|
||||
}
|
||||
|
||||
Future<void> _onEditPressed(_) async {
|
||||
bool _isAuthSuccessful = await requestAuthentication(context.l10n.editCodeAuthMessage);
|
||||
if(!_isAuthSuccessful) {
|
||||
bool _isAuthSuccessful = await LocalAuthenticationService.instance
|
||||
.requestLocalAuthentication(context, context.l10n.editCodeAuthMessage);
|
||||
if (!_isAuthSuccessful) {
|
||||
return;
|
||||
}
|
||||
final Code? code = await Navigator.of(context).push(
|
||||
@@ -388,8 +390,9 @@ class _CodeWidgetState extends State<CodeWidget> {
|
||||
}
|
||||
|
||||
Future<void> _onShowQrPressed(_) async {
|
||||
bool _isAuthSuccessful = await requestAuthentication(context.l10n.showQRAuthMessage);
|
||||
if(!_isAuthSuccessful) {
|
||||
bool _isAuthSuccessful = await LocalAuthenticationService.instance
|
||||
.requestLocalAuthentication(context, context.l10n.showQRAuthMessage);
|
||||
if (!_isAuthSuccessful) {
|
||||
return;
|
||||
}
|
||||
// ignore: unused_local_variable
|
||||
@@ -403,8 +406,12 @@ class _CodeWidgetState extends State<CodeWidget> {
|
||||
}
|
||||
|
||||
void _onDeletePressed(_) async {
|
||||
bool _isAuthSuccessful = await requestAuthentication(context.l10n.deleteCodeAuthMessage);
|
||||
if(!_isAuthSuccessful) {
|
||||
bool _isAuthSuccessful =
|
||||
await LocalAuthenticationService.instance.requestLocalAuthentication(
|
||||
context,
|
||||
context.l10n.deleteCodeAuthMessage,
|
||||
);
|
||||
if (!_isAuthSuccessful) {
|
||||
return;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
|
||||
@@ -158,7 +158,7 @@ class _HomePageState extends State<HomePage> {
|
||||
}
|
||||
},
|
||||
child: Scaffold(
|
||||
drawerEnableOpenDragGesture: true,
|
||||
drawerEnableOpenDragGesture: !Platform.isAndroid,
|
||||
drawer: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 428),
|
||||
child: Drawer(
|
||||
|
||||
@@ -107,21 +107,6 @@ class _AdvancedSectionWidgetState extends State<AdvancedSectionWidget> {
|
||||
),
|
||||
),
|
||||
sectionOptionSpacing,
|
||||
MenuItemWidget(
|
||||
captionedTextWidget: CaptionedTextWidget(
|
||||
title: l10n.crashAndErrorReporting,
|
||||
),
|
||||
trailingWidget: ToggleSwitchWidget(
|
||||
value: () => SuperLogging.shouldReportErrors(),
|
||||
onChanged: () async {
|
||||
await SuperLogging.setShouldReportErrors(
|
||||
!SuperLogging.shouldReportErrors(),
|
||||
);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
),
|
||||
sectionOptionSpacing,
|
||||
if (Platform.isAndroid) ...[
|
||||
MenuItemWidget(
|
||||
captionedTextWidget: CaptionedTextWidget(
|
||||
@@ -139,6 +124,21 @@ class _AdvancedSectionWidgetState extends State<AdvancedSectionWidget> {
|
||||
),
|
||||
sectionOptionSpacing,
|
||||
],
|
||||
MenuItemWidget(
|
||||
captionedTextWidget: CaptionedTextWidget(
|
||||
title: l10n.crashAndErrorReporting,
|
||||
),
|
||||
trailingWidget: ToggleSwitchWidget(
|
||||
value: () => SuperLogging.shouldReportErrors(),
|
||||
onChanged: () async {
|
||||
await SuperLogging.setShouldReportErrors(
|
||||
!SuperLogging.shouldReportErrors(),
|
||||
);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
),
|
||||
sectionOptionSpacing,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: ente_auth
|
||||
description: ente two-factor authenticator
|
||||
version: 2.0.8+208
|
||||
version: 2.0.12+212
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user