V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
17681880207
V2EX  ›  Flutter

关于 SearchDelegate 中修改样式的问题

  •  
  •   17681880207 · 2019-06-14 15:08:01 +08:00 · 8471 次点击
    这是一个创建于 1768 天前的主题,其中的信息可能已经有所发展或是发生改变。
      @override
      ThemeData appBarTheme(BuildContext context) {
        assert(context != null);
        final ThemeData theme = Theme.of(context);
        assert(theme != null);
        return theme.copyWith(
          primaryColor: Colors.white,
          primaryIconTheme: theme.primaryIconTheme.copyWith(color: Colors.grey),
          primaryColorBrightness: Brightness.light,
          primaryTextTheme: theme.textTheme,
        );
      }
    

    是不是只能修改这 4 中样式啊?我尝试了修改其他的样式,发现均无效。
    怎么修改默认的提示文字?默认的提示文字一直是 Search,跪求大佬帮忙解答下!不胜感激!

    3 条回复    2019-06-19 18:55:54 +08:00
    17681880207
        2
    17681880207  
    OP
       2019-06-19 10:23:34 +08:00
    @StefanJ
    我看了这种方式,发现只是使用代理修改了原来定义的一个常量而已。字体、样式,包括 Textfield 都是无法修改的。如果实在不行,我在想是不是只能考虑自己写一个页面来实现。
    StefanJ
        3
    StefanJ  
       2019-06-19 18:55:54 +08:00
    使用内置的组件应该只能通过国际化修改,自定义样式就只能自己实现了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1091 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 22:46 · PVG 06:46 · LAX 15:46 · JFK 18:46
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.