You can use Platform class:
import 'dart:io';
bool isDesktop = (Platform.isWindows || Platform.isMacOS || Platform.isLinux);
bool isMobile = (Platform.isIOS || Platform.isAndroid);
also you can use kIsWeb:
import 'package:flutter/foundation.dart';
if (kIsWeb) {
// HORIZONTAL LAYOUT
} else {
// VERTICAL LAYOUT
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…