resolved merge conflicts
This commit is contained in:
commit
2e5fc17d15
|
@ -96,8 +96,13 @@ final darkThemeData = ThemeData(
|
|||
hintColor: Colors.grey,
|
||||
bottomAppBarColor: Color.fromRGBO(196, 196, 196, 0.5),
|
||||
|
||||
<<<<<<< HEAD
|
||||
colorScheme: ColorScheme.dark(secondary: Color.fromARGB(255, 92, 92, 92)),
|
||||
accentColor: Color.fromRGBO(255, 255, 255, 0.6),
|
||||
=======
|
||||
colorScheme: ColorScheme.dark(primary: Colors.white),
|
||||
accentColor: Color.fromRGBO(45, 194, 98, 0.2),
|
||||
>>>>>>> redesign
|
||||
buttonColor: Color.fromRGBO(45, 194, 98, 1.0),
|
||||
buttonTheme: ButtonThemeData().copyWith(
|
||||
buttonColor: Color.fromRGBO(45, 194, 98, 1.0),
|
||||
|
|
|
@ -863,10 +863,10 @@ class FilesDB {
|
|||
return count;
|
||||
}
|
||||
|
||||
Future<int> fileCountWithVisibility(int visibility) async {
|
||||
Future<int> fileCountWithVisibility(int visibility, int ownerID) async {
|
||||
final db = await instance.database;
|
||||
var count = Sqflite.firstIntValue(await db.rawQuery(
|
||||
'SELECT COUNT(*) FROM $table where $columnMMdVisibility = $visibility'));
|
||||
'SELECT COUNT(*) FROM $table where $columnMMdVisibility = $visibility AND $columnOwnerID = $ownerID'));
|
||||
return count;
|
||||
}
|
||||
|
||||
|
|
|
@ -776,10 +776,7 @@ class CollectionsService {
|
|||
name = utf8.decode(result);
|
||||
} catch (e, s) {
|
||||
_logger.severe(
|
||||
"Error while decrypting collection name: " +
|
||||
collection.id.toString(),
|
||||
e,
|
||||
s);
|
||||
"failed to decrypt collection name: ${collection.id}", e, s);
|
||||
name = "Unknown Album";
|
||||
}
|
||||
return collection.copyWith(name: name);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:open_file/open_file.dart';
|
||||
import 'package:photos/core/configuration.dart';
|
||||
|
@ -38,7 +37,7 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
|
|||
),
|
||||
),
|
||||
Padding(padding: EdgeInsets.all(8)),
|
||||
Text("changelog",
|
||||
Text("Changelog",
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
)),
|
||||
|
@ -53,7 +52,7 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
|
|||
height: 64,
|
||||
padding: const EdgeInsets.fromLTRB(50, 0, 50, 0),
|
||||
child: button(
|
||||
"update",
|
||||
"Update",
|
||||
fontSize: 16,
|
||||
onPressed: () async {
|
||||
Navigator.pop(context);
|
||||
|
@ -75,8 +74,8 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
|
|||
onWillPop: () async => !shouldForceUpdate,
|
||||
child: AlertDialog(
|
||||
title: Text(shouldForceUpdate
|
||||
? "critical update available"
|
||||
: "update available"),
|
||||
? "Critical update available"
|
||||
: "Update available"),
|
||||
content: content,
|
||||
),
|
||||
);
|
||||
|
|
|
@ -29,7 +29,7 @@ class BillingQuestionsWidget extends StatelessWidget {
|
|||
faqs.add(Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Text(
|
||||
"faqs",
|
||||
"FAQs",
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
|
|
@ -16,7 +16,7 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text("enter your email address"),
|
||||
title: Text("Enter your email address"),
|
||||
content: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
|
@ -46,7 +46,7 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
|
|||
actions: [
|
||||
TextButton(
|
||||
child: Text(
|
||||
"cancel",
|
||||
"Cancel",
|
||||
style: TextStyle(
|
||||
color: Colors.redAccent,
|
||||
),
|
||||
|
@ -57,15 +57,15 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
|
|||
),
|
||||
TextButton(
|
||||
child: Text(
|
||||
"verify",
|
||||
"Verify",
|
||||
style: TextStyle(
|
||||
color: Colors.green,
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
if (!isValidEmail(_email)) {
|
||||
showErrorDialog(context, "invalid email address",
|
||||
"please enter a valid email address.");
|
||||
showErrorDialog(context, "Invalid email address",
|
||||
"Please enter a valid email address.");
|
||||
return;
|
||||
}
|
||||
UserService.instance.getOtt(context, _email, isChangeEmail: true);
|
||||
|
|
|
@ -335,7 +335,8 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
|
|||
FutureBuilder<int>(
|
||||
future: FilesDB.instance
|
||||
.fileCountWithVisibility(
|
||||
kVisibilityArchive),
|
||||
kVisibilityArchive,
|
||||
Configuration.instance.getUserID()),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData && snapshot.data > 0) {
|
||||
return RichText(
|
||||
|
|
|
@ -10,7 +10,7 @@ PopupMenuButton<dynamic> reportBugPopupMenu(BuildContext context) {
|
|||
value: 1,
|
||||
child: Row(
|
||||
children: const [
|
||||
Text("contact support"),
|
||||
Text("Contact support"),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -19,7 +19,7 @@ PopupMenuButton<dynamic> reportBugPopupMenu(BuildContext context) {
|
|||
},
|
||||
onSelected: (value) async {
|
||||
if (value == 1) {
|
||||
await sendLogs(context, "contact support", "support@ente.io",
|
||||
await sendLogs(context, "Contact support", "support@ente.io",
|
||||
postShare: () {});
|
||||
}
|
||||
},
|
||||
|
|
|
@ -6,7 +6,7 @@ Widget nothingToSeeHere({Color textColor}) {
|
|||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
"nothing to see here! 👀",
|
||||
"Nothing to see here! 👀",
|
||||
style: TextStyle(
|
||||
fontFamily: "Inter",
|
||||
color: textColor.withOpacity(0.35),
|
||||
|
|
|
@ -24,13 +24,13 @@ String _actionName(CollectionActionType type, bool plural) {
|
|||
String text = "";
|
||||
switch (type) {
|
||||
case CollectionActionType.addFiles:
|
||||
text = "add file";
|
||||
text = "Add file";
|
||||
break;
|
||||
case CollectionActionType.moveFiles:
|
||||
text = "move file";
|
||||
text = "Move file";
|
||||
break;
|
||||
case CollectionActionType.restoreFiles:
|
||||
text = "restore file";
|
||||
text = "Restore file";
|
||||
break;
|
||||
}
|
||||
return text + titleSuffix;
|
||||
|
@ -280,7 +280,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
|
|||
return true;
|
||||
} on AssertionError catch (e, s) {
|
||||
await dialog.hide();
|
||||
showErrorDialog(context, "oops", e.message);
|
||||
showErrorDialog(context, "Oops", e.message);
|
||||
return false;
|
||||
} catch (e, s) {
|
||||
_logger.severe("Could not move to album", e, s);
|
||||
|
@ -291,7 +291,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
|
|||
}
|
||||
|
||||
Future<bool> _restoreFilesToCollection(int toCollectionID) async {
|
||||
final dialog = createProgressDialog(context, "restoring files...");
|
||||
final dialog = createProgressDialog(context, "Restoring files...");
|
||||
await dialog.show();
|
||||
try {
|
||||
await CollectionsService.instance
|
||||
|
@ -302,7 +302,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
|
|||
return true;
|
||||
} on AssertionError catch (e, s) {
|
||||
await dialog.hide();
|
||||
showErrorDialog(context, "oops", e.message);
|
||||
showErrorDialog(context, "Oops", e.message);
|
||||
return false;
|
||||
} catch (e, s) {
|
||||
_logger.severe("Could not move to album", e, s);
|
||||
|
|
|
@ -270,10 +270,10 @@ class _DetailPageState extends State<DetailPage> {
|
|||
_logger.severe("Attempt to edit unowned file", UnauthorizedEditError(),
|
||||
StackTrace.current);
|
||||
showErrorDialog(context, "Sorry",
|
||||
"we don't support editing photos and albums that you don't own yet");
|
||||
"We don't support editing photos and albums that you don't own yet");
|
||||
return;
|
||||
}
|
||||
final dialog = createProgressDialog(context, "please wait...");
|
||||
final dialog = createProgressDialog(context, "Please wait...");
|
||||
await dialog.show();
|
||||
final imageProvider =
|
||||
ExtendedFileImageProvider(await getFile(file), cacheRawData: true);
|
||||
|
|
|
@ -557,7 +557,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebPage("terms", "https://ente.io/terms");
|
||||
return WebPage("Terms", "https://ente.io/terms");
|
||||
},
|
||||
),
|
||||
);
|
||||
|
@ -575,7 +575,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|||
MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebPage(
|
||||
"privacy", "https://ente.io/privacy");
|
||||
"Privacy", "https://ente.io/privacy");
|
||||
},
|
||||
),
|
||||
);
|
||||
|
@ -709,7 +709,7 @@ class PricingWidget extends StatelessWidget {
|
|||
if (snapshot.hasData) {
|
||||
return _buildPlans(context, snapshot.data);
|
||||
} else if (snapshot.hasError) {
|
||||
return Text("Oops, something went wrong.");
|
||||
return Text("Oops, Something went wrong.");
|
||||
}
|
||||
return loadWidget;
|
||||
},
|
||||
|
|
|
@ -62,7 +62,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
|
|||
List<Widget> children = [];
|
||||
children.add(
|
||||
Tooltip(
|
||||
message: "info",
|
||||
message: "Info",
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 12, bottom: 12),
|
||||
child: IconButton(
|
||||
|
@ -85,7 +85,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
|
|||
widget.file.fileType == FileType.livePhoto) {
|
||||
children.add(
|
||||
Tooltip(
|
||||
message: "edit",
|
||||
message: "Edit",
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 12, bottom: 12),
|
||||
child: IconButton(
|
||||
|
@ -107,7 +107,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
|
|||
widget.file.magicMetadata.visibility == kVisibilityArchive;
|
||||
children.add(
|
||||
Tooltip(
|
||||
message: isArchived ? "unarchive" : "archive",
|
||||
message: isArchived ? "Unhide" : "Hide",
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 12, bottom: 12),
|
||||
child: IconButton(
|
||||
|
@ -132,7 +132,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
|
|||
}
|
||||
children.add(
|
||||
Tooltip(
|
||||
message: "share",
|
||||
message: "Share",
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 12, bottom: 12),
|
||||
child: IconButton(
|
||||
|
@ -181,7 +181,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
|
|||
void _addTrashOptions(List<Widget> children) {
|
||||
children.add(
|
||||
Tooltip(
|
||||
message: "restore",
|
||||
message: "Restore",
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 12, bottom: 12),
|
||||
child: IconButton(
|
||||
|
@ -206,7 +206,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
|
|||
|
||||
children.add(
|
||||
Tooltip(
|
||||
message: "delete",
|
||||
message: "Delete",
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 12, bottom: 12),
|
||||
child: IconButton(
|
||||
|
|
|
@ -189,7 +189,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
|
|||
|
||||
Future<void> _showShareCollectionDialog() async {
|
||||
var collection = widget.collection;
|
||||
final dialog = createProgressDialog(context, "please wait...");
|
||||
final dialog = createProgressDialog(context, "Please wait...");
|
||||
await dialog.show();
|
||||
try {
|
||||
if (collection == null) {
|
||||
|
|
|
@ -351,7 +351,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
|
|||
widget.type == GalleryType.archive) {
|
||||
bool showArchive = widget.type == GalleryType.homepage;
|
||||
actions.add(Tooltip(
|
||||
message: showArchive ? "archive" : "unarchive",
|
||||
message: showArchive ? "Hide" : "Unhide",
|
||||
child: IconButton(
|
||||
color: Colors.black, //same for both themes
|
||||
icon: Icon(
|
||||
|
@ -369,7 +369,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
|
|||
|
||||
void _addTrashAction(List<Widget> actions) {
|
||||
actions.add(Tooltip(
|
||||
message: "restore",
|
||||
message: "Restore",
|
||||
child: IconButton(
|
||||
color: Colors.black, //same for both themes
|
||||
icon: Icon(
|
||||
|
|
|
@ -124,19 +124,19 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||
_triggerLogoutEvent =
|
||||
Bus.instance.on<TriggerLogoutEvent>().listen((event) async {
|
||||
AlertDialog alert = AlertDialog(
|
||||
title: Text("session expired"),
|
||||
content: Text("please login again"),
|
||||
title: Text("Session expired"),
|
||||
content: Text("Please login again"),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: Text(
|
||||
"ok",
|
||||
"Ok",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).buttonColor,
|
||||
),
|
||||
),
|
||||
onPressed: () async {
|
||||
Navigator.of(context, rootNavigator: true).pop('dialog');
|
||||
final dialog = createProgressDialog(context, "logging out...");
|
||||
final dialog = createProgressDialog(context, "Logging out...");
|
||||
await dialog.show();
|
||||
await Configuration.instance.logout();
|
||||
await dialog.hide();
|
||||
|
|
|
@ -377,7 +377,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
|
|||
),
|
||||
);
|
||||
} catch (e, s) {
|
||||
showToast("oops, could not save edits");
|
||||
showToast("Oops, could not save edits");
|
||||
_logger.severe(e, s);
|
||||
}
|
||||
await dialog.hide();
|
||||
|
|
|
@ -413,12 +413,12 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
|
|||
|
||||
Future<void> _updateUrlSettings(
|
||||
BuildContext context, Map<String, dynamic> prop) async {
|
||||
final dialog = createProgressDialog(context, "please wait...");
|
||||
final dialog = createProgressDialog(context, "Please wait...");
|
||||
await dialog.show();
|
||||
try {
|
||||
await CollectionsService.instance.updateShareUrl(widget.collection, prop);
|
||||
await dialog.hide();
|
||||
showToast("album updated");
|
||||
showToast("Album updated");
|
||||
} catch (e) {
|
||||
await dialog.hide();
|
||||
await showGenericErrorDialog(context);
|
||||
|
|
|
@ -186,7 +186,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
|||
UserService.instance.getOtt(context, widget.email,
|
||||
isCreateAccountScreen: widget.isCreateAccountScreen);
|
||||
},
|
||||
child: Text("resend email",
|
||||
child: Text("Resend email",
|
||||
style: Theme.of(context).textTheme.subtitle1.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration
|
||||
|
|
|
@ -661,7 +661,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
Configuration.instance.setVolatilePassword(null);
|
||||
await dialog.hide();
|
||||
onDone() async {
|
||||
final dialog = createProgressDialog(context, "please wait...");
|
||||
final dialog = createProgressDialog(context, "Please wait...");
|
||||
await dialog.show();
|
||||
try {
|
||||
await UserService.instance.setAttributes(result);
|
||||
|
|
|
@ -60,7 +60,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
|||
isFormValid: _passwordController.text.isNotEmpty,
|
||||
buttonText: 'Log in',
|
||||
onPressedFunction: () async {
|
||||
final dialog = createProgressDialog(context, "please wait...");
|
||||
final dialog = createProgressDialog(context, "Please wait...");
|
||||
await dialog.show();
|
||||
try {
|
||||
await Configuration.instance.decryptAndSaveSecrets(
|
||||
|
@ -173,7 +173,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
|||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () async {
|
||||
final dialog =
|
||||
createProgressDialog(context, "please wait...");
|
||||
createProgressDialog(context, "Please wait...");
|
||||
await dialog.show();
|
||||
await Configuration.instance.logout();
|
||||
await dialog.hide();
|
||||
|
@ -182,7 +182,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
|||
},
|
||||
child: Container(
|
||||
child: Center(
|
||||
child: Text("change email",
|
||||
child: Text("Change email",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.subtitle1
|
||||
|
@ -208,7 +208,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
|||
// onPressed: _passwordController.text.isNotEmpty
|
||||
// ? () async {
|
||||
// final dialog =
|
||||
// createProgressDialog(context, "please wait...");
|
||||
// createProgressDialog(context, "Please wait...");
|
||||
// await dialog.show();
|
||||
// try {
|
||||
// await Configuration.instance.decryptAndSaveSecrets(
|
||||
|
|
|
@ -125,17 +125,17 @@ class ChildSubscriptionWidget extends StatelessWidget {
|
|||
Future<void> _leaveFamilyPlan(BuildContext context) async {
|
||||
final choice = await showChoiceDialog(
|
||||
context,
|
||||
'leave family',
|
||||
'are you sure that you want to leave the family plan?',
|
||||
firstAction: 'no',
|
||||
secondAction: 'yes',
|
||||
'Leave family',
|
||||
'Are you sure that you want to leave the family plan?',
|
||||
firstAction: 'No',
|
||||
secondAction: 'Yes',
|
||||
firstActionColor: Theme.of(context).buttonColor,
|
||||
secondActionColor: Colors.white,
|
||||
);
|
||||
if (choice != DialogUserChoice.secondChoice) {
|
||||
return;
|
||||
}
|
||||
final dialog = createProgressDialog(context, "please wait...");
|
||||
final dialog = createProgressDialog(context, "Please wait...");
|
||||
await dialog.show();
|
||||
try {
|
||||
await UserService.instance.leaveFamilyPlan();
|
||||
|
|
|
@ -47,7 +47,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
_dialog = createProgressDialog(context, "please wait...");
|
||||
_dialog = createProgressDialog(context, "Please wait...");
|
||||
if (initPaymentUrl == null) {
|
||||
return loadWidget;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
|
|||
onWillPop: () async => _buildPageExitWidget(context),
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('subscription'),
|
||||
title: const Text('Subscription'),
|
||||
),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
|
|
|
@ -121,7 +121,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
Widget _getBody() {
|
||||
if (!_isLoading) {
|
||||
_isLoading = true;
|
||||
_dialog = createProgressDialog(context, "please wait...");
|
||||
_dialog = createProgressDialog(context, "Please wait...");
|
||||
_fetchSub();
|
||||
}
|
||||
if (_hasLoadedData) {
|
||||
|
|
|
@ -129,7 +129,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
|
|||
_isLoading = true;
|
||||
_fetchSubData();
|
||||
}
|
||||
_dialog = createProgressDialog(context, "please wait...");
|
||||
_dialog = createProgressDialog(context, "Please wait...");
|
||||
final appBar = AppBar(
|
||||
title: Text("Subscription"),
|
||||
);
|
||||
|
|
|
@ -108,7 +108,7 @@ class _SessionsPageState extends State<SessionsPage> {
|
|||
}
|
||||
|
||||
Future<void> _terminateSession(Session session) async {
|
||||
final dialog = createProgressDialog(context, "please wait...");
|
||||
final dialog = createProgressDialog(context, "Please wait...");
|
||||
await dialog.show();
|
||||
try {
|
||||
await UserService.instance.terminateSession(session.token);
|
||||
|
@ -118,7 +118,7 @@ class _SessionsPageState extends State<SessionsPage> {
|
|||
await dialog.hide();
|
||||
_logger.severe('failed to terminate', e, s);
|
||||
showErrorDialog(
|
||||
context, 'oops', "something went wrong, please try again");
|
||||
context, 'Oops', "Something went wrong, please try again");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class _SetWallpaperDialogState extends State<SetWallpaperDialog> {
|
|||
} catch (e, s) {
|
||||
await dialog.hide();
|
||||
Logger("SetWallpaperDialog").severe(e, s);
|
||||
showToast("something went wrong");
|
||||
showToast("Something went wrong");
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
|
|
@ -50,7 +50,7 @@ class _AppVersionWidgetState extends State<AppVersionWidget> {
|
|||
return Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Text(
|
||||
"app version: " + snapshot.data,
|
||||
"Version: " + snapshot.data,
|
||||
style: Theme.of(context).textTheme.caption,
|
||||
),
|
||||
);
|
||||
|
|
|
@ -61,6 +61,7 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
|
|||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage("assets/card_background.png"),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -26,7 +26,7 @@ class SecuritySectionWidget extends StatefulWidget {
|
|||
|
||||
class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
|
||||
static const kAuthToViewSessions =
|
||||
"please authenticate to view your active sessions";
|
||||
"Please authenticate to view your active sessions";
|
||||
|
||||
final _config = Configuration.instance;
|
||||
|
||||
|
@ -70,7 +70,10 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
|
|||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Two-factor", style: Theme.of(context).textTheme.subtitle1,),
|
||||
Text(
|
||||
"Two-factor",
|
||||
style: Theme.of(context).textTheme.subtitle1,
|
||||
),
|
||||
FutureBuilder(
|
||||
future: UserService.instance.fetchTwoFactorStatus(),
|
||||
builder: (_, snapshot) {
|
||||
|
@ -117,7 +120,10 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
|
|||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Lockscreen", style: Theme.of(context).textTheme.subtitle1,),
|
||||
Text(
|
||||
"Lockscreen",
|
||||
style: Theme.of(context).textTheme.subtitle1,
|
||||
),
|
||||
Switch.adaptive(
|
||||
value: _config.shouldShowLockScreen(),
|
||||
onChanged: (value) async {
|
||||
|
@ -147,7 +153,8 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
|
|||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Hide from recents", style: Theme.of(context).textTheme.subtitle1),
|
||||
Text("Hide from recents",
|
||||
style: Theme.of(context).textTheme.subtitle1),
|
||||
Switch.adaptive(
|
||||
value: _config.shouldHideFromRecents(),
|
||||
onChanged: (value) async {
|
||||
|
|
|
@ -71,10 +71,15 @@ class SettingsPage extends StatelessWidget {
|
|||
DangerSectionWidget(),
|
||||
]);
|
||||
}
|
||||
contents.add(AppVersionWidget());
|
||||
|
||||
if (kDebugMode && hasLoggedIn) {
|
||||
contents.add(DebugSectionWidget());
|
||||
contents.addAll([sectionDivider, DebugSectionWidget()]);
|
||||
}
|
||||
contents.add(AppVersionWidget());
|
||||
contents.add(Padding(
|
||||
padding: EdgeInsets.only(bottom: 60),
|
||||
));
|
||||
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 20),
|
||||
|
|
|
@ -314,19 +314,19 @@ class _SharingDialogState extends State<SharingDialog> {
|
|||
String publicKey,
|
||||
}) async {
|
||||
if (!isValidEmail(email)) {
|
||||
showErrorDialog(context, "invalid email address",
|
||||
"please enter a valid email address.");
|
||||
showErrorDialog(context, "Invalid email address",
|
||||
"Please enter a valid email address.");
|
||||
return;
|
||||
} else if (email == Configuration.instance.getEmail()) {
|
||||
showErrorDialog(context, "oops", "you cannot share with yourself");
|
||||
showErrorDialog(context, "Oops", "You cannot share with yourself");
|
||||
return;
|
||||
} else if (widget.collection.sharees.any((user) => user.email == email)) {
|
||||
showErrorDialog(
|
||||
context, "oops", "you're already sharing this with " + email);
|
||||
context, "Oops", "You're already sharing this with " + email);
|
||||
return;
|
||||
}
|
||||
if (publicKey == null) {
|
||||
final dialog = createProgressDialog(context, "searching for user...");
|
||||
final dialog = createProgressDialog(context, "Searching for user...");
|
||||
await dialog.show();
|
||||
|
||||
publicKey = await UserService.instance.getPublicKey(email);
|
||||
|
@ -335,9 +335,9 @@ class _SharingDialogState extends State<SharingDialog> {
|
|||
if (publicKey == null) {
|
||||
Navigator.of(context, rootNavigator: true).pop('dialog');
|
||||
final dialog = AlertDialog(
|
||||
title: Text("invite to ente?"),
|
||||
title: Text("Invite to ente?"),
|
||||
content: Text(
|
||||
"looks like " +
|
||||
"Looks like " +
|
||||
email +
|
||||
" hasn't signed up for ente yet. would you like to invite them?",
|
||||
style: TextStyle(
|
||||
|
@ -347,7 +347,7 @@ class _SharingDialogState extends State<SharingDialog> {
|
|||
actions: [
|
||||
TextButton(
|
||||
child: Text(
|
||||
"invite",
|
||||
"Invite",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).buttonColor,
|
||||
),
|
||||
|
@ -366,7 +366,7 @@ class _SharingDialogState extends State<SharingDialog> {
|
|||
},
|
||||
);
|
||||
} else {
|
||||
final dialog = createProgressDialog(context, "sharing...");
|
||||
final dialog = createProgressDialog(context, "Sharing...");
|
||||
await dialog.show();
|
||||
final collection = widget.collection;
|
||||
try {
|
||||
|
@ -380,7 +380,7 @@ class _SharingDialogState extends State<SharingDialog> {
|
|||
await CollectionsService.instance
|
||||
.share(widget.collection.id, email, publicKey);
|
||||
await dialog.hide();
|
||||
showToast("shared successfully!");
|
||||
showShortToast("Shared successfully!");
|
||||
setState(() {
|
||||
_sharees.add(User(email: email));
|
||||
_showEntryField = false;
|
||||
|
|
|
@ -3,7 +3,6 @@ import 'dart:ui';
|
|||
|
||||
import 'package:confetti/confetti.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:photos/ui/loading_widget.dart';
|
||||
import 'package:photos/ui/progress_dialog.dart';
|
||||
|
||||
|
@ -36,7 +35,7 @@ Future<dynamic> showErrorDialog(
|
|||
actions: [
|
||||
TextButton(
|
||||
child: Text(
|
||||
"OK",
|
||||
"Ok",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
|
@ -61,7 +60,7 @@ Future<dynamic> showErrorDialog(
|
|||
}
|
||||
|
||||
Future<dynamic> showGenericErrorDialog(BuildContext context) {
|
||||
return showErrorDialog(context, "something went wrong", "please try again.");
|
||||
return showErrorDialog(context, "Something went wrong", "Please try again.");
|
||||
}
|
||||
|
||||
Future<T> showConfettiDialog<T>({
|
||||
|
@ -92,7 +91,8 @@ Future<T> showConfettiDialog<T>({
|
|||
confettiController: _confettiController,
|
||||
blastDirection: pi / 2,
|
||||
emissionFrequency: 0,
|
||||
numberOfParticles: 100, // a lot of particles at once
|
||||
numberOfParticles: 100,
|
||||
// a lot of particles at once
|
||||
gravity: 1,
|
||||
blastDirectionality: BlastDirectionality.explosive,
|
||||
),
|
||||
|
@ -107,128 +107,3 @@ Future<T> showConfettiDialog<T>({
|
|||
routeSettings: routeSettings,
|
||||
);
|
||||
}
|
||||
|
||||
Widget test() {
|
||||
return Container(
|
||||
width: 355,
|
||||
height: 236,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 355,
|
||||
height: 236,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
color: Color(0x4c000000),
|
||||
),
|
||||
padding: const EdgeInsets.only(
|
||||
top: 20,
|
||||
bottom: 16,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 234,
|
||||
child: Text(
|
||||
"Are you sure you want to logout?",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 24,
|
||||
fontFamily: "SF Pro Display",
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Container(
|
||||
width: 323,
|
||||
height: 48,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 323,
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
color: Color(0x4c000000),
|
||||
),
|
||||
padding: const EdgeInsets.only(
|
||||
left: 135,
|
||||
right: 136,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Cancel",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontFamily: "SF Pro Text",
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Container(
|
||||
width: 323,
|
||||
height: 48,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 323,
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
color: Colors.white,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 120,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Yes Logout",
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 16,
|
||||
fontFamily: "SF Pro Text",
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -18,13 +18,13 @@ final _logger = Logger('MagicUtil');
|
|||
Future<void> changeVisibility(
|
||||
BuildContext context, List<File> files, int newVisibility) async {
|
||||
final dialog = createProgressDialog(context,
|
||||
newVisibility == kVisibilityArchive ? "archiving..." : "unarchiving...");
|
||||
newVisibility == kVisibilityArchive ? "Hiding..." : "Unhiding...");
|
||||
await dialog.show();
|
||||
try {
|
||||
await FileMagicService.instance.changeVisibility(files, newVisibility);
|
||||
showShortToast(newVisibility == kVisibilityArchive
|
||||
? "successfully archived"
|
||||
: "successfully unarchived");
|
||||
? "Successfully hidden"
|
||||
: "Successfully unhidden");
|
||||
|
||||
await dialog.hide();
|
||||
} catch (e, s) {
|
||||
|
@ -37,7 +37,7 @@ Future<void> changeVisibility(
|
|||
Future<void> changeCollectionVisibility(
|
||||
BuildContext context, Collection collection, int newVisibility) async {
|
||||
final dialog = createProgressDialog(context,
|
||||
newVisibility == kVisibilityArchive ? "archiving..." : "unarchiving...");
|
||||
newVisibility == kVisibilityArchive ? "Hiding..." : "Unhiding...");
|
||||
await dialog.show();
|
||||
try {
|
||||
Map<String, dynamic> update = {kMagicKeyVisibility: newVisibility};
|
||||
|
@ -45,8 +45,8 @@ Future<void> changeCollectionVisibility(
|
|||
// Force reload home gallery to pull in the now unarchived files
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent());
|
||||
showShortToast(newVisibility == kVisibilityArchive
|
||||
? "successfully archived"
|
||||
: "successfully unarchived");
|
||||
? "Successfully hidden"
|
||||
: "Successfully unhidden");
|
||||
|
||||
await dialog.hide();
|
||||
} catch (e, s) {
|
||||
|
|
Loading…
Reference in a new issue