diff --git a/docs/zh-cn/docs/guide/ability.md b/docs/zh-cn/docs/guide/ability.md index c885b47..3539625 100644 --- a/docs/zh-cn/docs/guide/ability.md +++ b/docs/zh-cn/docs/guide/ability.md @@ -5,7 +5,7 @@ - 文章 - [ ] 根据选择的主题来渲染 markdown, 并将起呈现在 preview, - - [ ] 需要优化 preview + - [x] 需要优化 preview - [ ] 可以根据主题提供的配置类自定义渲染 markdown - 渲染 - [x] 使用 Jinja2 来渲染模板文件 diff --git a/lib/components/Common/drawer_editor.dart b/lib/components/Common/drawer_editor.dart index 562fbbb..4647b03 100644 --- a/lib/components/Common/drawer_editor.dart +++ b/lib/components/Common/drawer_editor.dart @@ -130,20 +130,17 @@ abstract class DrawerEditorState extends State { /// 包装字段 Widget wrapperField({required Widget child, String? name}) { - return Container( - margin: kTopPadding8 * 2.25, - child: Column( + final padding = kTopPadding8.flipped; + if (name != null) { + child = Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (name != null) - Padding( - padding: kTopPadding8.flipped, - child: Text(name.tr), - ), + Padding(padding: padding, child: Text(name.tr)), child, ], - ), - ); + ); + } + return Container(margin: padding * 2.25, child: child); } /// 关闭或者取消 diff --git a/lib/components/post/content.dart b/lib/components/post/content.dart index aa3fb79..d130eae 100644 --- a/lib/components/post/content.dart +++ b/lib/components/post/content.dart @@ -42,7 +42,7 @@ class PostContent extends StatelessWidget { @override Widget build(BuildContext context) { final theme = Theme.of(Get.context!); - final style = theme.textTheme.bodyMedium; + final style = theme.textTheme.bodyMedium?.apply(fontSizeFactor: 1.1); return CodeEditor( scrollbarBuilder: buildScrollbar, controller: controller, diff --git a/lib/components/post/preview.dart b/lib/components/post/preview.dart index 2e2e2d7..ab2b52f 100644 --- a/lib/components/post/preview.dart +++ b/lib/components/post/preview.dart @@ -1,84 +1,126 @@ import 'package:flutter/material.dart'; -import 'package:get/get.dart' show Get, GetNavigationExt, Inst; -import 'package:glidea/controller/site/site.dart'; +import 'package:flutter_markdown/flutter_markdown.dart' show MarkdownBody, MarkdownStyleSheet; +import 'package:flutter_markdown_latex/flutter_markdown_latex.dart' show LatexElementBuilder; +import 'package:glidea/components/Common/drawer_editor.dart'; import 'package:glidea/helpers/constants.dart'; import 'package:glidea/helpers/date.dart'; +import 'package:glidea/helpers/image.dart'; import 'package:glidea/helpers/markdown.dart'; import 'package:glidea/models/post.dart'; -import 'package:markdown_widget/markdown_widget.dart' show MarkdownConfig, MarkdownGenerator, MarkdownWidget; -class PostPreview extends StatefulWidget { - const PostPreview({super.key, required this.entity, required this.markdown}); - - /// 实体 - final Post entity; +/// 预览 [Post] +class PostPreview extends DrawerEditor { + const PostPreview({ + super.key, + required super.entity, + super.controller, + super.header = '', + super.showAction = false, + required this.markdown, + }); /// markdown 内容 final String markdown; @override - State createState() => _PostPreviewState(); + DrawerEditorState createState() => _PostPreviewState(); } -class _PostPreviewState extends State { - /// 站点控制器 - final site = Get.find(tag: SiteController.tag); +class _PostPreviewState extends DrawerEditorState { + /// 时间文本 + late final dateText = widget.entity.date.format(pattern: site.themeConfig.dateFormat); + + /// 时间文本的样式 + late final dateStyle = theme.textTheme.bodyMedium?.copyWith(color: theme.colorScheme.outline); + + /// 定义要为哪些 Markdown 元素使用哪些 TextStyle 对象 + late final MarkdownStyleSheet styleSheet = createStyle(); - /// 主题颜色 - late final theme = Theme.of(Get.context!); + /// 构建控件的函数集合 + late final _buildFun = >{ + _buildFeature, + _buildTitle, + _buildDate, + if (widget.entity.tags.isNotEmpty) _buildTags, + _buildView, + }; @override - Widget build(BuildContext context) { - // TODO: 改善性能 - 使用 WebView 或者其它方式, 添加 Latex 支持 - final colorScheme = theme.colorScheme; - final textTheme = theme.textTheme; - final post = widget.entity; - final dateStr = post.date.format(pattern: site.themeConfig.dateFormat); - final dateStyle = textTheme.bodyMedium?.copyWith(color: colorScheme.outline); - // 控件 - final List children = [ - ImageConfig.builderImg(site.getFeaturePath(widget.entity)), - Text(post.title, style: textTheme.headlineSmall), - Text(dateStr, style: dateStyle), - if (post.tags.isNotEmpty) - Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - for (var tag in site.getTagsWithPost(post)) - Container( - padding: kVerPadding4 + kHorPadding8, - decoration: BoxDecoration( - color: colorScheme.onInverseSurface, - borderRadius: const BorderRadius.all(Radius.circular(20)), - ), - child: Text(tag.name, style: textTheme.bodySmall), - ), - ], - ), - MarkdownWidget( - data: widget.markdown ?? '', - shrinkWrap: true, - config: MarkdownConfig(configs: [ - const ImageConfig(), - ]), - markdownGenerator: MarkdownGenerator( - extensionSet: Markdown.custom, - textGenerator: CustomTextNode.new, - ), - ), - ]; - // 返回 - return Column( + Widget? buildContent(BuildContext context, int index) { + final child = _buildFun.elementAtOrNull(index)?.call(); + return child != null ? wrapperField(child: child) : null; + } + + /// 封面 + Widget _buildFeature() => ImageConfig.builderImg(site.getFeaturePath(widget.entity)); + + /// 标题 + Widget _buildTitle() => Text(widget.entity.title, style: theme.textTheme.headlineMedium); + + /// 创建时间 + Widget _buildDate() => Text(dateText, style: dateStyle); + + /// 构建标签 + Widget _buildTags() { + return Row( + spacing: kHorPadding8.right, mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisAlignment: MainAxisAlignment.start, children: [ - for (var i = 0; i < children.length; i++) - Padding( - padding: i <= 0 ? kTopPadding8 : kTopPadding16, - child: children[i], + for (var tag in site.getTagsWithPost(widget.entity)) + DecoratedBox( + decoration: BoxDecoration( + color: theme.colorScheme.onInverseSurface, + borderRadius: const BorderRadius.all(Radius.circular(20)), + ), + child: Padding( + padding: kVerPadding4 + kHorPadding8, + child: Text(tag.name, style: theme.textTheme.bodySmall), + ), ), ], ); } + + /// 构建 MarkDown 视图 + Widget _buildView() { + return MarkdownBody( + selectable: true, + fitContent: false, + data: widget.markdown, + styleSheet: styleSheet, + builders: { + 'latex': LatexElementBuilder( + textStyle: theme.textTheme.bodyMedium, + textScaleFactor: 1.2, + ), + }, + extensionSet: Markdown.custom, + ); + } + + /// 创建样式 + MarkdownStyleSheet createStyle() { + var style = MarkdownStyleSheet.fromTheme(theme); + style = style.copyWith( + pPadding: kVerPadding4, + h1Padding: kVerPadding4, + h2Padding: kVerPadding4, + h3Padding: kVerPadding4, + h4Padding: kVerPadding4, + h5Padding: kVerPadding4, + h6Padding: kVerPadding4, + code: style.code?.copyWith(fontSize: style.p?.fontSize), + codeblockDecoration: BoxDecoration( + color: theme.colorScheme.surfaceContainerHigh, + borderRadius: BorderRadius.circular(2.0), + ), + blockquoteDecoration: BoxDecoration( + color: theme.secondaryHeaderColor, //Colors.blue.shade100, + borderRadius: BorderRadius.circular(2.0), + ), + textScaler: const TextScaler.linear(1.1), + ); + return style; + } } diff --git a/lib/components/render/base.dart b/lib/components/render/base.dart index 4339712..5e91bb1 100644 --- a/lib/components/render/base.dart +++ b/lib/components/render/base.dart @@ -16,7 +16,7 @@ import 'package:glidea/helpers/constants.dart'; import 'package:glidea/helpers/fs.dart'; import 'package:glidea/helpers/get.dart'; import 'package:glidea/helpers/json.dart'; -import 'package:glidea/helpers/markdown.dart'; +import 'package:glidea/helpers/image.dart'; import 'package:glidea/interfaces/types.dart'; import 'package:glidea/models/render.dart'; import 'package:phosphor_flutter/phosphor_flutter.dart' show PhosphorIconsRegular; diff --git a/lib/helpers/constants.dart b/lib/helpers/constants.dart index 5e99135..6f60a77 100644 --- a/lib/helpers/constants.dart +++ b/lib/helpers/constants.dart @@ -20,7 +20,7 @@ const tagsTemplate = 'tags.j2'; const tagTemplate = 'tag.j2'; /// 加载 [Post] 中的本地图片的前缀 -const String featurePrefix = 'file://'; +const String featurePrefix = 'file:///'; /// 摘要分隔符 const String summarySeparator = ''; diff --git a/lib/helpers/image.dart b/lib/helpers/image.dart index c007610..c9415ba 100644 --- a/lib/helpers/image.dart +++ b/lib/helpers/image.dart @@ -1,6 +1,8 @@ import 'dart:io' show File; import 'package:flutter/material.dart'; +import 'package:glidea/helpers/constants.dart'; +import 'package:glidea/helpers/image.dart'; import 'package:image/image.dart' as img show Image, copyResize, encodeJpg, writeFile, decodeImageFile; /// 扩展 FileImage, 在图片变化时可以进行更新, 包括路径变化、大小变化等 @@ -45,7 +47,35 @@ extension ImageExt on img.Image { /// 将 [path] 的图片复制压缩到 [target] static Future compress(String path, String target) async { var image = await img.decodeImageFile(path); - if(image == null) return false; + if (image == null) return false; return await image.compressImage(target); } } + +/// config class for image, tag: img +class ImageConfig { + /// 构建图片 + static Widget builderImg(String url, {Map? attributes, BoxFit fit = BoxFit.cover}) { + if (url.isEmpty) { + return Image.asset('assets/images/upload_image.jpg', errorBuilder: buildError); + } + // 网络图片 + if (url.startsWith('http')) { + return Image.network(url, fit: fit, errorBuilder: buildError); + } + // 网络图片 + if (url.startsWith('assets')) { + Image.asset(url, fit: fit, errorBuilder: buildError); + } + // post 中的本地图片 + if (url.startsWith(featurePrefix)) { + url = url.substring(featurePrefix.length); + } + return Image(image: FileImageExpansion.file(url), fit: fit, errorBuilder: buildError); + } + + /// 图片加载失败时的占位图 + static Widget buildError(BuildContext context, Object error, StackTrace? stacktrace) { + return Image.asset('assets/images/loading_error.png'); + } +} diff --git a/lib/helpers/markdown.dart b/lib/helpers/markdown.dart index 5cf1e04..8141f25 100644 --- a/lib/helpers/markdown.dart +++ b/lib/helpers/markdown.dart @@ -1,13 +1,8 @@ -import 'dart:io'; - -import 'package:flutter/material.dart'; -import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart' show HtmlWidget; -import 'package:glidea/helpers/constants.dart'; -import 'package:glidea/helpers/image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_markdown_latex/flutter_markdown_latex.dart' show LatexBlockSyntax, LatexInlineSyntax; import 'package:glidea/helpers/uid.dart'; import 'package:markdown/markdown.dart' as m show HeaderSyntax, Node, BlockParser, SetextHeaderSyntax, Element, ExtensionSet, Resolver, BlockSyntax, renderToHtml, Document, InlineSyntax; -import 'package:markdown_widget/markdown_widget.dart' show ElementNode, ImgConfig, MarkdownConfig, SpanNode, TextNode, WidgetVisitor; /// 解析 ajax 样式的头,并将生成的id添加到生成的元素中 /// @@ -58,8 +53,9 @@ class Markdown { const HeaderWithId(), const SetextHeaderWithId(), ...m.ExtensionSet.gitHubWeb.blockSyntaxes.skip(3), + LatexBlockSyntax(), ], - m.ExtensionSet.gitHubWeb.inlineSyntaxes, + [...m.ExtensionSet.gitHubWeb.inlineSyntaxes, LatexInlineSyntax()], ); /// 将给定的 Markdown 字符串转换为HTML @@ -118,102 +114,3 @@ class Markdown { return '${m.renderToHtml(nodes, enableTagfilter: enableTagFilter)}\n'; } } - -class CustomTextNode extends ElementNode { - final m.Node element; - - //final String nodeText; - final MarkdownConfig config; - final WidgetVisitor visitor; - bool isHtml = false; - static final RegExp tableRep = RegExp(r']*>', multiLine: true, caseSensitive: true); - - static final RegExp htmlRep = RegExp(r'<[^>]*>', multiLine: true, caseSensitive: true); - - CustomTextNode(this.element, this.config, this.visitor); - - @override - InlineSpan build() { - try { - // HTML - if (isHtml) { - return WidgetSpan(child: buildHtml()); - } - return super.build(); - } catch (e) { - // 文本样式 - final textStyle = config.p.textStyle.merge(parentStyle); - // 显示文本 - return TextSpan(children: [ - TextNode(text: element.textContent, style: textStyle).build(), - ]); - } - } - - @override - void onAccepted(SpanNode parent) { - String nodeText = element.textContent; - - children.clear(); - // 没有 html 元素 - isHtml = nodeText.contains(htmlRep); - if (isHtml) { - accept(parent); - } - if (!isHtml) { - // 文本样式 - final textStyle = config.p.textStyle.merge(parentStyle); - accept(TextNode(text: nodeText, style: textStyle)); - } - } - - /// 构建 HTML - Widget buildHtml() { - return HtmlWidget( - element.textContent, - customStylesBuilder: (el) { - switch (el.localName) { - case 'table': - return {'border': '1px solid', 'border-collapse': 'collapse'}; - case 'th': - case 'td': - return {'border': '1px solid', 'padding': '8px'}; - } - return null; - }, - ); - } -} - -/// config class for image, tag: img -class ImageConfig extends ImgConfig { - const ImageConfig({super.builder = _defaultBuildImg, super.errorBuilder}); - - /// 默认构建图片 - static Widget _defaultBuildImg(String url, Map? attributes) => builderImg(url, attributes: attributes); - - /// 构建图片 - static Widget builderImg(String url, {Map? attributes, BoxFit fit = BoxFit.cover}) { - if (url.isEmpty) { - return Image.asset('assets/images/upload_image.jpg', errorBuilder: buildError); - } - // 网络图片 - if (url.startsWith('http')) { - return Image.network(url, fit: fit, errorBuilder: buildError); - } - // 网络图片 - if (url.startsWith('assets')) { - Image.asset(url, fit: fit, errorBuilder: buildError); - } - // post 中的本地图片 - if (url.startsWith(featurePrefix)) { - url = url.substring(featurePrefix.length); - } - return Image(image: FileImageExpansion.file(url), fit: fit, errorBuilder: buildError); - } - - /// 图片加载失败时的占位图 - static Widget buildError(BuildContext context, Object error, StackTrace? stacktrace) { - return Image.asset('assets/images/loading_error.png'); - } -} diff --git a/lib/views/articles.dart b/lib/views/articles.dart index 01151b3..7f9571e 100644 --- a/lib/views/articles.dart +++ b/lib/views/articles.dart @@ -8,7 +8,7 @@ import 'package:glidea/controller/site/site.dart'; import 'package:glidea/helpers/constants.dart'; import 'package:glidea/helpers/date.dart'; import 'package:glidea/helpers/get.dart'; -import 'package:glidea/helpers/markdown.dart'; +import 'package:glidea/helpers/image.dart'; import 'package:glidea/lang/base.dart'; import 'package:glidea/models/post.dart'; import 'package:glidea/routes/router.dart'; diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 38c0298..07cfede 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -7,7 +7,6 @@ import Foundation import device_info_plus import emoji_picker_flutter -import flutter_inappwebview_macos import package_info_plus import path_provider_foundation import screen_retriever_macos @@ -18,7 +17,6 @@ import window_manager func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) EmojiPickerFlutterPlugin.register(with: registry.registrar(forPlugin: "EmojiPickerFlutterPlugin")) - InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin")) diff --git a/pubspec.lock b/pubspec.lock index f45dd8a..0d5fde6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -22,14 +22,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "6.11.0" - animations: - dependency: "direct main" - description: - name: animations - sha256: d3d6dcfb218225bbe68e87ccf6378bbb2e32a94900722c5f81611dad089911cb - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.11" ansicolor: dependency: transitive description: @@ -42,10 +34,10 @@ packages: dependency: "direct main" description: name: archive - sha256: "08064924cbf0ab88280a0c3f60db9dd24fec693927e725ecb176f16c629d1cb8" + sha256: "6199c74e3db4fbfbd04f66d739e72fe11c8a8957d5f219f1f4482dbde6420b5a" url: "https://pub.flutter-io.cn" source: hosted - version: "4.0.1" + version: "4.0.2" args: dependency: transitive description: @@ -90,34 +82,34 @@ packages: dependency: transitive description: name: build - sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.1" + version: "2.4.2" build_config: dependency: transitive description: name: build_config - sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.1" + version: "1.1.2" build_daemon: dependency: transitive description: name: build_daemon - sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" + sha256: "294a2edaf4814a378725bfe6358210196f5ea37af89ecd81bfa32960113d4948" url: "https://pub.flutter-io.cn" source: hosted - version: "4.0.2" + version: "4.0.3" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + sha256: "99d3980049739a985cf9b21f30881f46db3ebc62c5b8d5e60e27440876b1ba1e" url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.2" + version: "2.4.3" build_runner: dependency: "direct dev" description: @@ -146,10 +138,10 @@ packages: dependency: transitive description: name: built_value - sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb + sha256: "28a712df2576b63c6c005c465989a348604960c0958d28be5303ba9baa841ac2" url: "https://pub.flutter-io.cn" source: hosted - version: "8.9.2" + version: "8.9.3" characters: dependency: transitive description: @@ -271,13 +263,13 @@ packages: source: hosted version: "7.0.2" device_preview_plus: - dependency: "direct main" + dependency: "direct dev" description: name: device_preview_plus - sha256: "371df40c906f9d88e206ce83bc1cac045899d2df1464c7bb4a6e8e73dbbe7855" + sha256: "206e2607cfe0755e070f0b49e25efeb0e9618ee9c9a7d0554f7761b24939f03f" url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "2.2.3" dio: dependency: "direct main" description: @@ -298,18 +290,18 @@ packages: dependency: "direct main" description: name: elegant_notification - sha256: "9f1bb972c37f313aabf03f41b0d444c4f959dd126d175b71cf1e98c76df96007" + sha256: "4439f045ba21c931316bc1dce731f59d59e0ec4167971639e040ad7e5d96ba9f" url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.0" + version: "2.4.1" emoji_picker_flutter: dependency: "direct main" description: name: emoji_picker_flutter - sha256: "08567e6f914d36c32091a96cf2f51d2558c47aa2bd47a590dc4f50e42e0965f6" + sha256: "63dee6be976c51c8b971eccbc73fc637f021b6b679eed1b2ec3b503947304734" url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.0" + version: "4.2.0" equatable: dependency: transitive description: @@ -326,14 +318,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" - feedback: - dependency: "direct main" - description: - name: feedback - sha256: "26769f73de6215add72074d24e4a23542e4c02a8fd1a873e7c93da5dc9c1d362" - url: "https://pub.flutter-io.cn" - source: hosted - version: "3.1.0" ffi: dependency: transitive description: @@ -354,10 +338,10 @@ packages: dependency: "direct main" description: name: file_picker - sha256: c2376a6aae82358a9f9ccdd7d1f4006d08faa39a2767cce01031d9f593a8bd3b + sha256: c904b4ab56d53385563c7c39d8e9fa9af086f91495dfc48717ad84a42c3cf204 url: "https://pub.flutter-io.cn" source: hosted - version: "8.1.6" + version: "8.1.7" fixnum: dependency: transitive description: @@ -370,26 +354,26 @@ packages: dependency: "direct main" description: name: flex_color_picker - sha256: "12dc855ae8ef5491f529b1fc52c655f06dcdf4114f1f7fdecafa41eec2ec8d79" + sha256: c083b79f1c57eaeed9f464368be376951230b3cb1876323b784626152a86e480 url: "https://pub.flutter-io.cn" source: hosted - version: "3.6.0" + version: "3.7.0" flex_color_scheme: dependency: "direct main" description: name: flex_color_scheme - sha256: "90f4fe67b9561ae8a4af117df65a8ce9988624025667c54e6d304e65cff77d52" + sha256: "09bea5d776f694c5a67f2229f2aa500cc7cce369322dc6500ab01cf9ad1b4e1a" url: "https://pub.flutter-io.cn" source: hosted - version: "8.0.2" + version: "8.1.0" flex_seed_scheme: dependency: transitive description: name: flex_seed_scheme - sha256: "7639d2c86268eff84a909026eb169f008064af0fb3696a651b24b0fa24a40334" + sha256: d3ba3c5c92d2d79d45e94b4c6c71d01fac3c15017da1545880c53864da5dfeb0 url: "https://pub.flutter-io.cn" source: hosted - version: "3.4.1" + version: "3.5.0" flutter: dependency: "direct main" description: flutter @@ -408,107 +392,67 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_highlight: - dependency: transitive + flutter_lints: + dependency: "direct dev" description: - name: flutter_highlight - sha256: "7b96333867aa07e122e245c033b8ad622e4e3a42a1a2372cbb098a2541d8782c" + name: flutter_lints + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" url: "https://pub.flutter-io.cn" source: hosted - version: "0.7.0" - flutter_inappwebview: + version: "5.0.0" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_markdown: dependency: "direct main" description: - name: flutter_inappwebview - sha256: "80092d13d3e29b6227e25b67973c67c7210bd5e35c4b747ca908e31eb71a46d5" - url: "https://pub.flutter-io.cn" - source: hosted - version: "6.1.5" - flutter_inappwebview_android: - dependency: transitive - description: - name: flutter_inappwebview_android - sha256: "62557c15a5c2db5d195cb3892aab74fcaec266d7b86d59a6f0027abd672cddba" - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.1.3" - flutter_inappwebview_internal_annotations: - dependency: transitive - description: - name: flutter_inappwebview_internal_annotations - sha256: "787171d43f8af67864740b6f04166c13190aa74a1468a1f1f1e9ee5b90c359cd" - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.2.0" - flutter_inappwebview_ios: - dependency: transitive - description: - name: flutter_inappwebview_ios - sha256: "5818cf9b26cf0cbb0f62ff50772217d41ea8d3d9cc00279c45f8aabaa1b4025d" - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.1.2" - flutter_inappwebview_macos: - dependency: transitive - description: - name: flutter_inappwebview_macos - sha256: c1fbb86af1a3738e3541364d7d1866315ffb0468a1a77e34198c9be571287da1 - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.1.2" - flutter_inappwebview_platform_interface: - dependency: transitive - description: - name: flutter_inappwebview_platform_interface - sha256: cf5323e194096b6ede7a1ca808c3e0a078e4b33cc3f6338977d75b4024ba2500 + name: flutter_markdown + sha256: e37f4c69a07b07bb92622ef6b131a53c9aae48f64b176340af9e8e5238718487 url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0+1" - flutter_inappwebview_web: - dependency: transitive + version: "0.7.5" + flutter_markdown_latex: + dependency: "direct main" description: - name: flutter_inappwebview_web - sha256: "55f89c83b0a0d3b7893306b3bb545ba4770a4df018204917148ebb42dc14a598" + name: flutter_markdown_latex + sha256: "839e76a84abb3632ffcebbd450cf93c7e9894af65622527d23f0084cee1bfd04" url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.2" - flutter_inappwebview_windows: + version: "0.3.4" + flutter_math_fork: dependency: transitive description: - name: flutter_inappwebview_windows - sha256: "8b4d3a46078a2cdc636c4a3d10d10f2a16882f6be607962dbfff8874d1642055" + name: flutter_math_fork + sha256: "284bab89b2fbf1bc3a0baf13d011c1dd324d004e35d177626b77f2fc056366ac" url: "https://pub.flutter-io.cn" source: hosted - version: "0.6.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" - url: "https://pub.flutter-io.cn" - source: hosted - version: "4.0.0" - flutter_localizations: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" + version: "0.7.3" flutter_native_splash: dependency: "direct dev" description: name: flutter_native_splash - sha256: "1152ab0067ca5a2ebeb862fe0a762057202cceb22b7e62692dcbabf6483891bb" + sha256: "7062602e0dbd29141fb8eb19220b5871ca650be5197ab9c1f193a28b17537bc7" url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.3" + version: "2.4.4" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "9b78450b89f059e96c9ebb355fa6b3df1d6b330436e0b885fb49594c41721398" + sha256: "615a505aef59b151b46bbeef55b36ce2b6ed299d160c51d84281946f0aa0ce0e" url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.23" + version: "2.0.24" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + sha256: c200fd79c918a40c5cd50ea0877fa13f81bdaf6f0a5d3dbcc2a13e3285d6aa1b + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.17" flutter_test: dependency: "direct dev" description: flutter @@ -519,14 +463,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_widget_from_html_core: - dependency: "direct main" - description: - name: flutter_widget_from_html_core - sha256: b1048fd119a14762e2361bd057da608148a895477846d6149109b2151d2f7abf - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.15.2" freezed_annotation: dependency: transitive description: @@ -572,14 +508,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.3.2" - highlight: - dependency: transitive - description: - name: highlight - sha256: "5353a83ffe3e3eca7df0abfb72dcf3fa66cc56b953728e7113ad4ad88497cf21" - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.7.0" html: dependency: transitive description: @@ -608,18 +536,18 @@ packages: dependency: transitive description: name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.1" + version: "3.2.2" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.flutter-io.cn" source: hosted - version: "4.0.2" + version: "4.1.2" icons_launcher: dependency: "direct dev" description: @@ -632,10 +560,10 @@ packages: dependency: "direct main" description: name: image - sha256: "20842a5ad1555be624c314b0c0cc0566e8ece412f61e859a42efeb6d4101a26c" + sha256: "8346ad4b5173924b5ddddab782fc7d8a6300178c8b1dc427775405a01701c4a6" url: "https://pub.flutter-io.cn" source: hosted - version: "4.5.0" + version: "4.5.2" integration_test: dependency: "direct dev" description: flutter @@ -725,10 +653,10 @@ packages: dependency: transitive description: name: lints - sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 url: "https://pub.flutter-io.cn" source: hosted - version: "4.0.0" + version: "5.1.1" logger: dependency: "direct main" description: @@ -761,14 +689,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "7.2.2" - markdown_widget: - dependency: "direct main" - description: - name: markdown_widget - sha256: "216dced98962d7699a265344624bc280489d739654585ee881c95563a3252fac" - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.3.2+6" matcher: dependency: transitive description: @@ -805,10 +725,10 @@ packages: dependency: "direct dev" description: name: mockito - sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917" + sha256: f99d8d072e249f719a5531735d146d8cf04c580d93920b04de75bef6dfb2daf6 url: "https://pub.flutter-io.cn" source: hosted - version: "5.4.4" + version: "5.4.5" nested: dependency: transitive description: @@ -865,6 +785,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.9.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.0" path_provider: dependency: "direct main" description: @@ -917,10 +845,10 @@ packages: dependency: transitive description: name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" url: "https://pub.flutter-io.cn" source: hosted - version: "6.0.2" + version: "6.1.0" phosphor_flutter: dependency: "direct main" description: @@ -1013,10 +941,10 @@ packages: dependency: transitive description: name: pubspec_parse - sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0" + version: "1.5.0" re_editor: dependency: "direct main" description: @@ -1037,10 +965,10 @@ packages: dependency: transitive description: name: reflectable - sha256: f6abe4c7779c6c88f77b79a4317d9277c870c7292a3d6c2e56624c4846124368 + sha256: "35ee17c3b759fa935cc7e9247445903384520fd174e0d6c142d8288e5439fd5b" url: "https://pub.flutter-io.cn" source: hosted - version: "4.0.10" + version: "4.0.12" responsive_framework: dependency: "direct main" description: @@ -1097,30 +1025,22 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.2.0" - scroll_to_index: - dependency: transitive - description: - name: scroll_to_index - sha256: b707546e7500d9f070d63e5acf74fd437ec7eeeb68d3412ef7b0afada0b4f176 - url: "https://pub.flutter-io.cn" - source: hosted - version: "3.0.1" shared_preferences: dependency: transitive description: name: shared_preferences - sha256: "95f9997ca1fb9799d494d0cb2a780fd7be075818d59f00c43832ed112b158a82" + sha256: a752ce92ea7540fc35a0d19722816e04d0e72828a4200e83a98cf1a1eb524c9a url: "https://pub.flutter-io.cn" source: hosted - version: "2.3.3" + version: "2.3.5" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "02a7d8a9ef346c9af715811b01fbd8e27845ad2c41148eefd31321471b41863d" + sha256: bf808be89fe9dc467475e982c1db6c2faf3d2acf54d526cd5ec37d86c99dbd84 url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.0" + version: "2.4.1" shared_preferences_foundation: dependency: transitive description: @@ -1165,10 +1085,10 @@ packages: dependency: "direct main" description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 url: "https://pub.flutter-io.cn" source: hosted - version: "1.4.1" + version: "1.4.2" shelf_static: dependency: "direct main" description: @@ -1194,10 +1114,10 @@ packages: dependency: transitive description: name: source_gen - sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" url: "https://pub.flutter-io.cn" source: hosted - version: "1.5.0" + version: "2.0.0" source_span: dependency: transitive description: @@ -1234,10 +1154,10 @@ packages: dependency: transitive description: name: stream_transform - sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: @@ -1286,6 +1206,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" + tuple: + dependency: transitive + description: + name: tuple + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.2" typed_data: dependency: transitive description: @@ -1362,18 +1290,18 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" + sha256: "3ba963161bd0fe395917ba881d320b9c4f6dd3c4a233da62ab18a5025c85f1e9" url: "https://pub.flutter-io.cn" source: hosted - version: "2.3.3" + version: "2.4.0" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "44cf3aabcedde30f2dba119a9dea3b0f2672fbe6fa96e85536251d678216b3c4" + sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.3" + version: "3.1.4" uuid: dependency: "direct main" description: @@ -1382,6 +1310,30 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "4.5.1" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "27d5fefe86fb9aace4a9f8375b56b3c292b64d8c04510df230f849850d912cb7" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.15" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.13" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "1b4b9e706a10294258727674a340ae0d6e64a7231980f9f9a3d12e4b42407aad" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.16" vector_math: dependency: transitive description: @@ -1398,14 +1350,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "3.0.2" - visibility_detector: - dependency: transitive - description: - name: visibility_detector - sha256: dd5cc11e13494f432d15939c3aa8ae76844c42b723398643ce9addb88a5ed420 - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.4.0+2" vm_service: dependency: transitive description: @@ -1418,10 +1362,10 @@ packages: dependency: transitive description: name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0" + version: "1.1.1" web: dependency: transitive description: @@ -1458,10 +1402,10 @@ packages: dependency: transitive description: name: win32 - sha256: "8b338d4486ab3fbc0ba0db9f9b4f5239b6697fcee427939a40e720cbb9ee0a69" + sha256: "154360849a56b7b67331c21f09a386562d88903f90a1099c5987afc1912e1f29" url: "https://pub.flutter-io.cn" source: hosted - version: "5.9.0" + version: "5.10.0" win32_registry: dependency: transitive description: @@ -1498,10 +1442,10 @@ packages: dependency: transitive description: name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.2" + version: "3.1.3" sdks: - dart: ">=3.5.4 <4.0.0" - flutter: ">=3.24.0" + dart: ">=3.6.0 <4.0.0" + flutter: ">=3.27.1" diff --git a/pubspec.yaml b/pubspec.yaml index a008910..0bb2534 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,38 +41,34 @@ dependencies: # iconify_flutter: ^0.0.7 # https://andronasef.github.io/iconify_flutter/ phosphor_flutter: ^2.1.0 # https://phosphoricons.com/ get: ^5.0.0-release-candidate-9.2.1 - animations: ^2.0.11 dio: ^5.7.0 path: ^1.9.1 path_provider: ^2.1.5 - flutter_inappwebview: ^6.1.5 # webview_flutter: ^4.10.0 - device_preview_plus: ^1.2.0 logger: ^2.5.0 responsive_framework: ^1.5.1 - feedback: ^3.1.0 # 用于获取更好反馈的 Flutter 包 - image: ^4.3.0 - upgrader: ^11.3.0 + image: ^4.5.2 + upgrader: ^11.3.1 # TODO: 升级 markdown: ^7.2.2 # 一个用 Dart 编写的可移植 Markdown 库 - markdown_widget: ^2.3.2+6 # 一个简单易用的 markdown 渲染组件 + flutter_markdown: ^0.7.5 + flutter_markdown_latex: ^0.3.4 dart_json_mapper: ^2.2.14 flex_color_scheme: ^8.0.1 url_launcher: ^6.3.1 uuid: ^4.5.1 - flex_color_picker: ^3.6.0 - file_picker: ^8.1.4 - package_info_plus: ^8.1.1 + flex_color_picker: ^3.7.0 + file_picker: ^8.1.7 + package_info_plus: ^8.1.2 crypto: ^3.0.6 convert: ^3.1.2 - shelf: ^1.4.1 + shelf: ^1.4.2 shelf_static: ^1.1.3 intl: ^0.19.0 - flutter_widget_from_html_core: ^0.15.2 - emoji_picker_flutter: ^3.1.0 + emoji_picker_flutter: ^4.2.0 omni_datetime_picker: ^2.0.5 - collection: ^1.18.0 - elegant_notification: ^2.4.0 + collection: ^1.19.0 + elegant_notification: ^2.4.1 window_manager: ^0.4.3 - archive: ^4.0.1 + archive: ^4.0.2 dartssh2: ^2.11.0 jinja: ^0.6.0 xml: ^6.5.0 @@ -91,11 +87,12 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^4.0.0 + flutter_lints: ^5.0.0 icons_launcher: ^3.0.0 - mockito: ^5.4.4 + mockito: ^5.4.5 build_runner: ^2.4.13 - flutter_native_splash: ^2.4.3 + flutter_native_splash: ^2.4.4 + device_preview_plus: ^2.2.3 dependency_overrides: path: ^1.9.1 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index d713a24..6767d8d 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -7,7 +7,6 @@ #include "generated_plugin_registrant.h" #include -#include #include #include #include @@ -15,8 +14,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { EmojiPickerFlutterPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("EmojiPickerFlutterPluginCApi")); - FlutterInappwebviewWindowsPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("FlutterInappwebviewWindowsPluginCApi")); ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi")); UrlLauncherWindowsRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 9b93218..b08b0f7 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -4,7 +4,6 @@ list(APPEND FLUTTER_PLUGIN_LIST emoji_picker_flutter - flutter_inappwebview_windows screen_retriever_windows url_launcher_windows window_manager