美文网首页Flutter
【Flutter】APP上线需要的图标及启动页尺寸(Androi

【Flutter】APP上线需要的图标及启动页尺寸(Androi

作者: Kean_Qi | 来源:发表于2019-03-18 17:06 被阅读0次

在flutter开发一个APP上线需要在各平台添加对应的启动图及logo,特再此做一个记录

  • Logo
    • Android
      48x48、72x72、96x96、144x144、192x192
    • iOS
      20@2x、20@3x、
      29x29@1x、29@2x、29@3x、
      40@2x、40@3x、40@2x、40@3x、
      1024*1024(注:1024需要透明和不透明各一套)
  • Launch
    • Android
      450x800、720x1280、1080x1920
    • iOS
      750x1334、1242x2208、1125*2436
      、828x1792、1242x2688

使用TabBar同样存在TabBarView重新build的问题,解决方案一样,加一个PageStorageKey:

child: new Container(
    key: new PageStorageKey(page.country),
    child: new Newsfeed(country: page.country),
),


//代码
class AppState extends State<App> with SingleTickerProviderStateMixin {
  TabController _tabController;

  @override
  void initState() {
    super.initState();
    _tabController = new TabController(
      vsync: this,
      length: _allPages.length,
    );
  }

  @override
  void dispose() {
    _tabController.dispose();
    super.dispose();
  }

  Widget _buildScaffold(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('headlines'),
        bottom: new TabBar(
            controller: _tabController,
            isScrollable: true,
            tabs: _allPages
                .map((_Page page) => new Tab(text: page.country))
                .toList()),
      ),
      body: new TabBarView(
          controller: _tabController,
          children: _allPages.map((_Page page) {
            return new SafeArea(
              top: false,
              bottom: false,
              child: new Container(
                key: new PageStorageKey(page.country),
                child: new Newsfeed(country: page.country),
              ),
            );
          }).toList()),
    );
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'news app',
      home: _buildScaffold(context),
    );
  }
}

相关文章

网友评论

    本文标题:【Flutter】APP上线需要的图标及启动页尺寸(Androi

    本文链接:https://www.haomeiwen.com/subject/ssjbmqtx.html