颤振中特定于平台的父小部件

时间:2021-06-25 07:18:38

标签: flutter dart

您好,我想为 android/web 设置 MaterialApp,为 iOS 设置 Cupertino 作为我的父小部件。在颤振中正确的方法是什么?

class Routes {
  Routes() {
    runApp(MaterialApp(
      title: "ABC",
      home: new Text(
        "Hello",
        style: new TextStyle(
          color: Colors.black,
          decoration: TextDecoration.none,
        ),
      ),
      routes: <String, WidgetBuilder>{
        '/home': (BuildContext context) => new Text('Hello World')
      },
    ));
  }
}

0 个答案:

没有答案