Flutter inspector 切换平台模式未显示

Flutter inspector toggle platform mode is not showing

我正在使用 android studio,但在 flutter inspector 中找不到切换平台模式。我在哪里可以找到它?

只需将应用的ThemeData中的平台parameter设置为TargetPlatform:

platform: TargetPlatform.iOS

代码示例:

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

void main() {
  runApp(
    MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        // The line below forces the theme to iOS.
        platform: TargetPlatform.iOS,
      ),
      home: Scaffold(
        body: Center(
          child: TextField(),
        ),
      ),
    ),
  );
}