|
@@ -1,5 +1,5 @@
|
|
|
import 'package:flutter/material.dart';
|
|
|
-import "package:photos/generated/l10n.dart";
|
|
|
+import "package:photos/l10n/l10n.dart";
|
|
|
import 'package:photos/services/user_service.dart';
|
|
|
import 'package:photos/utils/dialog_util.dart';
|
|
|
import 'package:photos/utils/email_util.dart';
|
|
@@ -16,20 +16,21 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
+ final l10n = context.l10n;
|
|
|
return AlertDialog(
|
|
|
- title: Text(S.of(context).enterYourEmailAddress),
|
|
|
+ title: Text(l10n.enterYourEmailAddress),
|
|
|
content: SingleChildScrollView(
|
|
|
child: Column(
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
TextFormField(
|
|
|
- decoration: const InputDecoration(
|
|
|
- hintText: S.of(context).email,
|
|
|
- hintStyle: TextStyle(
|
|
|
+ decoration: InputDecoration(
|
|
|
+ hintText: l10n.email,
|
|
|
+ hintStyle: const TextStyle(
|
|
|
color: Colors.white30,
|
|
|
),
|
|
|
- contentPadding: EdgeInsets.all(12),
|
|
|
+ contentPadding: const EdgeInsets.all(12),
|
|
|
),
|
|
|
onChanged: (value) {
|
|
|
setState(() {
|
|
@@ -46,9 +47,9 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
|
|
|
),
|
|
|
actions: [
|
|
|
TextButton(
|
|
|
- child: const Text(
|
|
|
- S.of(context).cancel,
|
|
|
- style: TextStyle(
|
|
|
+ child: Text(
|
|
|
+ l10n.cancel,
|
|
|
+ style: const TextStyle(
|
|
|
color: Colors.redAccent,
|
|
|
),
|
|
|
),
|
|
@@ -57,9 +58,9 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
|
|
|
},
|
|
|
),
|
|
|
TextButton(
|
|
|
- child: const Text(
|
|
|
- S.of(context).verify,
|
|
|
- style: TextStyle(
|
|
|
+ child: Text(
|
|
|
+ l10n.verify,
|
|
|
+ style: const TextStyle(
|
|
|
color: Colors.green,
|
|
|
),
|
|
|
),
|
|
@@ -67,7 +68,7 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
|
|
|
if (!isValidEmail(_email)) {
|
|
|
showErrorDialog(
|
|
|
context,
|
|
|
- S.of(context).invalidEmailAddress,
|
|
|
+ l10n.invalidEmailAddress,
|
|
|
"Please enter a valid email address.",
|
|
|
);
|
|
|
return;
|