Flutter inspector toggle platform mode is not showing
Asked Answered
I

1

6

I am using android studio and I can't find toggle platform mode in the flutter inspector. Where can I find it?

Inaudible answered 9/3, 2021 at 19:31 Comment(0)
L
7

Just set the platform parameter in the ThemeData of the app to TargetPlatform:

platform: TargetPlatform.iOS

Code example:

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(),
        ),
      ),
    ),
  );
}

Original answer

Ledger answered 17/3, 2021 at 14:38 Comment(1)
Thanks, that's what I wantedInaudible

© 2022 - 2024 — McMap. All rights reserved.