Compare commits
7 Commits
meta_files
...
optimize-w
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29c67bd5dd | ||
|
|
da15842597 | ||
|
|
eb959046cd | ||
|
|
1178ae26d0 | ||
|
|
4a2f5b4676 | ||
|
|
0fece5666b | ||
|
|
26e564aec2 |
@@ -76,7 +76,8 @@ class _EmergencyPageState extends State<EmergencyPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final currentUserID = Configuration.instance.getUserID()!;
|
||||
final List<EmergencyContact> othersTrustedContacts =
|
||||
info?.othersEmergencyContact ?? [];
|
||||
@@ -180,7 +181,7 @@ class _EmergencyPageState extends State<EmergencyPage> {
|
||||
currentUserID: currentUserID,
|
||||
),
|
||||
menuItemColor:
|
||||
getEnteColorScheme(context).fillFaint,
|
||||
EnteTheme.getColorScheme(theme).fillFaint,
|
||||
trailingIcon: Icons.chevron_right,
|
||||
trailingIconIsMuted: true,
|
||||
onTap: () async {
|
||||
@@ -192,7 +193,7 @@ class _EmergencyPageState extends State<EmergencyPage> {
|
||||
),
|
||||
DividerWidget(
|
||||
dividerType: DividerType.menu,
|
||||
bgColor: getEnteColorScheme(context).fillFaint,
|
||||
bgColor: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -203,13 +204,13 @@ class _EmergencyPageState extends State<EmergencyPage> {
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
context.l10n.legacyPageDesc,
|
||||
style: getEnteTextTheme(context).body,
|
||||
style: EnteTheme.getTextTheme(theme).body,
|
||||
),
|
||||
SizedBox(
|
||||
height: 200,
|
||||
width: 200,
|
||||
child: SvgPicture.asset(
|
||||
getEnteColorScheme(context).backdropBase ==
|
||||
EnteTheme.getColorScheme(theme).backdropBase ==
|
||||
backgroundBaseDark
|
||||
? "assets/icons/legacy-light.svg"
|
||||
: "assets/icons/legacy-dark.svg",
|
||||
@@ -219,7 +220,7 @@ class _EmergencyPageState extends State<EmergencyPage> {
|
||||
),
|
||||
Text(
|
||||
context.l10n.legacyPageDesc2,
|
||||
style: getEnteTextTheme(context).smallMuted,
|
||||
style: EnteTheme.getTextTheme(theme).smallMuted,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
ButtonWidget(
|
||||
@@ -248,7 +249,8 @@ class _EmergencyPageState extends State<EmergencyPage> {
|
||||
),
|
||||
leadingIcon: Icons.add_outlined,
|
||||
surfaceExecutionStates: false,
|
||||
menuItemColor: getEnteColorScheme(context).fillFaint,
|
||||
menuItemColor:
|
||||
EnteTheme.getColorScheme(theme).fillFaint,
|
||||
onTap: () async {
|
||||
await routeToPage(
|
||||
context,
|
||||
@@ -308,7 +310,7 @@ class _EmergencyPageState extends State<EmergencyPage> {
|
||||
currentUserID: currentUserID,
|
||||
),
|
||||
menuItemColor:
|
||||
getEnteColorScheme(context).fillFaint,
|
||||
EnteTheme.getColorScheme(theme).fillFaint,
|
||||
trailingIcon: Icons.chevron_right,
|
||||
trailingIconIsMuted: true,
|
||||
onTap: () async {
|
||||
@@ -351,7 +353,7 @@ class _EmergencyPageState extends State<EmergencyPage> {
|
||||
: DividerWidget(
|
||||
dividerType: DividerType.menu,
|
||||
bgColor:
|
||||
getEnteColorScheme(context).fillFaint,
|
||||
EnteTheme.getColorScheme(theme).fillFaint,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -79,8 +79,9 @@ class _OtherContactPageState extends State<OtherContactPage> {
|
||||
);
|
||||
waitTill = getFormattedTime(context, dateTime);
|
||||
}
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
body: Padding(
|
||||
@@ -229,7 +230,7 @@ class _OtherContactPageState extends State<OtherContactPage> {
|
||||
),
|
||||
leadingIcon: Icons.not_interested_outlined,
|
||||
leadingIconColor: warning500,
|
||||
menuItemColor: getEnteColorScheme(context).fillFaint,
|
||||
menuItemColor: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
surfaceExecutionStates: false,
|
||||
onTap: () async {
|
||||
await showRemoveSheet();
|
||||
|
||||
@@ -80,12 +80,13 @@ class _RecoverOthersAccountState extends State<RecoverOthersAccount> {
|
||||
|
||||
String title = AppLocalizations.of(context).setPasswordTitle;
|
||||
title = AppLocalizations.of(context).resetPasswordTitle;
|
||||
final theme = Theme.of(context);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: isKeypadOpen,
|
||||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
@@ -118,6 +119,7 @@ class _RecoverOthersAccountState extends State<RecoverOthersAccount> {
|
||||
passwordStrengthText = AppLocalizations.of(context).moderateStrength;
|
||||
passwordStrengthColor = Colors.orangeAccent;
|
||||
}
|
||||
final theme = Theme.of(context);
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -129,7 +131,7 @@ class _RecoverOthersAccountState extends State<RecoverOthersAccount> {
|
||||
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
|
||||
child: Text(
|
||||
buttonTextAndHeading,
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
style: theme.textTheme.headlineMedium,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -138,10 +140,7 @@ class _RecoverOthersAccountState extends State<RecoverOthersAccount> {
|
||||
"Enter new password for $email account. You will be able "
|
||||
"to use this password to login into $email account.",
|
||||
textAlign: TextAlign.start,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
.copyWith(fontSize: 14),
|
||||
style: theme.textTheme.titleMedium!.copyWith(fontSize: 14),
|
||||
),
|
||||
),
|
||||
const Padding(padding: EdgeInsets.all(12)),
|
||||
@@ -179,7 +178,7 @@ class _RecoverOthersAccountState extends State<RecoverOthersAccount> {
|
||||
_password1Visible
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
size: 20,
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -191,11 +190,8 @@ class _RecoverOthersAccountState extends State<RecoverOthersAccount> {
|
||||
: _isPasswordValid
|
||||
? Icon(
|
||||
Icons.check,
|
||||
color: Theme.of(context)
|
||||
.inputDecorationTheme
|
||||
.focusedBorder!
|
||||
.borderSide
|
||||
.color,
|
||||
color: theme.inputDecorationTheme
|
||||
.focusedBorder!.borderSide.color,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
@@ -241,7 +237,7 @@ class _RecoverOthersAccountState extends State<RecoverOthersAccount> {
|
||||
_password2Visible
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
size: 20,
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -253,11 +249,8 @@ class _RecoverOthersAccountState extends State<RecoverOthersAccount> {
|
||||
: _passwordsMatch
|
||||
? Icon(
|
||||
Icons.check,
|
||||
color: Theme.of(context)
|
||||
.inputDecorationTheme
|
||||
.focusedBorder!
|
||||
.borderSide
|
||||
.color,
|
||||
color: theme.inputDecorationTheme
|
||||
.focusedBorder!.borderSide.color,
|
||||
)
|
||||
: null,
|
||||
border: UnderlineInputBorder(
|
||||
|
||||
@@ -58,8 +58,9 @@ class _AddContactPage extends State<AddContactPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
|
||||
final enteTextTheme = getEnteTextTheme(context);
|
||||
final enteColorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final enteTextTheme = EnteTheme.getTextTheme(theme);
|
||||
final enteColorScheme = EnteTheme.getColorScheme(theme);
|
||||
final List<User> suggestedUsers = _getSuggestedUser();
|
||||
isEmailListEmpty = suggestedUsers.isEmpty;
|
||||
return Scaffold(
|
||||
@@ -85,7 +86,7 @@ class _AddContactPage extends State<AddContactPage> {
|
||||
const SizedBox(height: 4),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: _getEmailField(),
|
||||
child: _getEmailField(theme),
|
||||
),
|
||||
if (isEmailListEmpty)
|
||||
const Expanded(child: SizedBox.shrink())
|
||||
@@ -128,9 +129,9 @@ class _AddContactPage extends State<AddContactPage> {
|
||||
type: AvatarType.mini,
|
||||
),
|
||||
menuItemColor:
|
||||
getEnteColorScheme(context).fillFaint,
|
||||
EnteTheme.getColorScheme(theme).fillFaint,
|
||||
pressedColor:
|
||||
getEnteColorScheme(context).fillFaint,
|
||||
EnteTheme.getColorScheme(theme).fillFaint,
|
||||
trailingIcon:
|
||||
(selectedEmail == currentUser.email)
|
||||
? Icons.check
|
||||
@@ -152,8 +153,8 @@ class _AddContactPage extends State<AddContactPage> {
|
||||
? const SizedBox.shrink()
|
||||
: DividerWidget(
|
||||
dividerType: DividerType.menu,
|
||||
bgColor:
|
||||
getEnteColorScheme(context).fillFaint,
|
||||
bgColor: EnteTheme.getColorScheme(theme)
|
||||
.fillFaint,
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -269,19 +270,19 @@ class _AddContactPage extends State<AddContactPage> {
|
||||
setState(() => {});
|
||||
}
|
||||
|
||||
Widget _getEmailField() {
|
||||
Widget _getEmailField(ThemeData theme) {
|
||||
return TextFormField(
|
||||
controller: _textController,
|
||||
focusNode: textFieldFocusNode,
|
||||
style: getEnteTextTheme(context).body,
|
||||
style: EnteTheme.getTextTheme(theme).body,
|
||||
autofillHints: const [AutofillHints.email],
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(4.0)),
|
||||
borderSide:
|
||||
BorderSide(color: getEnteColorScheme(context).strokeMuted),
|
||||
BorderSide(color: EnteTheme.getColorScheme(theme).strokeMuted),
|
||||
),
|
||||
fillColor: getEnteColorScheme(context).fillFaint,
|
||||
fillColor: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
filled: true,
|
||||
hintText: AppLocalizations.of(context).enterEmail,
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
@@ -294,7 +295,7 @@ class _AddContactPage extends State<AddContactPage> {
|
||||
),
|
||||
prefixIcon: Icon(
|
||||
Icons.email_outlined,
|
||||
color: getEnteColorScheme(context).strokeMuted,
|
||||
color: EnteTheme.getColorScheme(theme).strokeMuted,
|
||||
),
|
||||
suffixIcon: _email == ''
|
||||
? null
|
||||
@@ -302,7 +303,7 @@ class _AddContactPage extends State<AddContactPage> {
|
||||
onPressed: clearFocus,
|
||||
icon: Icon(
|
||||
Icons.cancel,
|
||||
color: getEnteColorScheme(context).strokeMuted,
|
||||
color: EnteTheme.getColorScheme(theme).strokeMuted,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -19,8 +19,26 @@ class EnteTheme {
|
||||
required this.shadowButton,
|
||||
});
|
||||
|
||||
static bool isDark(BuildContext context) {
|
||||
return Theme.of(context).brightness == Brightness.dark;
|
||||
static bool isDark(ThemeData theme) {
|
||||
return theme.brightness == Brightness.dark;
|
||||
}
|
||||
|
||||
static EnteColorScheme getColorScheme(
|
||||
ThemeData theme, {
|
||||
bool inverse = false,
|
||||
}) {
|
||||
return inverse
|
||||
? theme.colorScheme.inverseEnteTheme.colorScheme
|
||||
: theme.colorScheme.enteTheme.colorScheme;
|
||||
}
|
||||
|
||||
static EnteTextTheme getTextTheme(
|
||||
ThemeData theme, {
|
||||
bool inverse = false,
|
||||
}) {
|
||||
return inverse
|
||||
? theme.colorScheme.inverseEnteTheme.textTheme
|
||||
: theme.colorScheme.enteTheme.textTheme;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +58,7 @@ EnteTheme darkTheme = EnteTheme(
|
||||
shadowButton: shadowButtonDark,
|
||||
);
|
||||
|
||||
@Deprecated('Use EnteTheme.getColorScheme instead')
|
||||
EnteColorScheme getEnteColorScheme(
|
||||
BuildContext context, {
|
||||
bool inverse = false,
|
||||
@@ -49,6 +68,7 @@ EnteColorScheme getEnteColorScheme(
|
||||
: Theme.of(context).colorScheme.enteTheme.colorScheme;
|
||||
}
|
||||
|
||||
@Deprecated('Use EnteTheme.getTextTheme instead')
|
||||
EnteTextTheme getEnteTextTheme(
|
||||
BuildContext context, {
|
||||
bool inverse = false,
|
||||
|
||||
@@ -43,14 +43,15 @@ class _DeleteAccountPageState extends State<DeleteAccountPage> {
|
||||
_dropdownValue ??= _defaultSelection;
|
||||
final double dropDownTextSize = MediaQuery.of(context).size.width - 120;
|
||||
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
title: Text(AppLocalizations.of(context).deleteAccount),
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
@@ -68,7 +69,7 @@ class _DeleteAccountPageState extends State<DeleteAccountPage> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).askDeleteReason,
|
||||
style: getEnteTextTheme(context).body,
|
||||
style: EnteTheme.getTextTheme(theme).body,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -98,7 +99,7 @@ class _DeleteAccountPageState extends State<DeleteAccountPage> {
|
||||
width: dropDownTextSize,
|
||||
child: Text(
|
||||
value,
|
||||
style: getEnteTextTheme(context).smallMuted,
|
||||
style: EnteTheme.getTextTheme(theme).smallMuted,
|
||||
overflow: TextOverflow.visible,
|
||||
),
|
||||
),
|
||||
@@ -111,12 +112,12 @@ class _DeleteAccountPageState extends State<DeleteAccountPage> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).deleteAccountFeedbackPrompt,
|
||||
style: getEnteTextTheme(context).body,
|
||||
style: EnteTheme.getTextTheme(theme).body,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
TextFormField(
|
||||
style: getEnteTextTheme(context).smallMuted,
|
||||
style: EnteTheme.getTextTheme(theme).smallMuted,
|
||||
decoration: InputDecoration(
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide:
|
||||
@@ -155,7 +156,7 @@ class _DeleteAccountPageState extends State<DeleteAccountPage> {
|
||||
child: Text(
|
||||
AppLocalizations.of(context)
|
||||
.kindlyHelpUsWithThisInformation,
|
||||
style: getEnteTextTheme(context)
|
||||
style: EnteTheme.getTextTheme(theme)
|
||||
.smallBold
|
||||
.copyWith(color: colorScheme.warning700),
|
||||
),
|
||||
@@ -174,7 +175,7 @@ class _DeleteAccountPageState extends State<DeleteAccountPage> {
|
||||
children: [
|
||||
Checkbox(
|
||||
value: _hasConfirmedDeletion,
|
||||
side: CheckboxTheme.of(context).side,
|
||||
side: theme.checkboxTheme.side,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_hasConfirmedDeletion = value!;
|
||||
@@ -186,7 +187,7 @@ class _DeleteAccountPageState extends State<DeleteAccountPage> {
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).confirmDeletePrompt,
|
||||
style: getEnteTextTheme(context).bodyMuted,
|
||||
style: EnteTheme.getTextTheme(theme).bodyMuted,
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -74,6 +74,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
|
||||
final theme = Theme.of(context);
|
||||
|
||||
FloatingActionButtonLocation? fabLocation() {
|
||||
if (isKeypadOpen) {
|
||||
@@ -87,7 +88,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
@@ -97,17 +98,16 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
child: StepProgressIndicator(
|
||||
totalSteps: 4,
|
||||
currentStep: 1,
|
||||
selectedColor: Theme.of(context).colorScheme.greenAlternative,
|
||||
selectedColor: theme.colorScheme.greenAlternative,
|
||||
roundedEdges: const Radius.circular(10),
|
||||
unselectedColor:
|
||||
Theme.of(context).colorScheme.stepProgressUnselectedColor,
|
||||
unselectedColor: theme.colorScheme.stepProgressUnselectedColor,
|
||||
),
|
||||
),
|
||||
);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: isKeypadOpen,
|
||||
appBar: appBar,
|
||||
body: _getBody(),
|
||||
body: _getBody(theme),
|
||||
floatingActionButton: DynamicFAB(
|
||||
isKeypadOpen: isKeypadOpen,
|
||||
isFormValid: _isFormValid(),
|
||||
@@ -130,7 +130,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getBody() {
|
||||
Widget _getBody(ThemeData theme) {
|
||||
var passwordStrengthText = AppLocalizations.of(context).weakStrength;
|
||||
var passwordStrengthColor = Colors.redAccent;
|
||||
if (_passwordStrength > kStrongPasswordStrengthThreshold) {
|
||||
@@ -151,18 +151,18 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).createNewAccount,
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
style: theme.textTheme.headlineMedium,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
|
||||
child: TextFormField(
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: theme.textTheme.titleMedium,
|
||||
autofillHints: const [AutofillHints.email],
|
||||
decoration: InputDecoration(
|
||||
fillColor: _emailIsValid
|
||||
? _validFieldValueColor
|
||||
: getEnteColorScheme(context).fillFaint,
|
||||
: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
filled: true,
|
||||
hintText: AppLocalizations.of(context).email,
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
@@ -176,11 +176,8 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
suffixIcon: _emailIsValid
|
||||
? Icon(
|
||||
Icons.check,
|
||||
color: Theme.of(context)
|
||||
.inputDecorationTheme
|
||||
.focusedBorder!
|
||||
.borderSide
|
||||
.color,
|
||||
color: theme.inputDecorationTheme.focusedBorder!
|
||||
.borderSide.color,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
@@ -210,7 +207,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
decoration: InputDecoration(
|
||||
fillColor: _passwordIsValid
|
||||
? _validFieldValueColor
|
||||
: getEnteColorScheme(context).fillFaint,
|
||||
: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
filled: true,
|
||||
hintText: AppLocalizations.of(context).password,
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
@@ -223,7 +220,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
_password1Visible
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
size: 20,
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -235,11 +232,8 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
: _passwordIsValid
|
||||
? Icon(
|
||||
Icons.check,
|
||||
color: Theme.of(context)
|
||||
.inputDecorationTheme
|
||||
.focusedBorder!
|
||||
.borderSide
|
||||
.color,
|
||||
color: theme.inputDecorationTheme
|
||||
.focusedBorder!.borderSide.color,
|
||||
)
|
||||
: null,
|
||||
border: UnderlineInputBorder(
|
||||
@@ -279,7 +273,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
decoration: InputDecoration(
|
||||
fillColor: _passwordsMatch && _passwordIsValid
|
||||
? _validFieldValueColor
|
||||
: getEnteColorScheme(context).fillFaint,
|
||||
: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
filled: true,
|
||||
hintText: AppLocalizations.of(context).confirmPassword,
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
@@ -292,7 +286,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
_password2Visible
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
size: 20,
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -304,11 +298,8 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
: _passwordsMatch
|
||||
? Icon(
|
||||
Icons.check,
|
||||
color: Theme.of(context)
|
||||
.inputDecorationTheme
|
||||
.focusedBorder!
|
||||
.borderSide
|
||||
.color,
|
||||
color: theme.inputDecorationTheme
|
||||
.focusedBorder!.borderSide.color,
|
||||
)
|
||||
: null,
|
||||
border: UnderlineInputBorder(
|
||||
@@ -357,7 +348,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
Icon(
|
||||
Icons.info_outline,
|
||||
size: 16,
|
||||
color: getEnteColorScheme(context).fillStrong,
|
||||
color: EnteTheme.getColorScheme(theme).fillStrong,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -370,16 +361,16 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
const EdgeInsets.symmetric(vertical: 0, horizontal: 20),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).hearUsWhereTitle,
|
||||
style: getEnteTextTheme(context).smallFaint,
|
||||
style: EnteTheme.getTextTheme(theme).smallFaint,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
|
||||
child: TextFormField(
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: theme.textTheme.titleMedium,
|
||||
decoration: InputDecoration(
|
||||
fillColor: getEnteColorScheme(context).fillFaint,
|
||||
fillColor: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
filled: true,
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
@@ -399,7 +390,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
},
|
||||
child: Icon(
|
||||
Icons.info_outline_rounded,
|
||||
color: getEnteColorScheme(context).fillStrong,
|
||||
color: EnteTheme.getColorScheme(theme).fillStrong,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -413,10 +404,10 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
),
|
||||
Divider(
|
||||
thickness: 1,
|
||||
color: getEnteColorScheme(context).strokeFaint,
|
||||
color: EnteTheme.getColorScheme(theme).strokeFaint,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_getAgreement(),
|
||||
_getAgreement(theme),
|
||||
const SizedBox(height: 40),
|
||||
],
|
||||
),
|
||||
@@ -426,19 +417,19 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Container _getAgreement() {
|
||||
Container _getAgreement(ThemeData theme) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 20),
|
||||
child: Column(
|
||||
children: [
|
||||
_getTOSAgreement(),
|
||||
_getPasswordAgreement(),
|
||||
_getTOSAgreement(theme),
|
||||
_getPasswordAgreement(theme),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getTOSAgreement() {
|
||||
Widget _getTOSAgreement(ThemeData theme) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
@@ -450,7 +441,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
children: [
|
||||
Checkbox(
|
||||
value: _hasAgreedToTOS,
|
||||
side: CheckboxTheme.of(context).side,
|
||||
side: theme.checkboxTheme.side,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_hasAgreedToTOS = value!;
|
||||
@@ -460,10 +451,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
Expanded(
|
||||
child: StyledText(
|
||||
text: AppLocalizations.of(context).signUpTerms,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
.copyWith(fontSize: 12),
|
||||
style: theme.textTheme.titleMedium!.copyWith(fontSize: 12),
|
||||
tags: {
|
||||
'u-terms': StyledTextActionTag(
|
||||
(String? text, Map<String?, String?> attrs) =>
|
||||
@@ -505,7 +493,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getPasswordAgreement() {
|
||||
Widget _getPasswordAgreement(ThemeData theme) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
@@ -517,7 +505,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
children: [
|
||||
Checkbox(
|
||||
value: _hasAgreedToE2E,
|
||||
side: CheckboxTheme.of(context).side,
|
||||
side: theme.checkboxTheme.side,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_hasAgreedToE2E = value!;
|
||||
@@ -527,10 +515,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
||||
Expanded(
|
||||
child: StyledText(
|
||||
text: AppLocalizations.of(context).ackPasswordLostWarning,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
.copyWith(fontSize: 12),
|
||||
style: theme.textTheme.titleMedium!.copyWith(fontSize: 12),
|
||||
tags: {
|
||||
'underline': StyledTextActionTag(
|
||||
(String? text, Map<String?, String?> attrs) =>
|
||||
|
||||
@@ -41,6 +41,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isKeypadOpen = MediaQuery.viewInsetsOf(context).bottom > 100;
|
||||
final theme = Theme.of(context);
|
||||
|
||||
FloatingActionButtonLocation? fabLocation() {
|
||||
if (isKeypadOpen) {
|
||||
@@ -56,7 +57,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
@@ -110,6 +111,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
|
||||
Widget _getBody() {
|
||||
final l10n = context.l10n;
|
||||
final theme = Theme.of(context);
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -121,7 +123,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
|
||||
child: Text(
|
||||
l10n.accountWelcomeBack,
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
style: theme.textTheme.headlineMedium,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -145,11 +147,8 @@ class _LoginPageState extends State<LoginPage> {
|
||||
? Icon(
|
||||
Icons.check,
|
||||
size: 20,
|
||||
color: Theme.of(context)
|
||||
.inputDecorationTheme
|
||||
.focusedBorder!
|
||||
.borderSide
|
||||
.color,
|
||||
color: theme.inputDecorationTheme.focusedBorder!
|
||||
.borderSide.color,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
@@ -168,7 +167,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
padding: const EdgeInsets.symmetric(vertical: 18),
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: getEnteColorScheme(context).strokeFaint,
|
||||
color: EnteTheme.getColorScheme(theme).strokeFaint,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -179,9 +178,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
flex: 5,
|
||||
child: StyledText(
|
||||
text: AppLocalizations.of(context).loginTerms,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
style: theme.textTheme.titleMedium!
|
||||
.copyWith(fontSize: 12),
|
||||
tags: {
|
||||
'u-terms': StyledTextActionTag(
|
||||
@@ -243,7 +240,9 @@ class _LoginPageState extends State<LoginPage> {
|
||||
if (_emailIsValid) {
|
||||
_emailInputFieldColor = const Color.fromRGBO(45, 194, 98, 0.2);
|
||||
} else {
|
||||
_emailInputFieldColor = getEnteColorScheme(context).fillFaint;
|
||||
// Using Theme.of(context) directly since this method is outside build and 'theme' isn't stored.
|
||||
_emailInputFieldColor =
|
||||
EnteTheme.getColorScheme(Theme.of(context)).fillFaint;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ class _LoginPasswordVerificationPageState
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
|
||||
late final theme = Theme.of(context);
|
||||
|
||||
FloatingActionButtonLocation? fabLocation() {
|
||||
if (isKeypadOpen) {
|
||||
@@ -76,13 +77,13 @@ class _LoginPasswordVerificationPageState
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
),
|
||||
body: _getBody(),
|
||||
body: _getBody(theme),
|
||||
floatingActionButton: DynamicFAB(
|
||||
key: const ValueKey("verifyPasswordButton"),
|
||||
isKeypadOpen: isKeypadOpen,
|
||||
@@ -201,7 +202,7 @@ class _LoginPasswordVerificationPageState
|
||||
}
|
||||
}
|
||||
|
||||
Widget _getBody() {
|
||||
Widget _getBody(ThemeData theme) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -212,7 +213,7 @@ class _LoginPasswordVerificationPageState
|
||||
padding: const EdgeInsets.only(top: 30, left: 20, right: 20),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).enterPassword,
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
style: theme.textTheme.headlineMedium,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -223,7 +224,7 @@ class _LoginPasswordVerificationPageState
|
||||
),
|
||||
child: Text(
|
||||
email ?? '',
|
||||
style: getEnteTextTheme(context).smallMuted,
|
||||
style: EnteTheme.getTextTheme(theme).smallMuted,
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
@@ -253,14 +254,14 @@ class _LoginPasswordVerificationPageState
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
fillColor: getEnteColorScheme(context).fillFaint,
|
||||
fillColor: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
suffixIcon: _passwordInFocus
|
||||
? IconButton(
|
||||
icon: Icon(
|
||||
_passwordVisible
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
size: 20,
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -289,7 +290,7 @@ class _LoginPasswordVerificationPageState
|
||||
padding: const EdgeInsets.symmetric(vertical: 18),
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: getEnteColorScheme(context).strokeFaint,
|
||||
color: EnteTheme.getColorScheme(theme).strokeFaint,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -309,13 +310,10 @@ class _LoginPasswordVerificationPageState
|
||||
child: Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context).forgotPassword,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
style: theme.textTheme.titleMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -335,13 +333,10 @@ class _LoginPasswordVerificationPageState
|
||||
child: Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context).changeEmail,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
style: theme.textTheme.titleMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -31,6 +31,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
|
||||
final theme = Theme.of(context);
|
||||
|
||||
FloatingActionButtonLocation? fabLocation() {
|
||||
if (isKeypadOpen) {
|
||||
@@ -46,7 +47,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
@@ -57,15 +58,15 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
||||
child: StepProgressIndicator(
|
||||
totalSteps: 4,
|
||||
currentStep: 2,
|
||||
selectedColor: Theme.of(context).colorScheme.greenAlternative,
|
||||
selectedColor: theme.colorScheme.greenAlternative,
|
||||
roundedEdges: const Radius.circular(10),
|
||||
unselectedColor:
|
||||
Theme.of(context).colorScheme.stepProgressUnselectedColor,
|
||||
theme.colorScheme.stepProgressUnselectedColor,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
body: _getBody(),
|
||||
body: _getBody(theme),
|
||||
floatingActionButton: DynamicFAB(
|
||||
key: const ValueKey("verifyOttButton"),
|
||||
isKeypadOpen: isKeypadOpen,
|
||||
@@ -93,7 +94,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getBody() {
|
||||
Widget _getBody(ThemeData theme) {
|
||||
return ListView(
|
||||
children: [
|
||||
Column(
|
||||
@@ -103,7 +104,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
||||
padding: const EdgeInsets.fromLTRB(20, 30, 20, 15),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).verifyEmail,
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
style: theme.textTheme.headlineMedium,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -119,16 +120,12 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
||||
child: StyledText(
|
||||
text: AppLocalizations.of(context)
|
||||
.weHaveSendEmailTo(widget.email),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
style: theme.textTheme.titleMedium!
|
||||
.copyWith(fontSize: 14),
|
||||
tags: {
|
||||
'green': StyledTextTag(
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.greenAlternative,
|
||||
color: theme.colorScheme.greenAlternative,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -137,17 +134,13 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
||||
widget.isResetPasswordScreen
|
||||
? Text(
|
||||
AppLocalizations.of(context).toResetVerifyEmail,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
style: theme.textTheme.titleMedium!
|
||||
.copyWith(fontSize: 14),
|
||||
)
|
||||
: Text(
|
||||
AppLocalizations.of(context)
|
||||
.checkInboxAndSpamFolder,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
style: theme.textTheme.titleMedium!
|
||||
.copyWith(fontSize: 14),
|
||||
),
|
||||
],
|
||||
@@ -164,7 +157,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
||||
padding: const EdgeInsets.fromLTRB(20, 16, 20, 16),
|
||||
child: TextFormField(
|
||||
key: const ValueKey("ottVerificationInputField"),
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: theme.textTheme.titleMedium,
|
||||
decoration: InputDecoration(
|
||||
filled: true,
|
||||
hintText: AppLocalizations.of(context).tapToEnterCode,
|
||||
@@ -173,7 +166,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
fillColor: getEnteColorScheme(context).fillFaint,
|
||||
fillColor: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
),
|
||||
controller: _verificationCodeController,
|
||||
autofocus: false,
|
||||
@@ -186,7 +179,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
||||
),
|
||||
Divider(
|
||||
thickness: 1,
|
||||
color: getEnteColorScheme(context).strokeFaint,
|
||||
color: EnteTheme.getColorScheme(theme).strokeFaint,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
@@ -205,10 +198,10 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
||||
},
|
||||
child: Text(
|
||||
AppLocalizations.of(context).resendEmail,
|
||||
style: Theme.of(context).textTheme.titleMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
style: theme.textTheme.titleMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -88,6 +88,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
|
||||
final theme = Theme.of(context);
|
||||
|
||||
FloatingActionButtonLocation? fabLocation() {
|
||||
if (isKeypadOpen) {
|
||||
@@ -112,14 +113,14 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
||||
? const SizedBox.shrink()
|
||||
: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
elevation: 0,
|
||||
),
|
||||
body: _getBody(title),
|
||||
body: _getBody(title, theme),
|
||||
floatingActionButton: DynamicFAB(
|
||||
isKeypadOpen: isKeypadOpen,
|
||||
isFormValid: _passwordsMatch && _isPasswordValid,
|
||||
@@ -138,7 +139,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getBody(String buttonTextAndHeading) {
|
||||
Widget _getBody(String buttonTextAndHeading, ThemeData theme) {
|
||||
final email = Configuration.instance.getEmail();
|
||||
var passwordStrengthText = AppLocalizations.of(context).weakStrength;
|
||||
var passwordStrengthColor = Colors.redAccent;
|
||||
@@ -163,7 +164,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
||||
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
|
||||
child: Text(
|
||||
buttonTextAndHeading,
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
style: theme.textTheme.headlineMedium,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -174,10 +175,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
||||
: AppLocalizations.of(context)
|
||||
.enterNewPasswordToEncrypt,
|
||||
textAlign: TextAlign.start,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
.copyWith(fontSize: 14),
|
||||
style: theme.textTheme.titleMedium!.copyWith(fontSize: 14),
|
||||
),
|
||||
),
|
||||
const Padding(padding: EdgeInsets.all(8)),
|
||||
@@ -185,17 +183,13 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: StyledText(
|
||||
text: AppLocalizations.of(context).passwordWarning,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
.copyWith(fontSize: 14),
|
||||
style: theme.textTheme.titleMedium!.copyWith(fontSize: 14),
|
||||
tags: {
|
||||
'underline': StyledTextTag(
|
||||
style:
|
||||
Theme.of(context).textTheme.titleMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
style: theme.textTheme.titleMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
},
|
||||
),
|
||||
@@ -222,7 +216,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
||||
decoration: InputDecoration(
|
||||
fillColor: _isPasswordValid
|
||||
? _validFieldValueColor
|
||||
: getEnteColorScheme(context).fillFaint,
|
||||
: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
filled: true,
|
||||
hintText: AppLocalizations.of(context).password,
|
||||
contentPadding: const EdgeInsets.all(20),
|
||||
@@ -236,7 +230,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
||||
_password1Visible
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
size: 20,
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -248,11 +242,8 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
||||
: _isPasswordValid
|
||||
? Icon(
|
||||
Icons.check,
|
||||
color: Theme.of(context)
|
||||
.inputDecorationTheme
|
||||
.focusedBorder!
|
||||
.borderSide
|
||||
.color,
|
||||
color: theme.inputDecorationTheme
|
||||
.focusedBorder!.borderSide.color,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
@@ -287,7 +278,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
||||
decoration: InputDecoration(
|
||||
fillColor: _passwordsMatch
|
||||
? _validFieldValueColor
|
||||
: getEnteColorScheme(context).fillFaint,
|
||||
: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
filled: true,
|
||||
hintText: AppLocalizations.of(context).confirmPassword,
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
@@ -300,7 +291,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
||||
_password2Visible
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
size: 20,
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -312,11 +303,8 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
||||
: _passwordsMatch
|
||||
? Icon(
|
||||
Icons.check,
|
||||
color: Theme.of(context)
|
||||
.inputDecorationTheme
|
||||
.focusedBorder!
|
||||
.borderSide
|
||||
.color,
|
||||
color: theme.inputDecorationTheme
|
||||
.focusedBorder!.borderSide.color,
|
||||
)
|
||||
: null,
|
||||
border: UnderlineInputBorder(
|
||||
@@ -371,11 +359,10 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: AppLocalizations.of(context).howItWorks,
|
||||
style:
|
||||
Theme.of(context).textTheme.titleMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
style: theme.textTheme.titleMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -63,6 +63,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
|
||||
final theme = Theme.of(context);
|
||||
|
||||
FloatingActionButtonLocation? fabLocation() {
|
||||
if (isKeypadOpen) {
|
||||
@@ -78,13 +79,13 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
),
|
||||
body: _getBody(),
|
||||
body: _getBody(theme),
|
||||
floatingActionButton: DynamicFAB(
|
||||
key: const ValueKey("verifyPasswordButton"),
|
||||
isKeypadOpen: isKeypadOpen,
|
||||
@@ -186,7 +187,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
||||
}
|
||||
}
|
||||
|
||||
Widget _getBody() {
|
||||
Widget _getBody(ThemeData theme) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -198,7 +199,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
||||
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).welcomeBack,
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
style: theme.textTheme.headlineMedium,
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
@@ -223,7 +224,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
||||
decoration: InputDecoration(
|
||||
hintText: AppLocalizations.of(context).enterYourPassword,
|
||||
filled: true,
|
||||
fillColor: getEnteColorScheme(context).fillFaint,
|
||||
fillColor: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
contentPadding: const EdgeInsets.all(20),
|
||||
border: UnderlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
@@ -235,7 +236,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
||||
_passwordVisible
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
size: 20,
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -264,7 +265,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
||||
padding: const EdgeInsets.symmetric(vertical: 18),
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: getEnteColorScheme(context).strokeFaint,
|
||||
color: EnteTheme.getColorScheme(theme).strokeFaint,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -285,11 +286,10 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
||||
},
|
||||
child: Text(
|
||||
AppLocalizations.of(context).forgotPassword,
|
||||
style:
|
||||
Theme.of(context).textTheme.titleMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
style: theme.textTheme.titleMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
@@ -307,11 +307,10 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
||||
},
|
||||
child: Text(
|
||||
AppLocalizations.of(context).changeEmail,
|
||||
style:
|
||||
Theme.of(context).textTheme.titleMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
style: theme.textTheme.titleMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -51,6 +51,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final String recoveryKey = bip39.entropyToMnemonic(widget.recoveryKey);
|
||||
final theme = Theme.of(context);
|
||||
if (recoveryKey.split(' ').length != mnemonicKeyWordCount) {
|
||||
throw AssertionError(
|
||||
'recovery code should have $mnemonicKeyWordCount words',
|
||||
@@ -72,10 +73,10 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
||||
child: StepProgressIndicator(
|
||||
totalSteps: 4,
|
||||
currentStep: 3,
|
||||
selectedColor: Theme.of(context).colorScheme.greenAlternative,
|
||||
selectedColor: theme.colorScheme.greenAlternative,
|
||||
roundedEdges: const Radius.circular(10),
|
||||
unselectedColor:
|
||||
Theme.of(context).colorScheme.stepProgressUnselectedColor,
|
||||
theme.colorScheme.stepProgressUnselectedColor,
|
||||
),
|
||||
),
|
||||
)
|
||||
@@ -107,7 +108,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
||||
: Text(
|
||||
widget.title ??
|
||||
AppLocalizations.of(context).recoveryKey,
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
style: theme.textTheme.headlineMedium,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.all(widget.showAppBar! ? 0 : 12),
|
||||
@@ -116,7 +117,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
||||
widget.text ??
|
||||
AppLocalizations.of(context)
|
||||
.recoveryKeyOnForgotPassword,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
const Padding(padding: EdgeInsets.only(top: 24)),
|
||||
DottedBorder(
|
||||
@@ -162,16 +163,14 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(2),
|
||||
),
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.recoveryKeyBoxColor,
|
||||
color:
|
||||
theme.colorScheme.recoveryKeyBoxColor,
|
||||
),
|
||||
padding: const EdgeInsets.all(20),
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
recoveryKey,
|
||||
style:
|
||||
Theme.of(context).textTheme.bodyLarge,
|
||||
style: theme.textTheme.bodyLarge,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -185,7 +184,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
||||
widget.subText ??
|
||||
AppLocalizations.of(context)
|
||||
.recoveryKeySaveDescription,
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
style: theme.textTheme.bodyLarge,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@@ -196,7 +195,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: _saveOptions(context, recoveryKey),
|
||||
children: _saveOptions(context, recoveryKey, theme),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -211,12 +210,16 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> _saveOptions(BuildContext context, String recoveryKey) {
|
||||
List<Widget> _saveOptions(
|
||||
BuildContext context,
|
||||
String recoveryKey,
|
||||
ThemeData theme,
|
||||
) {
|
||||
final List<Widget> childrens = [];
|
||||
if (!_hasTriedToSave) {
|
||||
childrens.add(
|
||||
ElevatedButton(
|
||||
style: Theme.of(context).colorScheme.optionalActionButtonStyle,
|
||||
style: theme.colorScheme.optionalActionButtonStyle,
|
||||
onPressed: () async {
|
||||
await _saveKeys();
|
||||
},
|
||||
|
||||
@@ -20,6 +20,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
|
||||
final theme = Theme.of(context);
|
||||
FloatingActionButtonLocation? fabLocation() {
|
||||
if (isKeypadOpen) {
|
||||
return null;
|
||||
@@ -34,7 +35,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
@@ -99,7 +100,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
||||
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).forgotPassword,
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
style: theme.textTheme.headlineMedium,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -107,7 +108,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
||||
child: TextFormField(
|
||||
decoration: InputDecoration(
|
||||
filled: true,
|
||||
fillColor: getEnteColorScheme(context).fillFaint,
|
||||
fillColor: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
hintText:
|
||||
AppLocalizations.of(context).enterYourRecoveryKey,
|
||||
contentPadding: const EdgeInsets.all(20),
|
||||
@@ -134,7 +135,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
||||
padding: const EdgeInsets.symmetric(vertical: 18),
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: getEnteColorScheme(context).strokeFaint,
|
||||
color: EnteTheme.getColorScheme(theme).strokeFaint,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
|
||||
@@ -57,6 +57,7 @@ class _RequestPasswordVerificationPageState
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
|
||||
final theme = Theme.of(context);
|
||||
|
||||
FloatingActionButtonLocation? fabLocation() {
|
||||
if (isKeypadOpen) {
|
||||
@@ -72,13 +73,13 @@ class _RequestPasswordVerificationPageState
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
),
|
||||
body: _getBody(),
|
||||
body: _getBody(theme),
|
||||
floatingActionButton: DynamicFAB(
|
||||
key: const ValueKey("verifyPasswordButton"),
|
||||
isKeypadOpen: isKeypadOpen,
|
||||
@@ -127,7 +128,7 @@ class _RequestPasswordVerificationPageState
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getBody() {
|
||||
Widget _getBody(ThemeData theme) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -138,7 +139,7 @@ class _RequestPasswordVerificationPageState
|
||||
padding: const EdgeInsets.only(top: 30, left: 20, right: 20),
|
||||
child: Text(
|
||||
context.l10n.enterPassword,
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
style: theme.textTheme.headlineMedium,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -149,7 +150,7 @@ class _RequestPasswordVerificationPageState
|
||||
),
|
||||
child: Text(
|
||||
email ?? '',
|
||||
style: getEnteTextTheme(context).smallMuted,
|
||||
style: EnteTheme.getTextTheme(theme).smallMuted,
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
@@ -174,7 +175,7 @@ class _RequestPasswordVerificationPageState
|
||||
decoration: InputDecoration(
|
||||
hintText: context.l10n.enterYourPassword,
|
||||
filled: true,
|
||||
fillColor: getEnteColorScheme(context).fillFaint,
|
||||
fillColor: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
contentPadding: const EdgeInsets.all(20),
|
||||
border: UnderlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
@@ -186,7 +187,7 @@ class _RequestPasswordVerificationPageState
|
||||
_passwordVisible
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
size: 20,
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -215,7 +216,7 @@ class _RequestPasswordVerificationPageState
|
||||
padding: const EdgeInsets.symmetric(vertical: 18),
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: getEnteColorScheme(context).strokeFaint,
|
||||
color: EnteTheme.getColorScheme(theme).strokeFaint,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -35,23 +35,24 @@ class _SessionsPageState extends State<SessionsPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
title: Text(AppLocalizations.of(context).activeSessions),
|
||||
),
|
||||
body: _getBody(),
|
||||
body: _getBody(theme),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getBody() {
|
||||
Widget _getBody(ThemeData theme) {
|
||||
if (_sessions == null) {
|
||||
return const Center(child: EnteLoadingWidget());
|
||||
}
|
||||
final List<Widget> rows = [];
|
||||
rows.add(const Padding(padding: EdgeInsets.all(4)));
|
||||
for (final session in _sessions!.sessions) {
|
||||
rows.add(_getSessionWidget(session));
|
||||
rows.add(_getSessionWidget(session, theme));
|
||||
}
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
@@ -60,21 +61,21 @@ class _SessionsPageState extends State<SessionsPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getSessionWidget(Session session) {
|
||||
Widget _getSessionWidget(Session session, ThemeData theme) {
|
||||
final lastUsedTime =
|
||||
DateTime.fromMicrosecondsSinceEpoch(session.lastUsedTime);
|
||||
return Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
_showSessionTerminationDialog(session);
|
||||
_showSessionTerminationDialog(session, theme);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_getUAWidget(session),
|
||||
_getUAWidget(session, theme),
|
||||
const Padding(padding: EdgeInsets.all(4)),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@@ -83,9 +84,7 @@ class _SessionsPageState extends State<SessionsPage> {
|
||||
child: Text(
|
||||
session.ip,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
color: theme.colorScheme.onSurface
|
||||
.withValues(alpha: 0.8),
|
||||
fontSize: 14,
|
||||
),
|
||||
@@ -96,9 +95,7 @@ class _SessionsPageState extends State<SessionsPage> {
|
||||
child: Text(
|
||||
getFormattedTime(context, lastUsedTime),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
color: theme.colorScheme.onSurface
|
||||
.withValues(alpha: 0.8),
|
||||
fontSize: 12,
|
||||
),
|
||||
@@ -111,7 +108,7 @@ class _SessionsPageState extends State<SessionsPage> {
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
color: getEnteColorScheme(context).strokeFaint,
|
||||
color: EnteTheme.getColorScheme(theme).strokeFaint,
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -152,7 +149,7 @@ class _SessionsPageState extends State<SessionsPage> {
|
||||
}
|
||||
}
|
||||
|
||||
void _showSessionTerminationDialog(Session session) {
|
||||
void _showSessionTerminationDialog(Session session, ThemeData theme) {
|
||||
final isLoggingOutFromThisDevice =
|
||||
session.token == Configuration.instance.getToken();
|
||||
Widget text;
|
||||
@@ -171,7 +168,7 @@ class _SessionsPageState extends State<SessionsPage> {
|
||||
const Padding(padding: EdgeInsets.all(8)),
|
||||
Text(
|
||||
session.ua,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
style: theme.textTheme.bodySmall,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -202,8 +199,8 @@ class _SessionsPageState extends State<SessionsPage> {
|
||||
AppLocalizations.of(context).cancel,
|
||||
style: TextStyle(
|
||||
color: isLoggingOutFromThisDevice
|
||||
? Theme.of(context).colorScheme.greenAlternative
|
||||
: Theme.of(context).colorScheme.defaultTextColor,
|
||||
? theme.colorScheme.greenAlternative
|
||||
: theme.colorScheme.defaultTextColor,
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -222,13 +219,13 @@ class _SessionsPageState extends State<SessionsPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getUAWidget(Session session) {
|
||||
Widget _getUAWidget(Session session, ThemeData theme) {
|
||||
if (session.token == Configuration.instance.getToken()) {
|
||||
return Text(
|
||||
AppLocalizations.of(context).thisDevice,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).colorScheme.greenAlternative,
|
||||
color: theme.colorScheme.greenAlternative,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ class _TwoFactorRecoveryPageState extends State<TwoFactorRecoveryPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
@@ -102,7 +103,7 @@ class _TwoFactorRecoveryPageState extends State<TwoFactorRecoveryPage> {
|
||||
style: TextStyle(
|
||||
decoration: TextDecoration.underline,
|
||||
fontSize: 12,
|
||||
color: getEnteColorScheme(context)
|
||||
color: EnteTheme.getColorScheme(theme)
|
||||
.textBase
|
||||
.withValues(alpha: 0.9),
|
||||
),
|
||||
|
||||
@@ -76,6 +76,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
@@ -83,11 +84,11 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
|
||||
AppLocalizations.of(context).twofactorSetup,
|
||||
),
|
||||
),
|
||||
body: _getBody(),
|
||||
body: _getBody(theme),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getBody() {
|
||||
Widget _getBody(ThemeData theme) {
|
||||
return SingleChildScrollView(
|
||||
reverse: true,
|
||||
child: Center(
|
||||
@@ -99,7 +100,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
|
||||
child: Column(
|
||||
children: [
|
||||
TabBar(
|
||||
labelColor: Theme.of(context).colorScheme.greenAlternative,
|
||||
labelColor: theme.colorScheme.greenAlternative,
|
||||
unselectedLabelColor: Colors.grey,
|
||||
tabs: [
|
||||
Tab(
|
||||
@@ -116,7 +117,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
|
||||
child: TabBarView(
|
||||
controller: _tabController,
|
||||
children: [
|
||||
_getSecretCode(),
|
||||
_getSecretCode(theme),
|
||||
_getBarCode(),
|
||||
],
|
||||
),
|
||||
@@ -127,7 +128,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
|
||||
Divider(
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
color: theme.colorScheme.secondary,
|
||||
),
|
||||
_getVerificationWidget(),
|
||||
],
|
||||
@@ -136,8 +137,8 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getSecretCode() {
|
||||
final Color textColor = Theme.of(context).colorScheme.onSurface;
|
||||
Widget _getSecretCode(ThemeData theme) {
|
||||
final Color textColor = theme.colorScheme.onSurface;
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
await Clipboard.setData(ClipboardData(text: widget.secretCode));
|
||||
|
||||
@@ -120,13 +120,14 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final enteTheme = Theme.of(context).colorScheme.enteTheme;
|
||||
final theme = Theme.of(context);
|
||||
final enteTheme = theme.colorScheme.enteTheme;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
@@ -164,7 +165,7 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
|
||||
TextFormField(
|
||||
decoration: InputDecoration(
|
||||
filled: true,
|
||||
fillColor: getEnteColorScheme(context).fillFaint,
|
||||
fillColor: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
hintText:
|
||||
AppLocalizations.of(context).enterYourRecoveryKey,
|
||||
contentPadding: const EdgeInsets.all(20),
|
||||
|
||||
@@ -18,7 +18,7 @@ import 'package:photos/services/account/user_service.dart';
|
||||
import 'package:photos/services/collections_service.dart';
|
||||
import 'package:photos/services/hidden_service.dart';
|
||||
import 'package:photos/theme/colors.dart';
|
||||
import 'package:photos/theme/ente_theme.dart';
|
||||
import "package:photos/theme/ente_theme.dart";
|
||||
import 'package:photos/ui/common/progress_dialog.dart';
|
||||
import "package:photos/ui/common/user_dialogs.dart";
|
||||
import 'package:photos/ui/components/action_sheet_widget.dart';
|
||||
@@ -339,7 +339,8 @@ class CollectionActions {
|
||||
BuildContext context,
|
||||
List<Collection> collections,
|
||||
) async {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
final actionResult = await showActionSheet(
|
||||
context: context,
|
||||
buttons: [
|
||||
@@ -422,26 +423,27 @@ class CollectionActions {
|
||||
|
||||
// deleteCollectionSheet returns true if the album is successfully deleted
|
||||
Future<bool> deleteCollectionSheet(
|
||||
BuildContext bContext,
|
||||
BuildContext context,
|
||||
Collection collection,
|
||||
) async {
|
||||
final textTheme = getEnteTextTheme(bContext);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
final currentUserID = Configuration.instance.getUserID()!;
|
||||
if (collection.owner.id != currentUserID) {
|
||||
throw AssertionError("Can not delete album owned by others");
|
||||
}
|
||||
if (collection.hasSharees) {
|
||||
final bool confirmDelete =
|
||||
await _confirmSharedAlbumDeletion(bContext, collection);
|
||||
await _confirmSharedAlbumDeletion(context, collection);
|
||||
if (!confirmDelete) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
final actionResult = await showActionSheet(
|
||||
context: bContext,
|
||||
context: context,
|
||||
buttons: [
|
||||
ButtonWidget(
|
||||
labelText: AppLocalizations.of(bContext).keepPhotos,
|
||||
labelText: AppLocalizations.of(context).keepPhotos,
|
||||
buttonType: ButtonType.neutral,
|
||||
buttonSize: ButtonSize.large,
|
||||
buttonAction: ButtonAction.first,
|
||||
@@ -449,7 +451,7 @@ class CollectionActions {
|
||||
isInAlert: true,
|
||||
onTap: () async {
|
||||
try {
|
||||
await trashCollectionKeepingPhotos(collection, bContext);
|
||||
await trashCollectionKeepingPhotos(collection, context);
|
||||
} catch (e, s) {
|
||||
logger.severe("Failed to keep photos & delete collection", e, s);
|
||||
rethrow;
|
||||
@@ -457,7 +459,7 @@ class CollectionActions {
|
||||
},
|
||||
),
|
||||
ButtonWidget(
|
||||
labelText: AppLocalizations.of(bContext).deletePhotos,
|
||||
labelText: AppLocalizations.of(context).deletePhotos,
|
||||
buttonType: ButtonType.critical,
|
||||
buttonSize: ButtonSize.large,
|
||||
buttonAction: ButtonAction.second,
|
||||
@@ -473,7 +475,7 @@ class CollectionActions {
|
||||
},
|
||||
),
|
||||
ButtonWidget(
|
||||
labelText: AppLocalizations.of(bContext).cancel,
|
||||
labelText: AppLocalizations.of(context).cancel,
|
||||
buttonType: ButtonType.secondary,
|
||||
buttonSize: ButtonSize.large,
|
||||
buttonAction: ButtonAction.third,
|
||||
@@ -482,7 +484,7 @@ class CollectionActions {
|
||||
),
|
||||
],
|
||||
bodyWidget: StyledText(
|
||||
text: AppLocalizations.of(bContext).deleteAlbumDialog,
|
||||
text: AppLocalizations.of(context).deleteAlbumDialog,
|
||||
style: textTheme.body.copyWith(color: textMutedDark),
|
||||
tags: {
|
||||
'bold': StyledTextTag(
|
||||
@@ -495,7 +497,7 @@ class CollectionActions {
|
||||
if (actionResult?.action != null &&
|
||||
actionResult!.action == ButtonAction.error) {
|
||||
await showGenericErrorDialog(
|
||||
context: bContext,
|
||||
context: context,
|
||||
error: actionResult.exception,
|
||||
);
|
||||
return false;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import "dart:async";
|
||||
|
||||
import "package:flutter/cupertino.dart";
|
||||
import "package:flutter/material.dart";
|
||||
import "package:modal_bottom_sheet/modal_bottom_sheet.dart";
|
||||
import "package:photos/core/event_bus.dart";
|
||||
import "package:photos/events/details_sheet_event.dart";
|
||||
@@ -141,7 +142,8 @@ Future<void> showSingleFileDeleteSheet(
|
||||
|
||||
Future<void> showDetailsSheet(BuildContext context, EnteFile file) async {
|
||||
guardedCheckPanorama(file).ignore();
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
Bus.instance.fire(
|
||||
DetailsSheetEvent(
|
||||
localID: file.localID,
|
||||
|
||||
@@ -27,7 +27,8 @@ class _AutoCastDialogState extends State<AutoCastDialog> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textStyle = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textStyle = EnteTheme.getTextTheme(theme);
|
||||
final AlertDialog alert = AlertDialog(
|
||||
title: Text(
|
||||
AppLocalizations.of(context).connectToDevice,
|
||||
|
||||
@@ -19,7 +19,8 @@ class _CastChooseDialogState extends State<CastChooseDialog> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textStyle = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textStyle = EnteTheme.getTextTheme(theme);
|
||||
final AlertDialog alert = AlertDialog(
|
||||
title: Text(
|
||||
context.l10n.playOnTv,
|
||||
|
||||
@@ -23,8 +23,9 @@ class AlbumColumnItemWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
const sideOfThumbnail = 60.0;
|
||||
final isSelected = selectedCollections.contains(collection);
|
||||
return AnimatedContainer(
|
||||
|
||||
@@ -2,6 +2,7 @@ import "dart:async";
|
||||
import "dart:math";
|
||||
|
||||
import "package:flutter/cupertino.dart";
|
||||
import 'package:flutter/material.dart';
|
||||
import "package:logging/logging.dart";
|
||||
import "package:photos/core/event_bus.dart";
|
||||
import "package:photos/events/collection_updated_event.dart";
|
||||
@@ -62,6 +63,7 @@ class _AlbumHorizontalListState extends State<AlbumHorizontalList> {
|
||||
return FutureBuilder<List<Collection>>(
|
||||
future: widget.collectionsFuture(),
|
||||
builder: (context, snapshot) {
|
||||
final theme = Theme.of(context);
|
||||
if (snapshot.hasError) {
|
||||
_logger.severe("failed to fetch albums", snapshot.error);
|
||||
return Text(AppLocalizations.of(context).somethingWentWrong);
|
||||
@@ -80,7 +82,7 @@ class _AlbumHorizontalListState extends State<AlbumHorizontalList> {
|
||||
const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).albums,
|
||||
style: getEnteTextTheme(context).large,
|
||||
style: EnteTheme.getTextTheme(theme).large,
|
||||
),
|
||||
),
|
||||
Align(
|
||||
|
||||
@@ -27,8 +27,9 @@ class AlbumListItemWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
const sideOfThumbnail = 60.0;
|
||||
|
||||
final albumWidget = Flexible(
|
||||
|
||||
@@ -12,8 +12,9 @@ class NewAlbumListItemWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
const sideOfThumbnail = 60.0;
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
@@ -27,7 +28,7 @@ class NewAlbumListItemWidget extends StatelessWidget {
|
||||
child: Container(
|
||||
height: sideOfThumbnail,
|
||||
width: sideOfThumbnail,
|
||||
color: Theme.of(context).brightness == Brightness.light
|
||||
color: !EnteTheme.isDark(theme)
|
||||
? colorScheme.backdropBase
|
||||
: colorScheme.backdropFaint,
|
||||
child: Icon(
|
||||
|
||||
@@ -23,7 +23,8 @@ class NewAlbumRowItemWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
final result = await showTextInputDialog(
|
||||
@@ -73,7 +74,7 @@ class NewAlbumRowItemWidget extends StatelessWidget {
|
||||
child: Container(
|
||||
height: height,
|
||||
width: width,
|
||||
color: Theme.of(context).brightness == Brightness.light
|
||||
color: theme.brightness == Brightness.light
|
||||
? colorScheme.backdropBase
|
||||
: colorScheme.backdropFaint,
|
||||
child: DottedBorder(
|
||||
@@ -95,7 +96,7 @@ class NewAlbumRowItemWidget extends StatelessWidget {
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
AppLocalizations.of(context).addNew,
|
||||
style: getEnteTextTheme(context).smallFaint,
|
||||
style: EnteTheme.getTextTheme(theme).smallFaint,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -48,7 +48,8 @@ class AlbumRowItemWidget extends StatelessWidget {
|
||||
tag +
|
||||
"_" +
|
||||
c.id.toString();
|
||||
final enteTextTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final enteTextTheme = EnteTheme.getTextTheme(theme);
|
||||
final Widget? linkIcon = c.hasLink && isOwner
|
||||
? Icon(
|
||||
Icons.link,
|
||||
@@ -73,7 +74,7 @@ class AlbumRowItemWidget extends StatelessWidget {
|
||||
cornerSmoothing: _cornerSmoothing,
|
||||
),
|
||||
child: Container(
|
||||
color: getEnteColorScheme(context).strokeFaint,
|
||||
color: EnteTheme.getColorScheme(theme).strokeFaint,
|
||||
width: sideOfThumbnail,
|
||||
height: sideOfThumbnail,
|
||||
),
|
||||
@@ -131,7 +132,8 @@ class AlbumRowItemWidget extends StatelessWidget {
|
||||
);
|
||||
} else {
|
||||
return Container(
|
||||
color: getEnteColorScheme(context).backdropBase,
|
||||
color: EnteTheme.getColorScheme(theme)
|
||||
.backdropBase,
|
||||
child: const NoThumbnailWidget(
|
||||
borderRadius: 12,
|
||||
addBorder: false,
|
||||
|
||||
@@ -17,18 +17,19 @@ class ArchivedCollectionsButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final Set<int> hiddenCollectionId =
|
||||
CollectionsService.instance.getHiddenCollectionIds();
|
||||
return OutlinedButton(
|
||||
style: OutlinedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
backgroundColor: theme.colorScheme.surface,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
padding: const EdgeInsets.all(0),
|
||||
side: BorderSide(
|
||||
width: 0.5,
|
||||
color: Theme.of(context).iconTheme.color!.withValues(alpha: 0.24),
|
||||
color: theme.iconTheme.color!.withValues(alpha: 0.24),
|
||||
),
|
||||
),
|
||||
child: SizedBox(
|
||||
@@ -43,7 +44,7 @@ class ArchivedCollectionsButton extends StatelessWidget {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.archive_outlined,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
),
|
||||
const Padding(padding: EdgeInsets.all(6)),
|
||||
FutureBuilder<int>(
|
||||
@@ -60,7 +61,7 @@ class ArchivedCollectionsButton extends StatelessWidget {
|
||||
children: [
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(context).archive,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
const TextSpan(text: " \u2022 "),
|
||||
TextSpan(
|
||||
@@ -77,7 +78,7 @@ class ArchivedCollectionsButton extends StatelessWidget {
|
||||
children: [
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(context).archive,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
//need to query in db and bring this value
|
||||
],
|
||||
@@ -90,7 +91,7 @@ class ArchivedCollectionsButton extends StatelessWidget {
|
||||
),
|
||||
Icon(
|
||||
Icons.chevron_right,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -14,16 +14,16 @@ class HiddenCollectionsButtonWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return OutlinedButton(
|
||||
style: OutlinedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
backgroundColor: theme.colorScheme.surface,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
padding: const EdgeInsets.all(0),
|
||||
side: BorderSide(
|
||||
width: 0.5,
|
||||
color: Theme.of(context).iconTheme.color!.withValues(alpha: 0.24),
|
||||
color: theme.iconTheme.color!.withValues(alpha: 0.24),
|
||||
),
|
||||
),
|
||||
child: SizedBox(
|
||||
@@ -38,7 +38,7 @@ class HiddenCollectionsButtonWidget extends StatelessWidget {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.visibility_off,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
),
|
||||
const Padding(padding: EdgeInsets.all(6)),
|
||||
RichText(
|
||||
@@ -47,14 +47,14 @@ class HiddenCollectionsButtonWidget extends StatelessWidget {
|
||||
children: [
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(context).hidden,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
const TextSpan(text: " \u2022 "),
|
||||
WidgetSpan(
|
||||
child: Icon(
|
||||
Icons.lock_outline,
|
||||
size: 16,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
),
|
||||
),
|
||||
//need to query in db and bring this value
|
||||
@@ -65,7 +65,7 @@ class HiddenCollectionsButtonWidget extends StatelessWidget {
|
||||
),
|
||||
Icon(
|
||||
Icons.chevron_right,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -43,16 +43,17 @@ class _TrashSectionButtonState extends State<TrashSectionButton> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return OutlinedButton(
|
||||
style: OutlinedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
backgroundColor: theme.colorScheme.surface,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
padding: const EdgeInsets.all(0),
|
||||
side: BorderSide(
|
||||
width: 0.5,
|
||||
color: Theme.of(context).iconTheme.color!.withValues(alpha: 0.24),
|
||||
color: theme.iconTheme.color!.withValues(alpha: 0.24),
|
||||
),
|
||||
),
|
||||
child: SizedBox(
|
||||
@@ -67,7 +68,7 @@ class _TrashSectionButtonState extends State<TrashSectionButton> {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.delete,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
),
|
||||
const Padding(padding: EdgeInsets.all(6)),
|
||||
FutureBuilder<int>(
|
||||
@@ -80,7 +81,7 @@ class _TrashSectionButtonState extends State<TrashSectionButton> {
|
||||
children: [
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(context).trash,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
const TextSpan(text: " \u2022 "),
|
||||
TextSpan(
|
||||
@@ -97,7 +98,7 @@ class _TrashSectionButtonState extends State<TrashSectionButton> {
|
||||
children: [
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(context).trash,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
//need to query in db and bring this value
|
||||
],
|
||||
@@ -110,7 +111,7 @@ class _TrashSectionButtonState extends State<TrashSectionButton> {
|
||||
),
|
||||
Icon(
|
||||
Icons.chevron_right,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -17,6 +17,7 @@ class UnCategorizedCollections extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final Collection? collection = CollectionsService.instance
|
||||
.getActiveCollections()
|
||||
.firstWhereOrNull((e) => e.type == CollectionType.uncategorized);
|
||||
@@ -26,14 +27,14 @@ class UnCategorizedCollections extends StatelessWidget {
|
||||
}
|
||||
return OutlinedButton(
|
||||
style: OutlinedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
backgroundColor: theme.colorScheme.surface,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
padding: const EdgeInsets.all(0),
|
||||
side: BorderSide(
|
||||
width: 0.5,
|
||||
color: Theme.of(context).iconTheme.color!.withValues(alpha: 0.24),
|
||||
color: theme.iconTheme.color!.withValues(alpha: 0.24),
|
||||
),
|
||||
),
|
||||
child: SizedBox(
|
||||
@@ -48,7 +49,7 @@ class UnCategorizedCollections extends StatelessWidget {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.category_outlined,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
),
|
||||
const Padding(padding: EdgeInsets.all(6)),
|
||||
FutureBuilder<int>(
|
||||
@@ -64,7 +65,7 @@ class UnCategorizedCollections extends StatelessWidget {
|
||||
TextSpan(
|
||||
text:
|
||||
AppLocalizations.of(context).uncategorized,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
const TextSpan(text: " \u2022 "),
|
||||
TextSpan(
|
||||
@@ -82,7 +83,7 @@ class UnCategorizedCollections extends StatelessWidget {
|
||||
TextSpan(
|
||||
text:
|
||||
AppLocalizations.of(context).uncategorized,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
//need to query in db and bring this value
|
||||
],
|
||||
@@ -95,7 +96,7 @@ class UnCategorizedCollections extends StatelessWidget {
|
||||
),
|
||||
Icon(
|
||||
Icons.chevron_right,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
color: theme.iconTheme.color,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -108,7 +108,9 @@ void showCollectionActionSheet(
|
||||
),
|
||||
),
|
||||
topControl: const SizedBox.shrink(),
|
||||
backgroundColor: getEnteColorScheme(context).backgroundElevated,
|
||||
// Use current theme (cannot rely on an existing 'theme' variable here)
|
||||
backgroundColor:
|
||||
EnteTheme.getColorScheme(Theme.of(context)).backgroundElevated,
|
||||
barrierColor: backdropFaintDark,
|
||||
enableDrag: true,
|
||||
);
|
||||
@@ -170,6 +172,7 @@ class _CollectionActionSheetState extends State<CollectionActionSheet> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final filesCount = widget.sharedFiles != null
|
||||
? widget.sharedFiles!.length
|
||||
: widget.selectedPeople != null
|
||||
@@ -242,7 +245,7 @@ class _CollectionActionSheetState extends State<CollectionActionSheet> {
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
color: _enableSelection
|
||||
? getEnteColorScheme(context).strokeFaint
|
||||
? EnteTheme.getColorScheme(theme).strokeFaint
|
||||
: Colors.transparent,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -141,8 +141,9 @@ class _CollectionListPageState extends State<CollectionListPage> {
|
||||
}
|
||||
|
||||
Widget _sortMenu(List<Collection> collections) {
|
||||
final colorTheme = getEnteColorScheme(context);
|
||||
final isLightMode = Theme.of(context).brightness == Brightness.light;
|
||||
final theme = Theme.of(context);
|
||||
final colorTheme = EnteTheme.getColorScheme(theme);
|
||||
final isLightMode = !EnteTheme.isDark(theme);
|
||||
Widget sortOptionText(AlbumSortKey key) {
|
||||
String text = key.toString();
|
||||
switch (key) {
|
||||
@@ -174,7 +175,7 @@ class _CollectionListPageState extends State<CollectionListPage> {
|
||||
}
|
||||
|
||||
return Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
data: theme.copyWith(
|
||||
highlightColor: Colors.transparent,
|
||||
splashColor: Colors.transparent,
|
||||
),
|
||||
|
||||
@@ -25,6 +25,7 @@ class DeviceFolderItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final isBackedUp = deviceCollection.shouldBackup;
|
||||
return GestureDetector(
|
||||
child: Column(
|
||||
@@ -43,7 +44,7 @@ class DeviceFolderItem extends StatelessWidget {
|
||||
cornerSmoothing: _cornerSmoothing,
|
||||
),
|
||||
child: Container(
|
||||
color: getEnteColorScheme(context).strokeFaint,
|
||||
color: EnteTheme.getColorScheme(theme).strokeFaint,
|
||||
width: sideOfThumbnail,
|
||||
height: sideOfThumbnail,
|
||||
),
|
||||
@@ -89,7 +90,7 @@ class DeviceFolderItem extends StatelessWidget {
|
||||
child: Text(
|
||||
deviceCollection.name,
|
||||
textAlign: TextAlign.left,
|
||||
style: Theme.of(context).colorScheme.enteTheme.textTheme.small,
|
||||
style: theme.colorScheme.enteTheme.textTheme.small,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
@@ -99,8 +100,7 @@ class DeviceFolderItem extends StatelessWidget {
|
||||
child: Text(
|
||||
deviceCollection.count.toString(),
|
||||
textAlign: TextAlign.left,
|
||||
style:
|
||||
Theme.of(context).colorScheme.enteTheme.textTheme.miniMuted,
|
||||
style: theme.colorScheme.enteTheme.textTheme.miniMuted,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -7,13 +7,14 @@ class BottomShadowWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Container(
|
||||
height: 8,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: shadowColor ?? Theme.of(context).colorScheme.surface,
|
||||
color: shadowColor ?? theme.colorScheme.surface,
|
||||
spreadRadius: 42,
|
||||
blurRadius: 42,
|
||||
offset: Offset(0, offsetDy), // changes position of shadow
|
||||
|
||||
@@ -144,6 +144,7 @@ class _DatePickerFieldState extends State<DatePickerField> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return TextFormField(
|
||||
controller: _controller,
|
||||
onChanged: (value) => _tryParseDate(value),
|
||||
@@ -151,14 +152,14 @@ class _DatePickerFieldState extends State<DatePickerField> {
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
|
||||
borderSide: BorderSide(
|
||||
color: getEnteColorScheme(context).strokeMuted,
|
||||
color: EnteTheme.getColorScheme(theme).strokeMuted,
|
||||
),
|
||||
),
|
||||
fillColor: getEnteColorScheme(context).fillFaint,
|
||||
fillColor: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
filled: true,
|
||||
hintText: widget.hintText ??
|
||||
"Enter date (DD/MM/YYYY)${widget.isRequired ? '' : ' (optional)'}",
|
||||
hintStyle: getEnteTextTheme(context).bodyFaint,
|
||||
hintStyle: EnteTheme.getTextTheme(theme).bodyFaint,
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 14,
|
||||
@@ -171,8 +172,8 @@ class _DatePickerFieldState extends State<DatePickerField> {
|
||||
icon: const Icon(Icons.calendar_today),
|
||||
onPressed: _showDatePicker,
|
||||
color: _hasError
|
||||
? getEnteColorScheme(context).warning500
|
||||
: getEnteColorScheme(context).strokeMuted,
|
||||
? EnteTheme.getColorScheme(theme).warning500
|
||||
: EnteTheme.getColorScheme(theme).strokeMuted,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -19,12 +19,13 @@ class DynamicFAB extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
if (isKeypadOpen!) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
color: theme.colorScheme.surface,
|
||||
spreadRadius: 200,
|
||||
blurRadius: 100,
|
||||
offset: const Offset(0, 230),
|
||||
@@ -37,10 +38,8 @@ class DynamicFAB extends StatelessWidget {
|
||||
children: [
|
||||
FloatingActionButton(
|
||||
heroTag: 'FAB',
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.dynamicFABBackgroundColor,
|
||||
foregroundColor:
|
||||
Theme.of(context).colorScheme.dynamicFABTextColor,
|
||||
backgroundColor: theme.colorScheme.dynamicFABBackgroundColor,
|
||||
foregroundColor: theme.colorScheme.dynamicFABTextColor,
|
||||
onPressed: isFormValid!
|
||||
? onPressedFunction as void Function()?
|
||||
: () {
|
||||
|
||||
@@ -28,6 +28,7 @@ class GradientButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
Widget buttonContent;
|
||||
if (iconData == null) {
|
||||
buttonContent = Text(
|
||||
@@ -73,8 +74,8 @@ class GradientButton extends StatelessWidget {
|
||||
colors: onTap != null
|
||||
? linearGradientColors
|
||||
: [
|
||||
getEnteColorScheme(context).fillMuted,
|
||||
getEnteColorScheme(context).fillMuted,
|
||||
EnteTheme.getColorScheme(theme).fillMuted,
|
||||
EnteTheme.getColorScheme(theme).fillMuted,
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
|
||||
@@ -54,12 +54,13 @@ class LinearProgressDialogState extends State<LinearProgressDialog>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
child: AlertDialog(
|
||||
title: Text(
|
||||
widget.message,
|
||||
style: getEnteTextTheme(context).smallMuted,
|
||||
style: EnteTheme.getTextTheme(theme).smallMuted,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
content: AnimatedBuilder(
|
||||
@@ -68,7 +69,7 @@ class LinearProgressDialogState extends State<LinearProgressDialog>
|
||||
return LinearProgressIndicator(
|
||||
value: _animation.value,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
Theme.of(context).colorScheme.greenAlternative,
|
||||
theme.colorScheme.greenAlternative,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -16,6 +16,7 @@ class EnteLoadingWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Align(
|
||||
alignment: alignment,
|
||||
child: Padding(
|
||||
@@ -25,7 +26,7 @@ class EnteLoadingWidget extends StatelessWidget {
|
||||
child: RepaintBoundary(
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: color ?? getEnteColorScheme(context).strokeBase,
|
||||
color: color ?? EnteTheme.getColorScheme(theme).strokeBase,
|
||||
strokeCap: StrokeCap.round,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -145,7 +145,8 @@ class ContentContainerWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
final bool bodyMissing = body == null && bodyWidget == null;
|
||||
debugPrint("body missing $bodyMissing");
|
||||
return Column(
|
||||
@@ -179,7 +180,7 @@ class ContentContainerWidget extends StatelessWidget {
|
||||
Icons.check_outlined,
|
||||
size: 48,
|
||||
color: isCheckIconGreen
|
||||
? getEnteColorScheme(context).primary700
|
||||
? EnteTheme.getColorScheme(theme).primary700
|
||||
: strokeBaseDark,
|
||||
),
|
||||
actionSheetType == ActionSheetType.defaultActionSheet &&
|
||||
|
||||
@@ -40,7 +40,8 @@ class _BlurMenuItemWidgetState extends State<BlurMenuItemWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
isDisabled = (widget.onTap == null);
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return GestureDetector(
|
||||
onTap: widget.onTap,
|
||||
onTapDown: _onTapDown,
|
||||
@@ -77,12 +78,13 @@ class _BlurMenuItemWidgetState extends State<BlurMenuItemWidget> {
|
||||
widget.labelText!,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
style:
|
||||
getEnteTextTheme(context).bodyBold.copyWith(
|
||||
color: isDisabled
|
||||
? colorScheme.textFaint
|
||||
: colorScheme.blurTextBase,
|
||||
),
|
||||
style: EnteTheme.getTextTheme(theme)
|
||||
.bodyBold
|
||||
.copyWith(
|
||||
color: isDisabled
|
||||
? colorScheme.textFaint
|
||||
: colorScheme.blurTextBase,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -41,7 +41,8 @@ class _ActionBarWidgetState extends State<ActionBarWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
return SizedBox(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 8, 20, 8),
|
||||
|
||||
@@ -34,7 +34,8 @@ class _AlbumActionBarWidgetState extends State<AlbumActionBarWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
return SizedBox(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 8, 20, 8),
|
||||
|
||||
@@ -25,7 +25,8 @@ class AlbumBottomActionBarWidget extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final bottomPadding = MediaQuery.paddingOf(context).bottom;
|
||||
final widthOfScreen = MediaQuery.sizeOf(context).width;
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final double leftRightPadding = widthOfScreen > restrictedMaxWidth
|
||||
? (widthOfScreen - restrictedMaxWidth) / 2
|
||||
: 0;
|
||||
|
||||
@@ -33,7 +33,8 @@ class BottomActionBarWidget extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final bottomPadding = MediaQuery.paddingOf(context).bottom;
|
||||
final widthOfScreen = MediaQuery.of(context).size.width;
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final double leftRightPadding = widthOfScreen > restrictedMaxWidth
|
||||
? (widthOfScreen - restrictedMaxWidth) / 2
|
||||
: 0;
|
||||
|
||||
@@ -34,7 +34,8 @@ class _PeopleActionBarWidgetState extends State<PeopleActionBarWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
return SizedBox(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 8, 20, 8),
|
||||
|
||||
@@ -22,7 +22,8 @@ class PeopleBottomActionBarWidget extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final bottomPadding = MediaQuery.paddingOf(context).bottom;
|
||||
final widthOfScreen = MediaQuery.sizeOf(context).width;
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final double leftRightPadding = widthOfScreen > restrictedMaxWidth
|
||||
? (widthOfScreen - restrictedMaxWidth) / 2
|
||||
: 0;
|
||||
|
||||
@@ -73,7 +73,8 @@ class __BodyState extends State<_Body> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
widthOfButton = getWidthOfButton();
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return GestureDetector(
|
||||
onTap: widget.onTap,
|
||||
onTapDown: (details) {
|
||||
@@ -110,7 +111,7 @@ class __BodyState extends State<_Body> {
|
||||
child: Icon(
|
||||
widget.icon,
|
||||
size: 24,
|
||||
color: getEnteColorScheme(context).primary300,
|
||||
color: EnteTheme.getColorScheme(theme).primary300,
|
||||
shadows: const [
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(12, 0, 179, 60),
|
||||
@@ -137,7 +138,7 @@ class __BodyState extends State<_Body> {
|
||||
SvgPicture.asset(
|
||||
widget.svgAssetPath!,
|
||||
colorFilter: ColorFilter.mode(
|
||||
getEnteColorScheme(context).textMuted,
|
||||
EnteTheme.getColorScheme(theme).textMuted,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
width: 24,
|
||||
@@ -149,14 +150,14 @@ class __BodyState extends State<_Body> {
|
||||
Icon(
|
||||
widget.icon,
|
||||
size: 24,
|
||||
color: getEnteColorScheme(context).textMuted,
|
||||
color: EnteTheme.getColorScheme(theme).textMuted,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
widget.labelText,
|
||||
textAlign: TextAlign.center,
|
||||
//textTheme in [getWidthOfLongestWord] should be same as this
|
||||
style: getEnteTextTheme(context).miniMuted,
|
||||
style: EnteTheme.getTextTheme(theme).miniMuted,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -180,8 +181,10 @@ class __BodyState extends State<_Body> {
|
||||
|
||||
double maxWidth = 0.0;
|
||||
for (String word in words) {
|
||||
final width =
|
||||
computeWidthOfWord(word, getEnteTextTheme(context).miniMuted);
|
||||
final width = computeWidthOfWord(
|
||||
word,
|
||||
EnteTheme.getTextTheme(Theme.of(context)).miniMuted,
|
||||
);
|
||||
if (width > maxWidth) {
|
||||
maxWidth = width;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ class BottomOfTitleBarWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Row(
|
||||
mainAxisAlignment: showCloseButton
|
||||
? MainAxisAlignment.spaceBetween
|
||||
@@ -32,8 +33,8 @@ class BottomOfTitleBarWidget extends StatelessWidget {
|
||||
caption != null
|
||||
? Text(
|
||||
caption!,
|
||||
style: getEnteTextTheme(context).small.copyWith(
|
||||
color: getEnteColorScheme(context).textMuted,
|
||||
style: EnteTheme.getTextTheme(theme).small.copyWith(
|
||||
color: EnteTheme.getColorScheme(theme).textMuted,
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
@@ -45,7 +46,7 @@ class BottomOfTitleBarWidget extends StatelessWidget {
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: getEnteColorScheme(context).strokeFaint,
|
||||
color: EnteTheme.getColorScheme(theme).strokeFaint,
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
|
||||
@@ -87,16 +87,17 @@ class ButtonWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme =
|
||||
shouldStickToDarkTheme ? darkScheme : getEnteColorScheme(context);
|
||||
shouldStickToDarkTheme ? darkScheme : EnteTheme.getColorScheme(theme);
|
||||
final inverseColorScheme = shouldStickToDarkTheme
|
||||
? lightScheme
|
||||
: getEnteColorScheme(context, inverse: true);
|
||||
: EnteTheme.getColorScheme(theme, inverse: true);
|
||||
final textTheme =
|
||||
shouldStickToDarkTheme ? darkTextTheme : getEnteTextTheme(context);
|
||||
shouldStickToDarkTheme ? darkTextTheme : EnteTheme.getTextTheme(theme);
|
||||
final inverseTextTheme = shouldStickToDarkTheme
|
||||
? lightTextTheme
|
||||
: getEnteTextTheme(context, inverse: true);
|
||||
: EnteTheme.getTextTheme(theme, inverse: true);
|
||||
final buttonStyle = CustomButtonStyle(
|
||||
//Dummy default values since we need to keep these properties non-nullable
|
||||
defaultButtonColor: Colors.transparent,
|
||||
|
||||
@@ -17,12 +17,13 @@ class ChipButtonWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return GestureDetector(
|
||||
onTap: onTap?.call,
|
||||
child: Container(
|
||||
width: noChips ? double.infinity : null,
|
||||
decoration: BoxDecoration(
|
||||
color: getEnteColorScheme(context).fillFaint,
|
||||
color: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(4)),
|
||||
),
|
||||
child: Padding(
|
||||
@@ -44,7 +45,7 @@ class ChipButtonWidget extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Text(
|
||||
label!,
|
||||
style: getEnteTextTheme(context).miniBold,
|
||||
style: EnteTheme.getTextTheme(theme).miniBold,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -49,8 +49,9 @@ class _IconButtonWidgetState extends State<IconButtonWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final bool hasPressedState = widget.onTap != null;
|
||||
final colorTheme = getEnteColorScheme(context);
|
||||
final colorTheme = EnteTheme.getColorScheme(theme);
|
||||
iconStateColor ??
|
||||
(iconStateColor = widget.defaultColor ??
|
||||
(widget.iconButtonType == IconButtonType.rounded
|
||||
@@ -99,7 +100,7 @@ class _IconButtonWidgetState extends State<IconButtonWidget> {
|
||||
}
|
||||
|
||||
_onTapDown(details) {
|
||||
final colorTheme = getEnteColorScheme(context);
|
||||
final colorTheme = EnteTheme.getColorScheme(Theme.of(context));
|
||||
setState(() {
|
||||
iconStateColor = widget.pressedColor ??
|
||||
(widget.iconButtonType == IconButtonType.rounded
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import "package:flutter/cupertino.dart";
|
||||
import 'package:flutter/material.dart';
|
||||
import "package:photos/theme/ente_theme.dart";
|
||||
|
||||
class InlineButtonWidget extends StatelessWidget {
|
||||
@@ -9,11 +10,12 @@ class InlineButtonWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return GestureDetector(
|
||||
onTap: onTap?.call,
|
||||
child: Text(
|
||||
label,
|
||||
style: textStyle ?? getEnteTextTheme(context).smallMuted,
|
||||
style: textStyle ?? EnteTheme.getTextTheme(theme).smallMuted,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,9 @@ class CaptionedTextWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final enteColorScheme = Theme.of(context).colorScheme.enteTheme.colorScheme;
|
||||
final enteTextTheme = Theme.of(context).colorScheme.enteTheme.textTheme;
|
||||
final theme = Theme.of(context);
|
||||
final enteColorScheme = theme.colorScheme.enteTheme.colorScheme;
|
||||
final enteTextTheme = theme.colorScheme.enteTheme.textTheme;
|
||||
|
||||
final capitalized = title.capitalizeFirst();
|
||||
|
||||
|
||||
@@ -65,7 +65,8 @@ class DialogWidget extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final widthOfScreen = MediaQuery.of(context).size.width;
|
||||
final isMobileSmall = widthOfScreen <= mobileSmallThreshold;
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return Container(
|
||||
width: min(widthOfScreen, 320),
|
||||
padding: isMobileSmall
|
||||
@@ -110,8 +111,9 @@ class ContentContainer extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
@@ -243,7 +245,8 @@ class _TextInputDialogState extends State<TextInputDialog> {
|
||||
Widget build(BuildContext context) {
|
||||
final widthOfScreen = MediaQuery.sizeOf(context).width;
|
||||
final isMobileSmall = widthOfScreen <= mobileSmallThreshold;
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return Container(
|
||||
width: min(widthOfScreen, 320),
|
||||
padding: isMobileSmall
|
||||
|
||||
@@ -23,15 +23,16 @@ class DividerWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final dividerColor = divColorHasBlur
|
||||
? getEnteColorScheme(context).blurStrokeFaint
|
||||
: getEnteColorScheme(context).strokeFaint;
|
||||
? EnteTheme.getColorScheme(theme).blurStrokeFaint
|
||||
: EnteTheme.getColorScheme(theme).strokeFaint;
|
||||
|
||||
if (dividerType == DividerType.solid) {
|
||||
return Padding(
|
||||
padding: padding ?? EdgeInsets.zero,
|
||||
child: Container(
|
||||
color: getEnteColorScheme(context).strokeFaint,
|
||||
color: EnteTheme.getColorScheme(theme).strokeFaint,
|
||||
width: double.infinity,
|
||||
height: 1,
|
||||
),
|
||||
|
||||
@@ -9,8 +9,9 @@ class EmptyStateItemWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
||||
@@ -20,8 +20,9 @@ class EndToEndBanner extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
|
||||
@@ -42,13 +42,14 @@ class _ExpandableMenuItemWidgetState extends State<ExpandableMenuItemWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final isAnySectionExpanded =
|
||||
InheritedSettingsState.maybeOf(context)?.isAnySectionExpanded ?? false;
|
||||
final isCurrentSectionExpanded = expandableController.expanded;
|
||||
final isSuppressed = isAnySectionExpanded && !isCurrentSectionExpanded;
|
||||
|
||||
final enteColorScheme = Theme.of(context).colorScheme.enteTheme.colorScheme;
|
||||
final backgroundColor = Theme.of(context).brightness == Brightness.light
|
||||
final enteColorScheme = theme.colorScheme.enteTheme.colorScheme;
|
||||
final backgroundColor = theme.brightness == Brightness.light
|
||||
? enteColorScheme.backgroundElevated2
|
||||
: enteColorScheme.backgroundElevated;
|
||||
return Padding(
|
||||
|
||||
@@ -27,14 +27,15 @@ class InfoItemWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final children = <Widget>[];
|
||||
if (title != null) {
|
||||
children.addAll([
|
||||
Text(
|
||||
title!,
|
||||
style: hasChipButtons
|
||||
? getEnteTextTheme(context).miniMuted
|
||||
: getEnteTextTheme(context).small,
|
||||
? EnteTheme.getTextTheme(theme).miniMuted
|
||||
: EnteTheme.getTextTheme(theme).small,
|
||||
),
|
||||
SizedBox(height: hasChipButtons ? 8 : 4),
|
||||
]);
|
||||
@@ -61,7 +62,7 @@ class InfoItemWidget extends StatelessWidget {
|
||||
child = EnteLoadingWidget(
|
||||
padding: biggerSpinner ? 6 : 3,
|
||||
size: biggerSpinner ? 20 : 11,
|
||||
color: getEnteColorScheme(context).strokeMuted,
|
||||
color: EnteTheme.getColorScheme(theme).strokeMuted,
|
||||
alignment:
|
||||
biggerSpinner ? Alignment.center : Alignment.centerLeft,
|
||||
);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import "package:flutter/material.dart";
|
||||
import "package:photos/generated/l10n.dart";
|
||||
import "package:photos/theme/effects.dart";
|
||||
import 'package:photos/theme/ente_theme.dart';
|
||||
@@ -19,8 +20,9 @@ class KeyboardTopButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final enteTheme = getEnteTextTheme(context);
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final enteTheme = EnteTheme.getTextTheme(theme);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
|
||||
@@ -55,7 +55,8 @@ class _TrailingWidgetState extends State<TrailingWidget> {
|
||||
}
|
||||
|
||||
void _executionStateListener() {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
setState(() {
|
||||
if (widget.executionStateNotifier.value == ExecutionState.idle) {
|
||||
_setTrailingIcon();
|
||||
@@ -78,6 +79,7 @@ class _TrailingWidgetState extends State<TrailingWidget> {
|
||||
}
|
||||
|
||||
void _setTrailingIcon() {
|
||||
final theme = Theme.of(context);
|
||||
if (widget.trailingIcon != null) {
|
||||
trailingWidget = Padding(
|
||||
padding: EdgeInsets.only(
|
||||
@@ -86,7 +88,7 @@ class _TrailingWidgetState extends State<TrailingWidget> {
|
||||
child: Icon(
|
||||
widget.trailingIcon,
|
||||
color: widget.trailingIconIsMuted
|
||||
? getEnteColorScheme(context).strokeMuted
|
||||
? EnteTheme.getColorScheme(theme).strokeMuted
|
||||
: widget.trailingIconColor,
|
||||
),
|
||||
);
|
||||
@@ -147,6 +149,7 @@ class LeadingWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(right: 10),
|
||||
child: SizedBox(
|
||||
@@ -164,7 +167,7 @@ class LeadingWidget extends StatelessWidget {
|
||||
child: Icon(
|
||||
leadingIcon,
|
||||
color: leadingIconColor ??
|
||||
getEnteColorScheme(context).strokeBase,
|
||||
EnteTheme.getColorScheme(theme).strokeBase,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -251,6 +251,7 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
|
||||
}
|
||||
|
||||
void _onTapDown(details) {
|
||||
final theme = Theme.of(context);
|
||||
if (executionStateNotifier.value == ExecutionState.inProgress ||
|
||||
executionStateNotifier.value == ExecutionState.successful) {
|
||||
return;
|
||||
@@ -258,7 +259,7 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
|
||||
setState(() {
|
||||
if (widget.pressedColor == null) {
|
||||
hasPassedGestureCallbacks()
|
||||
? menuItemColor = getEnteColorScheme(context).fillFaintPressed
|
||||
? menuItemColor = EnteTheme.getColorScheme(theme).fillFaintPressed
|
||||
: menuItemColor = widget.menuItemColor;
|
||||
} else {
|
||||
menuItemColor = widget.pressedColor;
|
||||
|
||||
@@ -7,14 +7,15 @@ class MenuSectionDescriptionWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 6),
|
||||
child: Text(
|
||||
content,
|
||||
textAlign: TextAlign.left,
|
||||
style: getEnteTextTheme(context)
|
||||
style: EnteTheme.getTextTheme(theme)
|
||||
.mini
|
||||
.copyWith(color: getEnteColorScheme(context).textMuted),
|
||||
.copyWith(color: EnteTheme.getColorScheme(theme).textMuted),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import "package:flutter/material.dart";
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:photos/theme/ente_theme.dart';
|
||||
|
||||
@@ -9,7 +10,8 @@ class MenuSectionTitle extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 8, top: 6, bottom: 6),
|
||||
child: Row(
|
||||
@@ -24,7 +26,7 @@ class MenuSectionTitle extends StatelessWidget {
|
||||
iconData != null ? const SizedBox(width: 8) : const SizedBox.shrink(),
|
||||
Text(
|
||||
title,
|
||||
style: getEnteTextTheme(context).small.copyWith(
|
||||
style: EnteTheme.getTextTheme(theme).small.copyWith(
|
||||
color: colorScheme.textMuted,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -41,8 +41,9 @@ class NotificationWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
EnteTextTheme textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
EnteTextTheme textTheme = EnteTheme.getTextTheme(theme);
|
||||
TextStyle mainTextStyle = this.mainTextStyle ?? darkTextTheme.bodyBold;
|
||||
TextStyle subTextStyle = darkTextTheme.miniMuted;
|
||||
LinearGradient? backgroundGradient;
|
||||
@@ -54,7 +55,7 @@ class NotificationWidget extends StatelessWidget {
|
||||
backgroundColor = warning500;
|
||||
break;
|
||||
case NotificationType.banner:
|
||||
textTheme = getEnteTextTheme(context);
|
||||
textTheme = EnteTheme.getTextTheme(theme);
|
||||
backgroundColor = colorScheme.backgroundElevated2;
|
||||
mainTextStyle = textTheme.bodyBold;
|
||||
subTextStyle = textTheme.miniMuted;
|
||||
@@ -70,26 +71,26 @@ class NotificationWidget extends StatelessWidget {
|
||||
begin: Alignment.bottomCenter,
|
||||
end: Alignment.topCenter,
|
||||
);
|
||||
boxShadow = Theme.of(context).colorScheme.enteTheme.shadowMenu;
|
||||
boxShadow = theme.colorScheme.enteTheme.shadowMenu;
|
||||
break;
|
||||
case NotificationType.greenBanner:
|
||||
backgroundGradient = LinearGradient(
|
||||
colors: [
|
||||
getEnteColorScheme(context).primary700,
|
||||
getEnteColorScheme(context).primary500,
|
||||
EnteTheme.getColorScheme(theme).primary700,
|
||||
EnteTheme.getColorScheme(theme).primary500,
|
||||
],
|
||||
stops: const [0.25, 1],
|
||||
begin: Alignment.bottomCenter,
|
||||
end: Alignment.topCenter,
|
||||
);
|
||||
boxShadow = Theme.of(context).colorScheme.enteTheme.shadowMenu;
|
||||
boxShadow = theme.colorScheme.enteTheme.shadowMenu;
|
||||
break;
|
||||
case NotificationType.notice:
|
||||
backgroundColor = colorScheme.backgroundElevated2;
|
||||
mainTextStyle = textTheme.bodyBold;
|
||||
subTextStyle = textTheme.miniMuted;
|
||||
strokeColorScheme = colorScheme;
|
||||
boxShadow = Theme.of(context).colorScheme.enteTheme.shadowMenu;
|
||||
boxShadow = theme.colorScheme.enteTheme.shadowMenu;
|
||||
break;
|
||||
}
|
||||
return Center(
|
||||
@@ -186,8 +187,9 @@ class NotificationTipWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
return Container(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 12, 12),
|
||||
decoration: BoxDecoration(
|
||||
@@ -223,8 +225,9 @@ class NotificationNoteWidget extends StatelessWidget {
|
||||
const NotificationNoteWidget(this.note, {super.key});
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||
decoration: BoxDecoration(
|
||||
|
||||
@@ -56,7 +56,8 @@ class _SearchableAppBarState extends State<SearchableAppBar> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isLightMode = Theme.of(context).brightness == Brightness.light;
|
||||
final theme = Theme.of(context);
|
||||
final isLightMode = !EnteTheme.isDark(theme);
|
||||
return SliverAppBar(
|
||||
floating: true,
|
||||
elevation: 0,
|
||||
@@ -103,7 +104,8 @@ class _SearchableAppBarState extends State<SearchableAppBar> {
|
||||
}
|
||||
|
||||
Widget _buildSearchField() {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return Container(
|
||||
key: const ValueKey('searchBar'),
|
||||
alignment: Alignment.center,
|
||||
|
||||
@@ -146,8 +146,9 @@ class _TextInputWidgetState extends State<TextInputWidget> {
|
||||
}
|
||||
});
|
||||
}
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
var textInputChildren = <Widget>[];
|
||||
if (widget.label != null) {
|
||||
textInputChildren.add(Text(widget.label!));
|
||||
@@ -438,7 +439,8 @@ class SuffixIconWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Widget? trailingWidget;
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
if (executionState == ExecutionState.idle ||
|
||||
!shouldSurfaceExecutionStates) {
|
||||
if (isClearable) {
|
||||
|
||||
@@ -18,8 +18,9 @@ class TitleBarTitleWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final colorTheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
final colorTheme = EnteTheme.getColorScheme(theme);
|
||||
if (title != null) {
|
||||
late final Widget widget;
|
||||
if (icon != null) {
|
||||
|
||||
@@ -164,7 +164,8 @@ class TitleWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(left: isTitleH2WithoutLeading ? 16 : 0),
|
||||
child: Column(
|
||||
@@ -207,7 +208,8 @@ class FlexibleSpaceBarWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
return FlexibleSpaceBar(
|
||||
background: SafeArea(
|
||||
child: Column(
|
||||
|
||||
@@ -34,7 +34,8 @@ class _ToggleSwitchWidgetState extends State<ToggleSwitchWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final enteColorScheme = Theme.of(context).colorScheme.enteTheme.colorScheme;
|
||||
final theme = Theme.of(context);
|
||||
final enteColorScheme = theme.colorScheme.enteTheme.colorScheme;
|
||||
final Widget stateIcon = _stateIcon(enteColorScheme);
|
||||
|
||||
return Row(
|
||||
|
||||
@@ -50,8 +50,9 @@ class _ApplyCodeScreenState extends State<ApplyCodeScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final textStyle = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final textStyle = EnteTheme.getTextTheme(theme);
|
||||
textFieldFocusNode.requestFocus();
|
||||
return Scaffold(
|
||||
body: CustomScrollView(
|
||||
@@ -153,19 +154,20 @@ class _ApplyCodeScreenState extends State<ApplyCodeScreen> {
|
||||
}
|
||||
|
||||
Widget _getInputField() {
|
||||
final theme = Theme.of(context);
|
||||
return TextFormField(
|
||||
controller: _textController,
|
||||
focusNode: textFieldFocusNode,
|
||||
style: getEnteTextTheme(context).body,
|
||||
style: EnteTheme.getTextTheme(theme).body,
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
textCapitalization: TextCapitalization.sentences,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(4.0)),
|
||||
borderSide:
|
||||
BorderSide(color: getEnteColorScheme(context).strokeMuted),
|
||||
BorderSide(color: EnteTheme.getColorScheme(theme).strokeMuted),
|
||||
),
|
||||
fillColor: getEnteColorScheme(context).fillFaint,
|
||||
fillColor: EnteTheme.getColorScheme(theme).fillFaint,
|
||||
filled: true,
|
||||
hintText: AppLocalizations.of(context).enterReferralCode,
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
|
||||
@@ -22,8 +22,9 @@ class CodeSuccessScreen extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final textStyle = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final textStyle = EnteTheme.getTextTheme(theme);
|
||||
return Scaffold(
|
||||
body: CustomScrollView(
|
||||
primary: false,
|
||||
|
||||
@@ -25,8 +25,9 @@ class ReferralCodeWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final textStyle = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final textStyle = EnteTheme.getTextTheme(theme);
|
||||
return Center(
|
||||
child: Container(
|
||||
color: colorScheme.backgroundElevated2,
|
||||
|
||||
@@ -129,8 +129,9 @@ class ReferralWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final textStyle = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final textStyle = EnteTheme.getTextTheme(theme);
|
||||
final bool isReferralEnabled = referralView.planInfo.isEnabled;
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@@ -32,8 +32,9 @@ class _StorageDetailsScreenState extends State<StorageDetailsScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final textStyle = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final textStyle = EnteTheme.getTextTheme(theme);
|
||||
return Scaffold(
|
||||
body: CustomScrollView(
|
||||
primary: false,
|
||||
@@ -185,8 +186,9 @@ class BonusInfoSection extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final textStyle = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final textStyle = EnteTheme.getTextTheme(theme);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
||||
@@ -27,7 +27,8 @@ class _GrantPermissionsWidgetState extends State<GrantPermissionsWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isLightMode = Theme.of(context).brightness == Brightness.light;
|
||||
final theme = Theme.of(context);
|
||||
final isLightMode = !EnteTheme.isDark(theme);
|
||||
return Scaffold(
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
@@ -91,7 +92,7 @@ class _GrantPermissionsWidgetState extends State<GrantPermissionsWidget> {
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: getEnteColorScheme(context).backgroundBase,
|
||||
color: EnteTheme.getColorScheme(theme).backgroundBase,
|
||||
spreadRadius: 190,
|
||||
blurRadius: 30,
|
||||
offset: const Offset(0, 170),
|
||||
|
||||
@@ -88,9 +88,10 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final bool filesAreSelected = widget.selectedFiles.files.isNotEmpty;
|
||||
final bool albumsAreSelected = widget.selectedAlbums.albums.isNotEmpty;
|
||||
final enteColorScheme = getEnteColorScheme(context);
|
||||
final enteColorScheme = EnteTheme.getColorScheme(theme);
|
||||
|
||||
return SafeArea(
|
||||
child: RepaintBoundary(
|
||||
@@ -109,17 +110,16 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
|
||||
GNav(
|
||||
curve: Curves.easeOutExpo,
|
||||
backgroundColor:
|
||||
getEnteColorScheme(context).backgroundElevated2,
|
||||
EnteTheme.getColorScheme(theme).backgroundElevated2,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
iconSize: 24,
|
||||
padding: const EdgeInsets.fromLTRB(16, 6, 16, 6),
|
||||
duration: const Duration(milliseconds: 200),
|
||||
gap: 0,
|
||||
tabBorderRadius: 32,
|
||||
tabBackgroundColor:
|
||||
Theme.of(context).brightness == Brightness.light
|
||||
? strokeFainterLight
|
||||
: strokeSolidFaintLight,
|
||||
tabBackgroundColor: theme.brightness == Brightness.light
|
||||
? strokeFainterLight
|
||||
: strokeSolidFaintLight,
|
||||
haptic: false,
|
||||
tabs: [
|
||||
GButton(
|
||||
|
||||
@@ -78,6 +78,7 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
|
||||
}
|
||||
|
||||
Widget _getBody() {
|
||||
final theme = Theme.of(context);
|
||||
return Center(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
@@ -128,9 +129,8 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
|
||||
dotsCount: 3,
|
||||
position: _featureIndex,
|
||||
decorator: DotsDecorator(
|
||||
activeColor:
|
||||
Theme.of(context).colorScheme.dotsIndicatorActiveColor,
|
||||
color: Theme.of(context).colorScheme.dotsIndicatorInactiveColor,
|
||||
activeColor: theme.colorScheme.dotsIndicatorActiveColor,
|
||||
color: theme.colorScheme.dotsIndicatorInactiveColor,
|
||||
activeShape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(3),
|
||||
),
|
||||
@@ -153,8 +153,7 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
|
||||
tag: "log_in",
|
||||
child: ElevatedButton(
|
||||
key: const ValueKey("signInButton"),
|
||||
style:
|
||||
Theme.of(context).colorScheme.optionalActionButtonStyle,
|
||||
style: theme.colorScheme.optionalActionButtonStyle,
|
||||
onPressed: _navigateToSignInPage,
|
||||
child: Text(
|
||||
AppLocalizations.of(context).existingUser,
|
||||
@@ -322,6 +321,7 @@ class FeatureItemWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
@@ -336,13 +336,13 @@ class FeatureItemWidget extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
featureTitleFirstLine,
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
style: theme.textTheme.headlineSmall,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const Padding(padding: EdgeInsets.all(2)),
|
||||
Text(
|
||||
featureTitleSecondLine,
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
style: theme.textTheme.headlineSmall,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const Padding(padding: EdgeInsets.all(12)),
|
||||
@@ -350,10 +350,7 @@ class FeatureItemWidget extends StatelessWidget {
|
||||
subText,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
color: theme.colorScheme.onSurface.withValues(alpha: 0.5),
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:photos/events/local_import_progress.dart';
|
||||
import 'package:photos/events/sync_status_update_event.dart';
|
||||
import "package:photos/generated/l10n.dart";
|
||||
import "package:photos/service_locator.dart";
|
||||
import "package:photos/theme/ente_theme.dart";
|
||||
import 'package:photos/ui/common/bottom_shadow.dart';
|
||||
import "package:photos/ui/components/buttons/button_widget.dart";
|
||||
import "package:photos/ui/components/dialog_widget.dart";
|
||||
@@ -110,7 +111,8 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
|
||||
Widget build(BuildContext context) {
|
||||
_loadingMessage ??= AppLocalizations.of(context).loadingYourPhotos;
|
||||
_setupLoadingMessages(context);
|
||||
final isLightMode = Theme.of(context).brightness == Brightness.light;
|
||||
final theme = Theme.of(context);
|
||||
final isLightMode = !EnteTheme.isDark(theme);
|
||||
return Scaffold(
|
||||
body: SingleChildScrollView(
|
||||
child: Center(
|
||||
@@ -147,7 +149,7 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
|
||||
Text(
|
||||
_loadingMessage!,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.subTextColor,
|
||||
color: theme.colorScheme.subTextColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 54),
|
||||
@@ -158,12 +160,9 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context).didYouKnow,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleLarge!
|
||||
.copyWith(
|
||||
color: Theme.of(context).colorScheme.greenText,
|
||||
),
|
||||
style: theme.textTheme.titleLarge!.copyWith(
|
||||
color: theme.colorScheme.greenText,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -178,7 +177,7 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
|
||||
scrollDirection: Axis.vertical,
|
||||
controller: _pageController,
|
||||
itemBuilder: (context, index) {
|
||||
return _getMessage(_messages[index]);
|
||||
return _getMessage(_messages[index], theme);
|
||||
},
|
||||
itemCount: _messages.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
@@ -254,14 +253,12 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
|
||||
_messages.add(AppLocalizations.of(context).loadMessage9);
|
||||
}
|
||||
|
||||
Widget _getMessage(String text) {
|
||||
Widget _getMessage(String text, ThemeData theme) {
|
||||
return Text(
|
||||
text,
|
||||
textAlign: TextAlign.start,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.headlineSmall!
|
||||
.copyWith(color: Theme.of(context).colorScheme.defaultTextColor),
|
||||
style: theme.textTheme.headlineSmall!
|
||||
.copyWith(color: theme.colorScheme.defaultTextColor),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ class _MemoryCoverWidgetState extends State<MemoryCoverWidget> {
|
||||
|
||||
final memory = widget.memories[index];
|
||||
final isSeen = memory.isSeen();
|
||||
final brightness = Theme.of(context).brightness;
|
||||
final ThemeData theme = Theme.of(context);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
@@ -79,7 +79,7 @@ class _MemoryCoverWidgetState extends State<MemoryCoverWidget> {
|
||||
height: widget.height,
|
||||
width: widget.width,
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: brightness == Brightness.dark
|
||||
boxShadow: EnteTheme.isDark(theme)
|
||||
? [
|
||||
const BoxShadow(
|
||||
color: strokeFainterDark,
|
||||
@@ -137,7 +137,7 @@ class _MemoryCoverWidgetState extends State<MemoryCoverWidget> {
|
||||
child: Center(
|
||||
child: Text(
|
||||
title,
|
||||
style: getEnteTextTheme(context)
|
||||
style: EnteTheme.getTextTheme(theme)
|
||||
.miniBold
|
||||
.copyWith(
|
||||
color: isSeen
|
||||
@@ -193,7 +193,7 @@ class _MemoryCoverWidgetState extends State<MemoryCoverWidget> {
|
||||
child: Center(
|
||||
child: Text(
|
||||
title,
|
||||
style: getEnteTextTheme(context)
|
||||
style: EnteTheme.getTextTheme(theme)
|
||||
.miniBold
|
||||
.copyWith(
|
||||
color: Colors.white,
|
||||
|
||||
@@ -95,6 +95,7 @@ class _StatusBarWidgetState extends State<StatusBarWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Column(
|
||||
children: [
|
||||
HomeHeaderWidget(
|
||||
@@ -116,7 +117,7 @@ class _StatusBarWidgetState extends State<StatusBarWidget> {
|
||||
_showErrorBanner
|
||||
? Divider(
|
||||
height: 8,
|
||||
color: getEnteColorScheme(context).strokeFaint,
|
||||
color: EnteTheme.getColorScheme(theme).strokeFaint,
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
_showErrorBanner
|
||||
@@ -319,8 +320,9 @@ class SyncStatusCompletedWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Container(
|
||||
color: Theme.of(context).colorScheme.defaultBackgroundColor,
|
||||
color: theme.colorScheme.defaultBackgroundColor,
|
||||
height: kContainerHeight,
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
@@ -334,7 +336,7 @@ class SyncStatusCompletedWidget extends StatelessWidget {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.cloud_done_outlined,
|
||||
color: Theme.of(context).colorScheme.greenAlternative,
|
||||
color: theme.colorScheme.greenAlternative,
|
||||
size: 22,
|
||||
),
|
||||
Padding(
|
||||
|
||||
@@ -15,7 +15,8 @@ class MapButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return FloatingActionButton(
|
||||
elevation: 2,
|
||||
heroTag: heroTag,
|
||||
|
||||
@@ -20,6 +20,7 @@ class MapGalleryTileBadge extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Positioned(
|
||||
top: 0,
|
||||
right: 0,
|
||||
@@ -36,7 +37,7 @@ class MapGalleryTileBadge extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
formatNumber(size),
|
||||
style: getEnteTextTheme(context).tinyBold,
|
||||
style: EnteTheme.getTextTheme(theme).tinyBold,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -42,6 +42,7 @@ class _MapPullUpGalleryState extends State<MapPullUpGallery> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final Logger logger = Logger("_MapPullUpGalleryState");
|
||||
final screenHeight = MediaQuery.of(context).size.height;
|
||||
final unsafeAreaProportion = widget.bottomUnsafeArea / screenHeight;
|
||||
@@ -80,7 +81,7 @@ class _MapPullUpGalleryState extends State<MapPullUpGallery> {
|
||||
GalleryType.searchResults,
|
||||
_selectedFiles,
|
||||
backgroundColor:
|
||||
getEnteColorScheme(context).backgroundElevated2,
|
||||
EnteTheme.getColorScheme(theme).backgroundElevated2,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -96,8 +97,9 @@ class _MapPullUpGalleryState extends State<MapPullUpGallery> {
|
||||
BuildContext context,
|
||||
logger,
|
||||
) {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(12)),
|
||||
@@ -210,7 +212,8 @@ class DraggableHeader extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return SingleChildScrollView(
|
||||
physics: const ClampingScrollPhysics(),
|
||||
controller: scrollController,
|
||||
|
||||
@@ -214,12 +214,13 @@ class _MapScreenState extends State<MapScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final bottomUnsafeArea = MediaQuery.of(context).padding.bottom;
|
||||
return Container(
|
||||
color: colorScheme.backgroundBase,
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
data: theme.copyWith(
|
||||
bottomSheetTheme: const BottomSheetThemeData(
|
||||
backgroundColor: Colors.transparent,
|
||||
),
|
||||
@@ -253,7 +254,7 @@ class _MapScreenState extends State<MapScreen> {
|
||||
isLoading
|
||||
? EnteLoadingWidget(
|
||||
size: 28,
|
||||
color: getEnteColorScheme(context).primary700,
|
||||
color: EnteTheme.getColorScheme(theme).primary700,
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
],
|
||||
|
||||
@@ -12,7 +12,8 @@ class MarkerImage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bgColor = getEnteColorScheme(context).backgroundElevated2;
|
||||
final theme = Theme.of(context);
|
||||
final bgColor = EnteTheme.getColorScheme(theme).backgroundElevated2;
|
||||
return Container(
|
||||
decoration: BoxDecoration(boxShadow: shadowMenuLight),
|
||||
child: Stack(
|
||||
|
||||
@@ -152,6 +152,7 @@ class MapAttributionWidgetState extends State<MapAttributionWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final persistentAttributionItems = [
|
||||
...List<Widget>.from(
|
||||
widget.attributions.whereType<LogoSourceAttribution>(),
|
||||
@@ -178,7 +179,7 @@ class MapAttributionWidgetState extends State<MapAttributionWidget> {
|
||||
onTap: close,
|
||||
icon: Icons.cancel_outlined,
|
||||
iconButtonType: IconButtonType.primary,
|
||||
iconColor: getEnteColorScheme(context).strokeBase,
|
||||
iconColor: EnteTheme.getColorScheme(theme).strokeBase,
|
||||
))(
|
||||
context,
|
||||
() => setState(() => popupExpanded = false),
|
||||
@@ -221,7 +222,7 @@ class MapAttributionWidgetState extends State<MapAttributionWidget> {
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: widget.popupBackgroundColor ??
|
||||
Theme.of(context).colorScheme.surface,
|
||||
theme.colorScheme.surface,
|
||||
border: Border.all(width: 0, style: BorderStyle.none),
|
||||
borderRadius: widget.popupBorderRadius ??
|
||||
BorderRadius.only(
|
||||
|
||||
@@ -60,12 +60,13 @@ class OSMFranceTileAttributes extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textTheme = getEnteTextTheme(context).tinyBold;
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme).tinyBold;
|
||||
return MapAttributionWidget(
|
||||
alignment: AttributionAlignment.bottomLeft,
|
||||
showFlutterMapAttribution: false,
|
||||
permanentHeight: options.permanentHeight,
|
||||
popupBackgroundColor: getEnteColorScheme(context).backgroundElevated,
|
||||
popupBackgroundColor: EnteTheme.getColorScheme(theme).backgroundElevated,
|
||||
popupBorderRadius: options.popupBorderRadius,
|
||||
iconSize: options.iconSize,
|
||||
attributions: [
|
||||
|
||||
@@ -14,6 +14,7 @@ void showToast(
|
||||
ToastGravity gravity = ToastGravity.BOTTOM,
|
||||
EasyLoadingToastPosition position = EasyLoadingToastPosition.bottom,
|
||||
}) async {
|
||||
final theme = Theme.of(context);
|
||||
if (Platform.isAndroid) {
|
||||
await Fluttertoast.cancel();
|
||||
unawaited(
|
||||
@@ -22,16 +23,16 @@ void showToast(
|
||||
toastLength: toastLength,
|
||||
gravity: gravity,
|
||||
timeInSecForIosWeb: 1,
|
||||
backgroundColor: Theme.of(context).colorScheme.toastBackgroundColor,
|
||||
textColor: Theme.of(context).colorScheme.toastTextColor,
|
||||
backgroundColor: theme.colorScheme.toastBackgroundColor,
|
||||
textColor: theme.colorScheme.toastTextColor,
|
||||
fontSize: 16.0,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
EasyLoading.instance
|
||||
..backgroundColor = Theme.of(context).colorScheme.toastBackgroundColor
|
||||
..indicatorColor = Theme.of(context).colorScheme.toastBackgroundColor
|
||||
..textColor = Theme.of(context).colorScheme.toastTextColor
|
||||
..backgroundColor = theme.colorScheme.toastBackgroundColor
|
||||
..indicatorColor = theme.colorScheme.toastBackgroundColor
|
||||
..textColor = theme.colorScheme.toastTextColor
|
||||
..userInteractions = true
|
||||
..loadingStyle = EasyLoadingStyle.custom;
|
||||
unawaited(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import "package:flutter/material.dart";
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:photos/theme/ente_theme.dart';
|
||||
|
||||
@@ -19,8 +20,9 @@ class ChangeLogEntryWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final enteTheme = getEnteTextTheme(context);
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final enteTheme = EnteTheme.getTextTheme(theme);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
||||
@@ -21,7 +21,8 @@ class ChangeLogPage extends StatefulWidget {
|
||||
class _ChangeLogPageState extends State<ChangeLogPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final enteColorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final enteColorScheme = EnteTheme.getColorScheme(theme);
|
||||
return Scaffold(
|
||||
appBar: null,
|
||||
body: Container(
|
||||
|
||||
@@ -73,8 +73,9 @@ class AddOnViewSection extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final textStyle = getEnteTextTheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = EnteTheme.getColorScheme(theme);
|
||||
final textStyle = EnteTheme.getTextTheme(theme);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
||||
@@ -70,13 +70,14 @@ class FaqWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: ExpansionTileCard(
|
||||
elevation: 0,
|
||||
title: Text(faq!.q!),
|
||||
expandedTextColor: Theme.of(context).colorScheme.greenAlternative,
|
||||
baseColor: Theme.of(context).cardColor,
|
||||
expandedTextColor: theme.colorScheme.greenAlternative,
|
||||
baseColor: theme.cardColor,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
|
||||
@@ -18,6 +18,7 @@ class ChildSubscriptionWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final String familyAdmin = userDetails.familyData!.members!
|
||||
.firstWhere((element) => element.isAdmin)
|
||||
.email;
|
||||
@@ -29,7 +30,7 @@ class ChildSubscriptionWidget extends StatelessWidget {
|
||||
Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context).youAreOnAFamilyPlan,
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
style: theme.textTheme.bodyLarge,
|
||||
),
|
||||
),
|
||||
const Padding(
|
||||
@@ -40,11 +41,11 @@ class ChildSubscriptionWidget extends StatelessWidget {
|
||||
child: StyledText(
|
||||
text:
|
||||
AppLocalizations.of(context).contactFamilyAdmin(familyAdmin),
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
style: theme.textTheme.bodyLarge,
|
||||
tags: {
|
||||
'green': StyledTextTag(
|
||||
style: TextStyle(
|
||||
color: getEnteColorScheme(context).primary500,
|
||||
color: EnteTheme.getColorScheme(theme).primary500,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -94,7 +95,7 @@ class ChildSubscriptionWidget extends StatelessWidget {
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(context)
|
||||
.pleaseContactSupportAndWeWillBeHappyToHelp,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
style: theme.textTheme.bodyMedium,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -141,6 +141,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
|
||||
|
||||
// show dialog to handle accidental back press.
|
||||
Future<bool> _buildPageExitWidget(BuildContext context) async {
|
||||
final theme = Theme.of(context);
|
||||
final result = await showDialog(
|
||||
useRootNavigator: false,
|
||||
context: context,
|
||||
@@ -160,7 +161,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
|
||||
child: Text(
|
||||
AppLocalizations.of(context).no,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.greenAlternative,
|
||||
color: theme.colorScheme.greenAlternative,
|
||||
),
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
@@ -252,6 +253,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
|
||||
|
||||
// warn the user to wait for sometime before trying another payment
|
||||
Future<dynamic> _showExitPageDialog({String? title, String? content}) {
|
||||
final theme = Theme.of(context);
|
||||
return showDialog(
|
||||
useRootNavigator: false,
|
||||
context: context,
|
||||
@@ -264,7 +266,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
|
||||
child: Text(
|
||||
AppLocalizations.of(context).ok,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.greenAlternative,
|
||||
color: theme.colorScheme.greenAlternative,
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
|
||||
@@ -158,8 +158,9 @@ class _StoreSubscriptionPageState extends State<StoreSubscriptionPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final textTheme = getEnteTextTheme(context);
|
||||
colorScheme = getEnteColorScheme(context);
|
||||
final theme = Theme.of(context);
|
||||
final textTheme = EnteTheme.getTextTheme(theme);
|
||||
colorScheme = EnteTheme.getColorScheme(theme);
|
||||
if (!_isLoading) {
|
||||
_isLoading = true;
|
||||
_fetchSubData();
|
||||
@@ -313,7 +314,7 @@ class _StoreSubscriptionPageState extends State<StoreSubscriptionPage> {
|
||||
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 20),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).visitWebToManage,
|
||||
style: getEnteTextTheme(context).small.copyWith(
|
||||
style: EnteTheme.getTextTheme(Theme.of(context)).small.copyWith(
|
||||
color: colorScheme.textMuted,
|
||||
),
|
||||
),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user