xxxxxxxxxx
// There is a global boolean kIsWeb which can tell you whether or not
// the app was compiled to run on the web.
// Documentation: https://api.flutter.dev/flutter/foundation/kIsWeb-constant.html
// first import the required class
import 'package:flutter/foundation.dart' show kIsWeb;
// then you can use the global boolean kIsWeb to see if the app is running on web
if (kIsWeb) {
// running on the web!
} else {
// NOT running on the web! You can check for additional platforms here.
}