forked from AppFlowy-IO/AppFlowy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: upload custom theme issue (AppFlowy-IO#4317)
* fix: FlowyDynamicPlugin encode issue * chore: improve the default theme color * fix: learn more button text invisiable * fix: fix read the wrong theme mode file * fix: prevent current custom theme being deleted * chore: improve theme upload UI and error prompts * chore: delete unnecessary LocaleKeys
- Loading branch information
Showing
12 changed files
with
131 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...pflowy_flutter/lib/workspace/presentation/settings/widgets/theme_upload/theme_upload.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export 'theme_confirm_delete_dialog.dart'; | ||
export 'theme_upload_button.dart'; | ||
export 'theme_upload_learn_more_button.dart'; | ||
export 'theme_upload_decoration.dart'; | ||
export 'theme_upload_failure_widget.dart'; | ||
export 'theme_upload_loading_widget.dart'; | ||
export 'theme_upload_view.dart'; | ||
export 'upload_new_theme_widget.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
.../workspace/presentation/settings/widgets/theme_upload/theme_upload_learn_more_button.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import 'package:appflowy/generated/locale_keys.g.dart'; | ||
import 'package:appflowy/workspace/presentation/settings/widgets/theme_upload/theme_upload_view.dart'; | ||
import 'package:appflowy/workspace/presentation/widgets/dialogs.dart'; | ||
import 'package:easy_localization/easy_localization.dart'; | ||
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; | ||
import 'package:flowy_infra_ui/widget/buttons/secondary_button.dart'; | ||
import 'package:flowy_infra_ui/widget/error_page.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
|
||
class ThemeUploadLearnMoreButton extends StatelessWidget { | ||
const ThemeUploadLearnMoreButton({super.key}); | ||
|
||
static const learnMoreURL = | ||
'https://appflowy.gitbook.io/docs/essential-documentation/themes'; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return SizedBox( | ||
height: ThemeUploadWidget.buttonSize.height, | ||
child: IntrinsicWidth( | ||
child: SecondaryButton( | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 8), | ||
child: FlowyText.medium( | ||
fontSize: ThemeUploadWidget.buttonFontSize, | ||
LocaleKeys.document_plugins_autoGeneratorLearnMore.tr(), | ||
), | ||
), | ||
onPressed: () async { | ||
final uri = Uri.parse(learnMoreURL); | ||
if (await canLaunchUrl(uri)) { | ||
await launchUrl(uri); | ||
} else { | ||
if (context.mounted) { | ||
Dialogs.show( | ||
context, | ||
child: FlowyDialog( | ||
child: FlowyErrorPage.message( | ||
LocaleKeys | ||
.settings_appearance_themeUpload_urlUploadFailure | ||
.tr() | ||
.replaceAll( | ||
'{}', | ||
uri.toString(), | ||
), | ||
howToFix: LocaleKeys.errorDialog_howToFixFallback.tr(), | ||
), | ||
), | ||
); | ||
} | ||
} | ||
}, | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters