Fix setTitle on web

This commit is contained in:
2023-09-15 21:35:23 +08:00
parent b5a73b4714
commit 93a307b143
4 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1 @@
export 'set_title_none.dart' if (dart.library.html) 'set_title_web.dart';

View File

@@ -0,0 +1,3 @@
void setTitleWeb(String title) {
throw UnimplementedError();
}

View File

@@ -0,0 +1,8 @@
// ignore: avoid_web_libraries_in_flutter
import 'dart:html';
void setTitleWeb(String title) {
Future.delayed(const Duration(milliseconds: 10), () {
document.title = title;
});
}