小编Sen*_*dru的帖子

Flutter TextButton 填充

随着 Flutter 2.0 的发布,FlatButton已被替换为TextButton.

因此,填充属性不再直接可用,而是作为ButtonStyle属性可用。

我的问题是,由于它不再可用,我该如何设置它EdgeInsets

TextButton(
   style: new ButtonStyle(
     padding: ???,
   ),
   //padding: const EdgeInsets.all(0),   //NOT AVAILABLE
   child: Text("Support", style: Theme.of(context).textTheme.headline2),
      onPressed: () => {Navigator.pushNamed(context, SupportScreen().routeName)},
   ),
Run Code Online (Sandbox Code Playgroud)

dart flutter flutter-2

10
推荐指数
2
解决办法
4151
查看次数

React Native 使用不同的 props 导航到同一页面

我正在开发一个使用侧抽屉的 RN 应用程序。(RN 版本:0.59.8)

const DrawerNavigator = createDrawerNavigator(
    {
        Home: {
            screen: HomeScreen
        },
        Poems: {
            screen: PoemsScreen
        },
        Contest: {
            screen: ContestScreen
        },
        AboutMe: {
            screen: AboutMeScreen
        }
    },
    DrawerConfig
);

export default createAppContainer(DrawerNavigator);
Run Code Online (Sandbox Code Playgroud)

使用的 react-navigation 版本是 3.11.0。在菜单中,多个子项指向同一个页面,即 ViewPager,但具有不同的参数(页面索引)。问题是以下方法都不起作用:

  1. 尝试使用推送而不是导航(返回_this2.props.navigation.push is not a function
  2. 试图重置相应的堆栈。
const resetAction = StackActions.reset({
   index: 0,
   key: 'Poems',
   actions: [NavigationActions.navigate({ routeName: 'Poems' })]
})
this.props.navigation.dispatch(resetAction)
Run Code Online (Sandbox Code Playgroud)

(也试过key: null

任何帮助深表感谢!

react-native react-native-android react-navigation react-navigation-drawer

2
推荐指数
1
解决办法
4837
查看次数