V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
hxse
V2EX  ›  Flutter

flutter 怎么实现平台差异化处理

  •  
  •   hxse · Feb 28, 2020 · 6489 views
    This topic created in 2253 days ago, the information mentioned may be changed or developed.
    比如说在安卓上用一套配色, 在 ios 用另一套配色
    或者在手机上用一套布局, 在桌面上用另一套布局
    如果是一套代码的话, 那么在各个平台上应该都一样的吧, 怎么差异化处理呢
    1 replies    2020-03-18 10:19:29 +08:00
    phantomlimb
        1
    phantomlimb  
       Mar 18, 2020
    很简单啊,你在初始化 Theme 的时候可以提供不同的 ThemeData,跟 Light/Dark Theme 处理的方法差不多
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2756 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 13:34 · PVG 21:34 · LAX 06:34 · JFK 09:34
    ♥ Do have faith in what you're doing.