This package allows to detect the platform and the browser version used to view a web page.
Differentiated browsers are: IE
, Edge
, Chrome
, Safari
, Firefox
, Opera
, Electron
, Other
along with Mac
, Windows
and Other
platforms.
import 'package:user_environment/user_environment.dart';
void main() {
UserEnvironment env = UserEnvironmentFactory();
print([
env.browser.type,
env.browser.version?.value,
env.browser.getFeatureVersion('AppleWebKit'),
env.platform.type
]);
}
pub serve test pub run test -p chrome