dint-dev / universal_html

Cross-platform 'dart:html'.
https://pub.dev/packages/universal_html
Apache License 2.0
201 stars 63 forks source link

'Element' has conflicts with 'package:flutter/material.dart'; #37

Closed AgrMayank closed 3 years ago

AgrMayank commented 3 years ago

When using the sample code, Element.tag("h1") is giving errors due to the conflicts with the material.dart class if present in the dart file. The ERROR - The method 'tag' isn't defined for the type 'Element'.

minhqdao commented 3 years ago

To resolve conflicts between imports, use the hide and show keywords:

import 'package:flutter/material.dart' hide Element;
import 'package:universal_html/html.dart';
AgrMayank commented 3 years ago

To resolve conflicts between imports, use the hide and show keywords:

import 'package:flutter/material.dart' hide Element;
import 'package:universal_html/html.dart';

Thanks! I'll test that out.