chore: hide Log and PlatformExtension (#886)

This commit is contained in:
Lucas.Xu 2024-09-11 17:51:53 +08:00 • committed by GitHub
commit 72512df842
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,6 +20,7 @@ import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';
import 'package:printing/printing.dart';
import 'package:universal_html/html.dart' as html;
import 'package:universal_platform/universal_platform.dart';
enum ExportFileType {
documentJson,
@ -60,7 +61,7 @@ class _HomePageState extends State<HomePage> {
void initState() {
super.initState();
_jsonString = PlatformExtension.isDesktopOrWeb
_jsonString = UniversalPlatform.isDesktopOrWeb
? rootBundle.loadString('assets/example.json')
: rootBundle.loadString('assets/mobile_example.json');
@ -91,7 +92,7 @@ class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) {
return Scaffold(
key: _scaffoldKey,
extendBodyBehindAppBar: PlatformExtension.isDesktopOrWeb,
extendBodyBehindAppBar: UniversalPlatform.isDesktopOrWeb,
drawer: _buildDrawer(context),
appBar: AppBar(
backgroundColor: const Color.fromARGB(255, 134, 46, 247),
@ -123,7 +124,7 @@ class _HomePageState extends State<HomePage> {
// AppFlowy Editor Demo
_buildSeparator(context, 'AppFlowy Editor Demo'),
_buildListTile(context, 'With Example.json', () {
final jsonString = PlatformExtension.isDesktopOrWeb
final jsonString = UniversalPlatform.isDesktopOrWeb
? rootBundle.loadString('assets/example.json')
: rootBundle.loadString('assets/mobile_example.json');
_loadEditor(context, jsonString);
@ -358,7 +359,7 @@ class _HomePageState extends State<HomePage> {
)
..setAttribute('download', 'document.${fileType.extension}')
..click();
} else if (PlatformExtension.isMobile) {
} else if (UniversalPlatform.isMobile) {
final appStorageDirectory = await getApplicationDocumentsDirectory();
final path = File(