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




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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text("jss测试页面"),

        ),
        body:Column(
            children:[
              ElevatedButton(
                onPressed:() {

                  Navigator.of(context).push(MaterialPageRoute(
                      builder: (context){
                        return twoVCdemo();
                      },
                      settings: RouteSettings(
                        name: "我是传过去的名字",
                        arguments :"参数，是对象类型",
                      )
                  ),
                  );
                },
                child: Text("点击进入下一页，页面传值与返回。"),
              ),
              textDemo(),
              buttonDemo(),
              imageiconDemo(),
            ]

        )



    );
    return Container(

        child: Column(
          children: [
            textDemo(),
            buttonDemo(),
            imageiconDemo(),


          ],
        )
    );
  }
}



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

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      color: Colors.blue,
      child:Text (
        "文本，我是个文本 woeijaoijfioasjfajfaojfoiasjfidsjfajf危机哦娃儿哦i啊就哦发i家阿减肥哦i阿减肥里挖掘佛i挖掘安抚啊发生放假啊师傅就撒就啊说",
        maxLines: 10,
        overflow: TextOverflow.ellipsis,
        textDirection: TextDirection.ltr,
        textAlign: TextAlign.center,
        style: TextStyle(
          color: Colors.orange,
        ),
      ),

    );
  }

}


class buttonDemo  extends StatelessWidget {

  // const ({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        //改用ElevatedButton
        RaisedButton(
            onPressed: (){},
            child:Text("漂浮按钮")
        ),
        //改用 TextButton
        FlatButton(
            onPressed: (){},
            child: Text("扁平按钮")
        ),
        //改用 TextButton
        FlatButton.icon(
          onPressed: (){},
          icon: Icon(Icons.outbound),
          label: Text("按钮"),
          color: Colors.black,
          textColor: Colors.white,
        ),
        //改用 OutlinedButton
        OutlineButton(onPressed: (){},
          child: Text("边框按钮"),
        ),
        IconButton(
          onPressed: (){},
          icon: Icon(Icons.access_alarm),
        )
      ],
    );
  }
}




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

  @override
  Widget build(BuildContext context) {

    return Column(
      children: [
        Icon(Icons.add),
        IconButton(onPressed: (){}, icon: Icon(Icons.home)),
        // Image.network("http://www.baidu.com/baidu.php?url=a00000KEJeCxDFezEVpFL9_MH8XSqbHklw_maA_-0O-JAG-gv2I-uvEAQqh-teALqpO_NZN1EbyMj5iOpf3Z1ZREUPx5_1lniEkZj6mijxFoM8VqoaPcH0KOxWwCyPbmri5Hlwk-A8u4pBUbGLW2x882fEua1eOAEbBWTdTqxEMA631a3yr2qBWOz88FPpAVsair-sXakr4y6eguntj86fZCDab3.DR_aOQZsYpb2glyIiUr2s1f_uQr1Fv20.U1Yk0ZDqVSXS_0KY5IissIpS_QMU8pi110KGUHY1PWT0Iybq0ZKGujYk0APGujY1rjc0mhbqn10k0AuY5H00TA6qn0KET1Ys0AFL5H00UMfqn0K1XWY0ThIYmyTqn0K8IM0qna3snj0snj0sn0K-ThTqn0KYTh7buHYdrH0knHm0mhwGujdKnWT1rj0sPHnLPYm1fHndrRmdrH64rjDkwjT3PHcsPsKbmvPb5fK9TdqGuAnqujcVmhwbX0KzIjY3P1T0TgKGujYs0Z7Wpyfqn0K9mWYsg100TZ0qn0KVIZ0qn0KbuAqs5H00ThCqn0KYIgnqnHT1P1DYnWD3P1nYP1RznWDYnW60mynqnfKsUWYs0ZK9I7qhUA7M5H00ugwGujYVnfK9TLKWm1Ys0ZNspy4Wm1Ys0AuWIgfqn0K9uAu_myTqnfKLuMFEUHY0mMfqnfKzug7Y5HDvnWRLnW64rHTvrjm0Tv-b5Hbsn16Lm179n1F9nHRvrj60ULfqn0KETMKY5H0WnaPDw-fWnansc10Wna3sc10WwDuRc10WwDuR0AVG5H00UgfqnWfkn0KVm1Ys0AdWgvuzUvYqn0Kbmy4dmhNxTAk9Uh-bT1Ys0A7bTgbqVSXS_0K9uZ7Y5H00pgPWUjYs0Z7VIjYs0A7bgLPEIgFWuHYsczn0mLFW5HRkrjcL",
        // fit: BoxFit.fitWidth
        // ),
        Image.asset(Images.ic_my_info),
        ElevatedButton(onPressed: (){
          apiGet();
        }, child: Text("测试点击事件请求"))

      ],
    );
    return Container(

    );
  }
}


class  apiGet{

  var result =  Dio().get("http://api.td0f7/cn:8083/dio/dio/test?id=1");


}