import 'package:flutter/material.dart';
import 'package:netrain_flutter_app/common/Images.dart';
import 'thirdVC.dart';

class twoVCdemo extends StatelessWidget {
  // const ({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(

      appBar: AppBar(
        title: Text("jssDemo第二个页面的标题"),

      ),

      body: Column(
        children: [
          ElevatedButton(
            child: Text("传参数进入第三个页面"),
            onPressed: () {
              Navigator.of(context).push(MaterialPageRoute(
                builder: (context) {
                  return nextViewDemo();
                },
                settings: RouteSettings(
                  name: "我是传过去的",
                  arguments: "参数，是对象类型",
                ),
                //是否有返回
                maintainState: false,
                //类似iOS ture 弹窗式推送界面 false 是push
                fullscreenDialog: false,
              ),
              );
            },

          ),

          Flex(
            direction: Axis.horizontal,
            children: [
              Image.asset(Images.ic_home_normal, alignment: Alignment.center,),
              Align(
                alignment:Alignment(-0.5,0.5),

                child: Stack(
                  alignment: AlignmentDirectional.center,
                  children: [
                    Container(
                      width: 100,
                      height: 30,
                      color: Colors.orange,
                    ),
                    Container(
                      color: Colors.red,
                      child: Text("点击进入"),
                    ),
                    Positioned(
                        right: 0,
                        top: 5,
                        child: Image.asset(Images.ic_home_normal)),
                  ],
                ),
              )
            ],

          )
        ],
      ),


    );
  }
}