hxse
V2EX  ›  Flutter

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

  •  
  •   hxse · Feb 28, 2020 · 6576 views
    This topic created in 2287 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   ·   3636 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 10:31 · PVG 18:31 · LAX 03:31 · JFK 06:31
    ♥ Do have faith in what you're doing.