• IndexedStack(每日Flutter 小部件)


    /**
     *  集成自Stack,用来显示第index个child,
     *  IndexedStack({
        Key key,
        AlignmentGeometry alignment = AlignmentDirectional.topStart,
        TextDirection textDirection,
        StackFit sizing = StackFit.loose,
        this.index = 0,
        List<Widget> children = const <Widget>[],
        })
     */
    

    例:

    import 'package:flutter/material.dart';
    
    class IndexedStackWidget extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return IndexedStack(
          alignment: AlignmentDirectional.center,
          textDirection: TextDirection.ltr,
          sizing: StackFit.loose,
          index: 0,
          children: [
            Container(
               100,
              height: 100,
              color: Colors.red,
            ),
            Container(
               80,
              height: 80,
              color: Colors.blue,
            ),
            Container(
               50,
              height: 50,
              color: Colors.green,
            ),
          ],
        );
      }
    }

    运行结果

  • 相关阅读:
    求逆元算法
    Almost Sorted Array
    最长不递减子序列
    (LIS)最长上升序列(DP+二分优化)
    rabbitmq延迟消息
    oracle 视图
    oracle 存储过程
    http 会话(session)详解
    系统测试
    Fiddler 手机抓包
  • 原文地址:https://www.cnblogs.com/wjw334/p/12498070.html
Copyright © 2020-2023  润新知