flutter之iOS风格push

177 阅读1分钟

1.设置

//从右到左划入(iOS风格push)
        platform: TargetPlatform.iOS,

2.例子:

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        //从右到左划入(iOS风格push)
        platform: TargetPlatform.iOS,
        //主体色
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}