Merge branch 'main' into offline_mode

This commit is contained in:
Neeraj Gupta 2023-08-29 15:34:14 +05:30
commit 75843814bd
36 changed files with 148 additions and 127 deletions

View file

@ -38,9 +38,7 @@ final darkTheme = ThemeData(
fontFamily: "Inter",
brightness: Brightness.dark,
scaffoldBackgroundColor: Colors.black,
backgroundColor: Colors.black,
appBarTheme: const AppBarTheme(color: Colors.orange),
colorScheme: const ColorScheme.dark(primary: Colors.white),
textTheme: _buildTextTheme(Colors.white),
outlinedButtonTheme: buildOutlinedButtonThemeData(
bgDisabled: Colors.grey.shade500,
@ -59,25 +57,25 @@ final darkTheme = ThemeData(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(6),
),
),
), colorScheme: const ColorScheme.dark(primary: Colors.white).copyWith(background: Colors.black),
);
TextTheme _buildTextTheme(Color textColor) {
return const TextTheme().copyWith(
headline4: TextStyle(
headlineMedium: TextStyle(
color: textColor,
fontSize: 32,
fontWeight: FontWeight.w700,
fontFamily: "Inter",
),
headline5: TextStyle(
headlineSmall: TextStyle(
color: textColor,
fontSize: 24,
fontWeight: FontWeight.w600,
fontFamily: "Inter",
),
// AG: Body
headline6: TextStyle(
titleLarge: TextStyle(
color: textColor,
fontSize: 18,
fontFamily: "Inter",
@ -92,31 +90,31 @@ TextTheme _buildTextTheme(Color textColor) {
height: 28,
),
subtitle1: TextStyle(
titleMedium: TextStyle(
color: textColor,
fontFamily: "Inter",
fontSize: 16,
fontWeight: FontWeight.w500,
),
subtitle2: TextStyle(
titleSmall: TextStyle(
color: textColor,
fontFamily: "Inter",
fontSize: 14,
fontWeight: FontWeight.w500,
),
bodyText1: TextStyle(
bodyLarge: TextStyle(
fontFamily: "Inter",
color: textColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
bodyText2: TextStyle(
bodyMedium: TextStyle(
fontFamily: "Inter",
color: textColor,
fontSize: 14,
fontWeight: FontWeight.w500,
),
caption: TextStyle(
bodySmall: TextStyle(
color: textColor.withOpacity(0.6),
fontSize: 14,
fontWeight: FontWeight.w500,

View file

@ -11,10 +11,6 @@ final lightThemeData = ThemeData(
iconTheme: const IconThemeData(color: Colors.black),
primaryIconTheme:
const IconThemeData(color: Colors.red, opacity: 1.0, size: 50.0),
colorScheme: const ColorScheme.light(
primary: Colors.black,
secondary: Color.fromARGB(255, 163, 163, 163),
),
outlinedButtonTheme: buildOutlinedButtonThemeData(
bgDisabled: const Color.fromRGBO(158, 158, 158, 1),
bgEnabled: const Color.fromRGBO(0, 0, 0, 1),
@ -25,9 +21,7 @@ final lightThemeData = ThemeData(
onPrimary: const Color.fromRGBO(255, 255, 255, 1),
primary: const Color.fromRGBO(0, 0, 0, 1),
),
toggleableActiveColor: const Color.fromRGBO(102, 187, 106, 1),
scaffoldBackgroundColor: const Color.fromRGBO(255, 255, 255, 1),
backgroundColor: const Color.fromRGBO(255, 255, 255, 1),
appBarTheme: const AppBarTheme().copyWith(
backgroundColor: Colors.white,
foregroundColor: Colors.black,
@ -37,8 +31,8 @@ final lightThemeData = ThemeData(
//https://api.flutter.dev/flutter/material/TextTheme-class.html
textTheme: _buildTextTheme(const Color.fromRGBO(0, 0, 0, 1)),
primaryTextTheme: const TextTheme().copyWith(
bodyText2: const TextStyle(color: Colors.yellow),
bodyText1: const TextStyle(color: Colors.orange),
bodyMedium: const TextStyle(color: Colors.yellow),
bodyLarge: const TextStyle(color: Colors.orange),
),
cardColor: const Color.fromRGBO(250, 250, 250, 1.0),
dialogTheme: const DialogTheme().copyWith(
@ -78,7 +72,27 @@ final lightThemeData = ThemeData(
? const Color.fromRGBO(255, 255, 255, 1)
: const Color.fromRGBO(0, 0, 0, 1);
}),
),
), radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) { return null; }
if (states.contains(MaterialState.selected)) { return const Color.fromRGBO(102, 187, 106, 1); }
return null;
}),
), switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) { return null; }
if (states.contains(MaterialState.selected)) { return const Color.fromRGBO(102, 187, 106, 1); }
return null;
}),
trackColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) { return null; }
if (states.contains(MaterialState.selected)) { return const Color.fromRGBO(102, 187, 106, 1); }
return null;
}),
), colorScheme: const ColorScheme.light(
primary: Colors.black,
secondary: Color.fromARGB(255, 163, 163, 163),
).copyWith(background: const Color.fromRGBO(255, 255, 255, 1)),
);
final darkThemeData = ThemeData(
@ -89,12 +103,10 @@ final darkThemeData = ThemeData(
primaryIconTheme:
const IconThemeData(color: Colors.red, opacity: 1.0, size: 50.0),
hintColor: const Color.fromRGBO(158, 158, 158, 1),
colorScheme: const ColorScheme.dark(primary: Colors.white),
buttonTheme: const ButtonThemeData().copyWith(
buttonColor: const Color.fromRGBO(45, 194, 98, 1.0),
),
textTheme: _buildTextTheme(const Color.fromRGBO(255, 255, 255, 1)),
toggleableActiveColor: const Color.fromRGBO(102, 187, 106, 1),
outlinedButtonTheme: buildOutlinedButtonThemeData(
bgDisabled: const Color.fromRGBO(158, 158, 158, 1),
bgEnabled: const Color.fromRGBO(255, 255, 255, 1),
@ -106,7 +118,6 @@ final darkThemeData = ThemeData(
primary: const Color.fromRGBO(255, 255, 255, 1),
),
scaffoldBackgroundColor: const Color.fromRGBO(0, 0, 0, 1),
backgroundColor: const Color.fromRGBO(0, 0, 0, 1),
appBarTheme: const AppBarTheme().copyWith(
color: Colors.black,
elevation: 0,
@ -153,59 +164,76 @@ final darkThemeData = ThemeData(
return const Color.fromRGBO(158, 158, 158, 1);
}
}),
),
), radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) { return null; }
if (states.contains(MaterialState.selected)) { return const Color.fromRGBO(102, 187, 106, 1); }
return null;
}),
), switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) { return null; }
if (states.contains(MaterialState.selected)) { return const Color.fromRGBO(102, 187, 106, 1); }
return null;
}),
trackColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) { return null; }
if (states.contains(MaterialState.selected)) { return const Color.fromRGBO(102, 187, 106, 1); }
return null;
}),
), colorScheme: const ColorScheme.dark(primary: Colors.white).copyWith(background: const Color.fromRGBO(0, 0, 0, 1)),
);
TextTheme _buildTextTheme(Color textColor) {
return const TextTheme().copyWith(
headline4: TextStyle(
headlineMedium: TextStyle(
color: textColor,
fontSize: 32,
fontWeight: FontWeight.w600,
fontFamily: 'Inter',
),
headline5: TextStyle(
headlineSmall: TextStyle(
color: textColor,
fontSize: 24,
fontWeight: FontWeight.w600,
fontFamily: 'Inter',
),
headline6: TextStyle(
titleLarge: TextStyle(
color: textColor,
fontSize: 18,
fontFamily: 'Inter',
fontWeight: FontWeight.w600,
),
subtitle1: TextStyle(
titleMedium: TextStyle(
color: textColor,
fontFamily: 'Inter',
fontSize: 16,
fontWeight: FontWeight.w500,
),
subtitle2: TextStyle(
titleSmall: TextStyle(
color: textColor,
fontFamily: 'Inter',
fontSize: 14,
fontWeight: FontWeight.w500,
),
bodyText1: TextStyle(
bodyLarge: TextStyle(
fontFamily: 'Inter',
color: textColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
bodyText2: TextStyle(
bodyMedium: TextStyle(
fontFamily: 'Inter',
color: textColor,
fontSize: 14,
fontWeight: FontWeight.w500,
),
caption: TextStyle(
bodySmall: TextStyle(
color: textColor.withOpacity(0.4),
fontSize: 10,
fontWeight: FontWeight.w500,
),
overline: TextStyle(
labelSmall: TextStyle(
fontFamily: 'Inter',
color: textColor,
fontSize: 14,
@ -408,9 +436,7 @@ ElevatedButtonThemeData buildElevatedButtonThemeData({
}) {
return ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
elevation: elevation,
onPrimary: onPrimary,
primary: primary,
foregroundColor: onPrimary, backgroundColor: primary, elevation: elevation,
alignment: Alignment.center,
textStyle: const TextStyle(
fontWeight: FontWeight.w600,

View file

@ -85,6 +85,7 @@
"importSelectJsonFile": "Выбрать JSON-файл",
"importEnteEncGuide": "Выберите зашифрованный JSON-файл, экспортированный из ente",
"importRaivoGuide": "Используйте опцию «Export OTPs to Zip archive» в настройках Raivo.\n\nРаспакуйте zip-архив и импортируйте JSON-файл.",
"importAegisGuide": "Используйте опцию «Экспортировать хранилище» в настройках Aegis.\n\nЕсли ваше хранилище зашифровано, то для его расшифровки потребуется ввести пароль хранилища.",
"exportCodes": "Экспортировать коды",
"importLabel": "Импорт",
"importInstruction": "Пожалуйста, выберите файл, содержащий список ваших кодов в следующем формате",

View file

@ -164,7 +164,7 @@
"close": "Kapat",
"oopsSomethingWentWrong": "Hay aksi, bir sorun oluştu.",
"selectLanguage": "Dil Seçin",
"language": "Language",
"language": "Dil",
"social": "Sosyal Medya",
"security": "Güvenlik",
"lockscreen": "Kilit ekranı",

View file

@ -85,6 +85,7 @@
"importSelectJsonFile": "选择 JSON 文件",
"importEnteEncGuide": "选择从ente导出的加密JSON文件",
"importRaivoGuide": "使用 Raivo 设置中的“将 OTP 导出到 Zip 存档”选项。\n\n解压 zip 文件并导入 JSON 文件。",
"importAegisGuide": "在Aegis的设置中使用\"导出密码库\"选项。\n\n如果您的密码库已加密您需要输入密码才能解密密码库。",
"exportCodes": "导出代码",
"importLabel": "导入",
"importInstruction": "请以以下格式选择包含代码列表的文件",

View file

@ -14,6 +14,7 @@ import 'dart:core' as $core;
import 'package:fixnum/fixnum.dart' as $fixnum;
import 'package:protobuf/protobuf.dart' as $pb;
// ignore: always_use_package_imports
import 'googleauth.pbenum.dart';
export 'googleauth.pbenum.dart';

View file

@ -104,17 +104,18 @@ class _OnboardingPageState extends State<OnboardingPage> {
const SizedBox(height: 4),
Text(
"Authenticator",
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
const SizedBox(height: 32),
Text(
l10n.onBoardingBody,
textAlign: TextAlign.center,
style:
Theme.of(context).textTheme.headline6!.copyWith(
color: Theme.of(context)
.colorScheme
.mutedTextColor,
Theme.of(context).textTheme.titleLarge!.copyWith(
color: Colors.white38,
// color: Theme.of(context)
// .colorScheme
// .mutedTextColor,
),
),
],

View file

@ -10,30 +10,27 @@ class SetupEnterSecretKeyPage extends StatefulWidget {
SetupEnterSecretKeyPage({this.code, Key? key}) : super(key: key);
@override
State<SetupEnterSecretKeyPage> createState() =>
_SetupEnterSecretKeyPageState();
State<SetupEnterSecretKeyPage> createState() => _SetupEnterSecretKeyPageState();
}
class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
late TextEditingController _issuerController;
late TextEditingController _accountController;
late TextEditingController _secretController;
late bool _secretKeyObscured;
@override
void initState() {
_issuerController = TextEditingController(
text: widget.code != null
? safeDecode(widget.code!.issuer).trim()
: null,
text: widget.code != null ? safeDecode(widget.code!.issuer).trim() : null,
);
_accountController = TextEditingController(
text: widget.code != null
? safeDecode(widget.code!.account).trim()
: null,
text: widget.code != null ? safeDecode(widget.code!.account).trim() : null,
);
_secretController = TextEditingController(
text: widget.code != null ? widget.code!.secret : null,
);
_secretKeyObscured = widget.code != null;
super.initState();
}
@ -77,7 +74,18 @@ class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
},
decoration: InputDecoration(
hintText: l10n.codeSecretKeyHint,
suffixIcon: IconButton(
onPressed: () {
setState(() {
_secretKeyObscured = !_secretKeyObscured;
});
},
icon: _secretKeyObscured
? const Icon(Icons.visibility_off_rounded)
: const Icon(Icons.visibility_rounded),
),
),
obscureText: _secretKeyObscured,
controller: _secretController,
),
const SizedBox(
@ -118,8 +126,7 @@ class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
try {
final account = _accountController.text.trim();
final issuer = _issuerController.text.trim();
final secret =
_secretController.text.trim().replaceAll(' ', '');
final secret = _secretController.text.trim().replaceAll(' ', '');
final Code newCode = widget.code == null
? Code.fromAccountAndSecret(
account,

View file

@ -902,7 +902,7 @@ class UserService {
}
bool? canDisableEmailMFA() {
return _preferences.getBool(kCanDisableEmailMFA);;
return _preferences.getBool(kCanDisableEmailMFA);
}
bool hasEmailMFAEnabled() {
return _preferences.getBool(kIsEmailMFAEnabled) ?? true;

View file

@ -48,7 +48,7 @@ class DeleteAccountPage extends StatelessWidget {
Center(
child: Text(
l10n.deleteAccountQuery,
style: Theme.of(context).textTheme.subtitle1,
style: Theme.of(context).textTheme.titleMedium,
),
),
const SizedBox(
@ -67,7 +67,7 @@ class DeleteAccountPage extends StatelessWidget {
text: ", maybe there is a way we can help.",
),
],
style: Theme.of(context).textTheme.subtitle1,
style: Theme.of(context).textTheme.titleMedium,
),
),
const SizedBox(

View file

@ -135,13 +135,13 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
child: Text(
context.l10n.createNewAccount,
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
child: TextFormField(
style: Theme.of(context).textTheme.subtitle1,
style: Theme.of(context).textTheme.titleMedium,
autofillHints: const [AutofillHints.email],
decoration: InputDecoration(
fillColor: _emailIsValid ? _validFieldValueColor : null,
@ -372,11 +372,10 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
child: StyledText(
text: context.l10n.signUpTerms,
style:
Theme.of(context).textTheme.subtitle1!.copyWith(fontSize: 12),
Theme.of(context).textTheme.titleMedium!.copyWith(fontSize: 12),
tags: {
'u-terms': StyledTextActionTag(
(String? text, Map<String?, String?> attrs) => {
Navigator.of(context).push(
(String? text, Map<String?, String?> attrs) => Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return WebPage(
@ -385,15 +384,13 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
);
},
),
)
},
),
style: const TextStyle(
decoration: TextDecoration.underline,
),
),
'u-policy': StyledTextActionTag(
(String? text, Map<String?, String?> attrs) => {
Navigator.of(context).push(
(String? text, Map<String?, String?> attrs) => Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return WebPage(
@ -402,8 +399,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
);
},
),
)
},
),
style: const TextStyle(
decoration: TextDecoration.underline,
),
@ -439,11 +435,10 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
child: StyledText(
text: context.l10n.ackPasswordLostWarning,
style:
Theme.of(context).textTheme.subtitle1!.copyWith(fontSize: 12),
Theme.of(context).textTheme.titleMedium!.copyWith(fontSize: 12),
tags: {
'underline': StyledTextActionTag(
(String? text, Map<String?, String?> attrs) => {
Navigator.of(context).push(
(String? text, Map<String?, String?> attrs) => Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return WebPage(
@ -452,8 +447,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
);
},
),
)
},
),
style: const TextStyle(
decoration: TextDecoration.underline,
),

View file

@ -107,7 +107,7 @@ class _LoginPageState extends State<LoginPage> {
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
child: Text(
l10n.welcomeBack,
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
),
Padding(
@ -172,12 +172,11 @@ class _LoginPageState extends State<LoginPage> {
text: context.l10n.loginTerms,
style: Theme.of(context)
.textTheme
.subtitle1!
.titleMedium!
.copyWith(fontSize: 12),
tags: {
'u-terms': StyledTextActionTag(
(String? text, Map<String?, String?> attrs) => {
Navigator.of(context).push(
(String? text, Map<String?, String?> attrs) => Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return WebPage(
@ -186,15 +185,13 @@ class _LoginPageState extends State<LoginPage> {
);
},
),
)
},
),
style: const TextStyle(
decoration: TextDecoration.underline,
),
),
'u-policy': StyledTextActionTag(
(String? text, Map<String?, String?> attrs) => {
Navigator.of(context).push(
(String? text, Map<String?, String?> attrs) => Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return WebPage(
@ -203,8 +200,7 @@ class _LoginPageState extends State<LoginPage> {
);
},
),
)
},
),
style: const TextStyle(
decoration: TextDecoration.underline,
),

View file

@ -68,8 +68,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
body: _getBody(),
floatingActionButton: DynamicFAB(
isKeypadOpen: isKeypadOpen,
isFormValid: !(_verificationCodeController.text == null ||
_verificationCodeController.text.isEmpty),
isFormValid: !(_verificationCodeController.text.isEmpty),
buttonText: l10n.verify,
onPressedFunction: () {
if (widget.isChangeEmail) {
@ -102,7 +101,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
padding: const EdgeInsets.fromLTRB(20, 30, 20, 15),
child: Text(
l10n.verifyEmail,
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
),
Padding(
@ -119,7 +118,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
text: l10n.weHaveSendEmailTo(widget.email),
style: Theme.of(context)
.textTheme
.subtitle1!
.titleMedium!
.copyWith(fontSize: 14),
tags: {
'green': StyledTextTag(
@ -144,7 +143,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
l10n.checkInboxAndSpamFolder,
style: Theme.of(context)
.textTheme
.subtitle1!
.titleMedium!
.copyWith(fontSize: 14),
),
],
@ -160,7 +159,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
Padding(
padding: const EdgeInsets.fromLTRB(20, 16, 20, 16),
child: TextFormField(
style: Theme.of(context).textTheme.subtitle1,
style: Theme.of(context).textTheme.titleMedium,
decoration: InputDecoration(
filled: true,
hintText: l10n.tapToEnterCode,
@ -199,7 +198,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
},
child: Text(
l10n.resendEmail,
style: Theme.of(context).textTheme.subtitle1!.copyWith(
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontSize: 14,
decoration: TextDecoration.underline,
),

View file

@ -153,7 +153,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
child: Text(
buttonTextAndHeading,
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
),
Padding(
@ -165,7 +165,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
textAlign: TextAlign.start,
style: Theme.of(context)
.textTheme
.subtitle1!
.titleMedium!
.copyWith(fontSize: 14),
),
),
@ -176,11 +176,11 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
text: context.l10n.passwordWarning,
style: Theme.of(context)
.textTheme
.subtitle1!
.titleMedium!
.copyWith(fontSize: 14),
tags: {
'underline': StyledTextTag(
style: Theme.of(context).textTheme.subtitle1!.copyWith(
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontSize: 14,
decoration: TextDecoration.underline,
),
@ -356,7 +356,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
child: RichText(
text: TextSpan(
text: context.l10n.howItWorks,
style: Theme.of(context).textTheme.subtitle1!.copyWith(
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontSize: 14,
decoration: TextDecoration.underline,
),

View file

@ -103,14 +103,14 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
? const SizedBox.shrink()
: Text(
widget.title ?? context.l10n.recoveryKey,
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
Padding(
padding: EdgeInsets.all(widget.showAppBar! ? 0 : 12),
),
Text(
widget.text ?? context.l10n.recoveryKeyOnForgotPassword,
style: Theme.of(context).textTheme.subtitle1,
style: Theme.of(context).textTheme.titleMedium,
),
const Padding(padding: EdgeInsets.only(top: 24)),
DottedBorder(
@ -164,7 +164,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
child: Text(
recoveryKey,
style:
Theme.of(context).textTheme.bodyText1,
Theme.of(context).textTheme.bodyLarge,
),
),
),
@ -177,7 +177,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
child: Text(
widget.subText ??
context.l10n.recoveryKeySaveDescription,
style: Theme.of(context).textTheme.bodyText1,
style: Theme.of(context).textTheme.bodyLarge,
),
),
Expanded(

View file

@ -88,7 +88,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
child: Text(
'Forgot password',
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
),
Padding(
@ -140,7 +140,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
child: Text(
"No recovery key?",
style:
Theme.of(context).textTheme.subtitle1!.copyWith(
Theme.of(context).textTheme.titleMedium!.copyWith(
fontSize: 14,
decoration: TextDecoration.underline,
),

View file

@ -162,7 +162,7 @@ class _SessionsPageState extends State<SessionsPage> {
const Padding(padding: EdgeInsets.all(8)),
Text(
session.ua,
style: Theme.of(context).textTheme.caption,
style: Theme.of(context).textTheme.bodySmall,
),
],
),

View file

@ -156,14 +156,14 @@ class _CodeWidgetState extends State<CodeWidget> {
children: [
Text(
safeDecode(widget.code.issuer).trim(),
style: Theme.of(context).textTheme.headline6,
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(height: 2),
Text(
safeDecode(widget.code.account).trim(),
style: Theme.of(context)
.textTheme
.caption
.bodySmall
?.copyWith(
fontSize: 12,
color: Colors.grey,
@ -216,7 +216,7 @@ class _CodeWidgetState extends State<CodeWidget> {
Text(
l10n.nextTotpTitle,
style:
Theme.of(context).textTheme.caption,
Theme.of(context).textTheme.bodySmall,
),
ValueListenableBuilder<String>(
valueListenable: _nextCode,
@ -238,7 +238,7 @@ class _CodeWidgetState extends State<CodeWidget> {
Text(
l10n.nextTotpTitle,
style:
Theme.of(context).textTheme.caption,
Theme.of(context).textTheme.bodySmall,
),
InkWell(
onTap: _onNextHotpTapped,

View file

@ -16,7 +16,7 @@ class BottomShadowWidget extends StatelessWidget {
color: Colors.transparent,
boxShadow: [
BoxShadow(
color: shadowColor ?? Theme.of(context).backgroundColor,
color: shadowColor ?? Theme.of(context).colorScheme.background,
spreadRadius: 42,
blurRadius: 42,
offset: Offset(0, offsetDy), // changes position of shadow

View file

@ -26,7 +26,7 @@ class DynamicFAB extends StatelessWidget {
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Theme.of(context).backgroundColor,
color: Theme.of(context).colorScheme.background,
spreadRadius: 200,
blurRadius: 100,
offset: const Offset(0, 230),

View file

@ -6,10 +6,10 @@ PopupMenuButton<dynamic> reportBugPopupMenu(BuildContext context) {
itemBuilder: (context) {
final List<PopupMenuItem> items = [];
items.add(
PopupMenuItem(
const PopupMenuItem(
value: 1,
child: Row(
children: const [
children: [
Text("Contact support"),
],
),

View file

@ -41,7 +41,7 @@ class CoachMarkWidget extends StatelessWidget {
),
Text(
l10n.swipeHint,
style: Theme.of(context).textTheme.headline6,
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(
height: 36,

View file

@ -36,7 +36,7 @@ class HomeEmptyStateWidget extends StatelessWidget {
Text(
l10n.setupFirstAccount,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
const SizedBox(height: 64),
SizedBox(

View file

@ -248,7 +248,7 @@ class _HomePageState extends State<HomePage> {
Code? code;
try {
code = _filteredCodes[index];
return CodeWidget(code!);
return CodeWidget(code);
} catch (e, s) {
_logger.severe("code widget error", e, s);
return Center(

View file

@ -27,7 +27,7 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
padding: const EdgeInsets.fromLTRB(8, 4, 0, 4),
child: Text(
"- " + log,
style: Theme.of(context).textTheme.caption!.copyWith(
style: Theme.of(context).textTheme.bodySmall!.copyWith(
fontSize: 14,
),
),
@ -65,7 +65,7 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
style: Theme.of(context).outlinedButtonTheme.style!.copyWith(
textStyle: MaterialStateProperty.resolveWith<TextStyle?>(
(Set<MaterialState> states) {
return Theme.of(context).textTheme.subtitle1;
return Theme.of(context).textTheme.titleMedium;
},
),
),

View file

@ -49,7 +49,7 @@ class _AppVersionWidgetState extends State<AppVersionWidget> {
padding: const EdgeInsets.all(20),
child: Text(
"Version: " + snapshot.data!,
style: Theme.of(context).textTheme.caption,
style: Theme.of(context).textTheme.bodySmall,
),
);
}

View file

@ -13,7 +13,6 @@ import 'package:ente_auth/ui/components/models/button_type.dart';
import 'package:ente_auth/ui/scanner_gauth_page.dart';
import 'package:ente_auth/ui/settings/data/import/import_success.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:logging/logging.dart';
const kGoogleAuthExportPrefix = 'otpauth-migration://offline?data=';

View file

@ -10,7 +10,6 @@ import 'package:ente_auth/store/code_store.dart';
import 'package:ente_auth/ui/settings/data/import/import_success.dart';
import 'package:ente_auth/utils/dialog_util.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
@ -59,7 +58,7 @@ Future<void> showImportInstructionDialog(BuildContext context) async {
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
title: Text(
l10n.importCodes,
style: Theme.of(context).textTheme.headline6,
style: Theme.of(context).textTheme.titleLarge,
),
content: const SingleChildScrollView(
child: PlainTextImport(),

View file

@ -7,7 +7,6 @@ import 'package:ente_auth/ui/components/menu_item_widget.dart';
import 'package:ente_auth/ui/components/title_bar_title_widget.dart';
import 'package:ente_auth/ui/components/title_bar_widget.dart';
import 'package:ente_auth/ui/settings/data/import/import_service.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
enum ImportType {

View file

@ -24,9 +24,9 @@ class SettingsSectionTitle extends StatelessWidget {
style: color != null
? Theme.of(context)
.textTheme
.headline6!
.titleLarge!
.merge(TextStyle(color: color))
: Theme.of(context).textTheme.headline6,
: Theme.of(context).textTheme.titleLarge,
),
),
const Padding(padding: EdgeInsets.all(4)),

View file

@ -23,7 +23,7 @@ class SettingsTextItem extends StatelessWidget {
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(text, style: Theme.of(context).textTheme.subtitle1),
child: Text(text, style: Theme.of(context).textTheme.titleMedium),
),
Icon(icon),
],

View file

@ -65,6 +65,6 @@ class IconUtils {
}
String _getProviderTitle(String provider) {
return provider.split(".")[0].toLowerCase();
return provider.split(RegExp(r'[.(]'))[0].trim().toLowerCase();
}
}

View file

@ -201,8 +201,8 @@ Widget getDayWidget(
child: Text(
getDayTitle(timestamp),
style: (getDayTitle(timestamp) == "Today" && !smallerTodayFont)
? Theme.of(context).textTheme.headline5
: Theme.of(context).textTheme.caption?.copyWith(
? Theme.of(context).textTheme.headlineSmall
: Theme.of(context).textTheme.bodySmall?.copyWith(
fontSize: 16,
fontWeight: FontWeight.w600,
fontFamily: 'Inter-SemiBold',

View file

@ -224,7 +224,7 @@ ProgressDialog createProgressDialog(
);
dialog.style(
message: message,
messageTextStyle: Theme.of(context).textTheme.caption,
messageTextStyle: Theme.of(context).textTheme.bodySmall,
backgroundColor: Theme.of(context).dialogTheme.backgroundColor,
progressWidget: const EnteLoadingWidget(),
borderRadius: 10,

View file

@ -229,7 +229,7 @@ Future<void> sendEmail(
final Uri params = Uri(
scheme: 'mailto',
path: to,
query: 'subject=$_subject&body=${_body}',
query: 'subject=$_subject&body=$_body',
);
if (await canLaunchUrl(params)) {
await launchUrl(params);

View file

@ -1,6 +1,6 @@
name: ente_auth
description: ente two-factor authenticator
version: 1.0.55+55
version: 1.0.56+56
publish_to: none
environment: