mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
Fix setTitle on web
This commit is contained in:
1
lib/platform/set_title.dart
Normal file
1
lib/platform/set_title.dart
Normal file
@@ -0,0 +1 @@
|
||||
export 'set_title_none.dart' if (dart.library.html) 'set_title_web.dart';
|
||||
3
lib/platform/set_title_none.dart
Normal file
3
lib/platform/set_title_none.dart
Normal file
@@ -0,0 +1,3 @@
|
||||
void setTitleWeb(String title) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
8
lib/platform/set_title_web.dart
Normal file
8
lib/platform/set_title_web.dart
Normal 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;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user