diff --git a/lib/controllers/rtc_token_handler.dart b/lib/controllers/rtc_token_handler.dart
index 8bd5f94..03c22cc 100644
--- a/lib/controllers/rtc_token_handler.dart
+++ b/lib/controllers/rtc_token_handler.dart
@@ -1,7 +1,7 @@
 import 'dart:convert';
 import 'dart:developer';
-import 'dart:html';
 
+import 'package:universal_html/html.dart' as html;
 import 'package:agora_uikit/controllers/session_controller.dart';
 import 'package:agora_uikit/src/enums.dart';
 import 'package:http/http.dart' as http;
@@ -14,7 +14,7 @@ Future<void> getToken({
 }) async {
   final response = await http
       .get(Uri.parse('$tokenUrl/rtc/$channelName/publisher/uid/$uid'));
-  if (response.statusCode == HttpStatus.ok) {
+  if (response.statusCode == html.HttpStatus.ok) {
     sessionController.value = sessionController.value
         .copyWith(generatedToken: jsonDecode(response.body)['rtcToken']);
   } else {
diff --git a/lib/controllers/rtm_token_handler.dart b/lib/controllers/rtm_token_handler.dart
index 9eaf1e3..9976a94 100644
--- a/lib/controllers/rtm_token_handler.dart
+++ b/lib/controllers/rtm_token_handler.dart
@@ -1,7 +1,7 @@
 import 'dart:convert';
 import 'dart:developer';
-import 'dart:html';
 
+import 'package:universal_html/html.dart' as html;
 import 'package:agora_uikit/controllers/session_controller.dart';
 import 'package:agora_uikit/src/enums.dart';
 import 'package:http/http.dart' as http;
@@ -12,7 +12,7 @@ Future<void> getRtmToken({
 }) async {
   final String url = "$tokenUrl/rtm/${sessionController.value.generatedRtmId}";
   final rtmResponse = await http.get(Uri.parse(url));
-  if (rtmResponse.statusCode == HttpStatus.ok) {
+  if (rtmResponse.statusCode == html.HttpStatus.ok) {
     sessionController.value = sessionController.value.copyWith(
       generatedRtmToken: jsonDecode(rtmResponse.body)['rtmToken'],
     );
diff --git a/pubspec.yaml b/pubspec.yaml
index 6de7b23..9613c86 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -14,6 +14,7 @@ dependencies:
   agora_rtm: ^1.1.0
   flutter:
     sdk: flutter
+  universal_html: ^2.0.8
   http: ^0.13.1
   lints: ^1.0.1
   permission_handler: ^9.2.0
