1

I see that up today flutter has a beta web support. But if I have some view or in general some functionality that support only mobile devices, how can disable it only when I build for the web? is it possible ?

1 Answer 1

4
import 'package:flutter/foundation.dart';

if (kIsWeb) {
  // running on the web!
} else {
  // NOT running on the web! You can check for additional platforms here.
}

Also if you want to check for inside widget and not show mobile widget

child: kIsWeb ? Container():<Mobile Widget>

https://api.flutter.dev/flutter/foundation/kIsWeb-constant.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.