zoukankan      html  css  js  c++  java
  • flutter之快捷代码块

    {

        // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and 

        // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope 

        // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is 

        // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: 

        // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. 

        // Placeholders with the same ids are connected.

        // Example:

        // "Print to console": {

        //  "scope": "javascript,typescript",

        //  "prefix": "log",

        //  "body": [

        //      "console.log('$1');",

        //      "$2"

        //  ],

        //  "description": "Log output to console"

        // }

        "AppBar": {

            "prefix": "myAppBar",

            "body": [

                "AppBar(",

                "leading: IconButton(",

                "icon: Icon(",

                "Icons.arrow_back_ios,",

                "color: Colors.white,",

                "),",

                "onPressed: () {",

                "Navigator.of(context).pop();",

                "}),",

                "backgroundColor: Colors.white,",

                "title: const Text('Basic AppBar'),",

                "actions: <Widget>[",

                "new IconButton(",

                "// action button",

                "icon: new Icon(Icons.fast_forward),",

                "onPressed: () {},",

                "),",

                "],",

                "elevation: 0,",

                "),",

            ],

            "description": "AppBar"

        },

        "import fluttertoast": {

            "prefix": "myimportfluttertoast",

            "body": [

                "import 'package:fluttertoast/fluttertoast.dart';",

            ],

            "description": "import fluttertoast"

        },

        

        "importcommon_util": {

            "prefix": "myimportcommon_util",

            "body": [

                "import 'package:shopsave/components/common_util/common_util.dart';",

            ],

            "description": "importcommon_util"

        },

        "importscreenutil": {

            "prefix": "myimportscreenutil",

            "body": [

                "import 'package:flutter_screenutil/flutter_screenutil.dart';",

            ],

            "description": "screenutil"

        },

        "importeasylocalization": {

            "prefix": "myimporteasylocalization",

            "body": [

                "import 'package:easy_localization/easy_localization.dart';",

            ],

            "description": "import easy_localization"

        },

        "myImage.asset": {

            "prefix": "myImage.asset",

            "body": [

                "Image.asset("images/2.0x/google.png",fit: BoxFit.cover,40,height:40),",

            ],

            "description": "Image.asset"

        },

        "myImage.asset_Util": {

            "prefix": "myImage.asset_Util",

            "body": [

                "Image.asset("images/2.0x/google.png",fit: BoxFit.cover,ScreenUtil().getWidth(24),height:ScreenUtil().getHeight(24)),",

            ],

            "description": "Image.asset_Util"

        },

        "myImage.network": {

            "prefix": "myImage.network",

            "body": [

                "Image.network(dataItem['productMainImageUrl'].toString(), MediaQuery.of(context).size.width,height: width,)",

            ],

            "description": "myImage.network"

        },

        "myImage.network_Util": {

            "prefix": "myImage.network_Util",

            "body": [

                "Image.network(dataItem['productMainImageUrl'].toString(), ScreenUtil().getWidth(90),height: ScreenUtil().getHeight(106),)",

            ],

            "description": "myImage.network_Util"

        },

        "myEdgeInsets.symmetric.horizontal": {

            "prefix": "myEdgeInsets.symmetric.horizontal",

            "body": [

                "EdgeInsets.symmetric(horizontal: 10),",

            ],

            "description": "EdgeInsets.symmetric(horizontal"

        },

        "myEdgeInsets.symmetric.horizontal_Util": {

            "prefix": "myEdgeInsets.symmetric_Util.horizontal_Util",

            "body": [

                "EdgeInsets.symmetric(horizontal: ScreenUtil().getWidth(10)),",

            ],

            "description": "EdgeInsets.symmetric(horizontal_Util"

        },

        "myEdgeInsets.symmetric.vertical": {

            "prefix": "myEdgeInsets.symmetric.vertical",

            "body": [

                "EdgeInsets.symmetric(vertical: 10),",

            ],

            "description": "EdgeInsets.symmetric(vertical"

        },

        "myEdgeInsets.symmetric.vertical_Util": {

            "prefix": "myEdgeInsets.symmetric.vertical_Util",

            "body": [

                "EdgeInsets.symmetric(vertical: ScreenUtil().getHeight(10)),",

            ],

            "description": "EdgeInsets.symmetric(vertical_Util"

        },

        "myEdgeInsets.fromLTRB": {

            "prefix": "myEdgeInsets.fromLTRB",

            "body": [

                "EdgeInsets.fromLTRB(15, 15, 15, 15),",

            ],

            "description": "LEdgeInsets.fromLTRB"

        },

        "myEdgeInsets.fromLTRB_Util": {

            "prefix": "myEdgeInsets.fromLTRB_Util",

            "body": [

                "EdgeInsets.fromLTRB(ScreenUtil().getWidth(15), ScreenUtil().getHeight(15), ScreenUtil().getWidth(15), ScreenUtil().getHeight(15)),",

            ],

            "description": "LEdgeInsets.fromLTRB_Util"

        },

        "myScreenUitl.setsp": {

            "prefix": "myScreenUtil.setsp",

            "body": [

                "ScreenUtil().setSp(16),",

            ],

            "description": "ScreenUtil.setsp"

        },

        "myScreenUitl.setwidth": {

            "prefix": "myScreenUtil.setWidth",

            "body": [

                "ScreenUtil().setWidth(16),",

            ],

            "description": "ScreenUtil.setWidth"

        },

        "myScreenUitl.setheight": {

            "prefix": "myScreenUtil.setHeight",

            "body": [

                "ScreenUtil().setHeight(16),",

            ],

            "description": "ScreenUtil.setHeight"

        },

        "myScreenUitl.getsp": {

            "prefix": "myScreenUtil.getsp",

            "body": [

                "ScreenUtil().getSp(16),",

            ],

            "description": "ScreenUtil.setsp"

        },

        "myScreenUitl.getwidth": {

            "prefix": "myScreenUtil.getWidth",

            "body": [

                "ScreenUtil().getWidth(16),",

            ],

            "description": "ScreenUtil.getWidth"

        },

        "myScreenUitl.getheight": {

            "prefix": "myScreenUtil.getHeight",

            "body": [

                "ScreenUtil().getHeight(16),",

            ],

            "description": "ScreenUtil.getHeight"

        },

        "ifcallback": {

            "prefix": "ifcallback",

            "body": [

                "if (widget.dismissCallback != null) {",

                "widget.dismissCallback();",

                "}",

            ],

            "description": "if callback != null"

        },

        "ignore immutable": {

            "prefix": "ignoreimmutable",

            "body": [

                "//ignore: must_be_immutable",

            ],

            "description": "ignore immutable"

        },

        "OutlineButton": {

            "prefix": "myOutlineButton",

            "body": [

                "OutlineButton(",

                "onPressed: () {",

                "Navigator.push(",

                "context,",

                "MaterialPageRoute(",

                "builder: (context) {",

                "return Text('data');",

                "},",

                "),",

                ");",

                "},",

                "color: Colors.red,",

                "child: Text('REGISTER',",

                "style: TextStyle(",

                "fontSize: 30,",

                "color: Colors.white)",

                "),",

                "padding: EdgeInsets.symmetric(horizontal: 10),",

                ")",

            ],

            "description": "OutlineButton"

        },

        "OutlineButton_Util": {

            "prefix": "myOutlineButton_Util",

            "body": [

                "OutlineButton(",

                "onPressed: () {",

                "Navigator.push(",

                "context,",

                "MaterialPageRoute(",

                "builder: (context) {",

                "return Text('data');",

                "},",

                "),",

                ");",

                "},",

                "color: Colors.red,",

                "child: Text('REGISTER',",

                "style: TextStyle(",

                "fontSize: ScreenUtil().setSp(30),",

                "color: Colors.white)",

                "),",

                "padding: EdgeInsets.symmetric(horizontal: 10),",

                ")",

            ],

            "description": "OutlineButton_Util"

        },

        "myscaffold": {

            "prefix": "myscaffold",

            "body": [

                "Scaffold(",

                "resizeToAvoidBottomPadding: false,",

                "resizeToAvoidBottomInset: false,",

                "appBar: AppBar(",

                "leading: IconButton(",

                "icon: Icon(Icons.arrow_back_ios,color: Colors.white,), ",

                "onPressed: (){",

                "}),",

                "elevation: 0,",

                "backgroundColor: Theme.of(context).accentColor,",

                "title: Text('Basic AppBar'),",

                "actions: <Widget>[",

                "new IconButton( // action button",

                "icon: new Icon(Icons.fast_forward),",

                "onPressed: () { },",

                "),",

                "],",

                "),",

                "body: Container(",

                "padding: EdgeInsets.all(10),",

                "child: Text('data'),",

                "),",

                ");",

            ],

            "description": "ScaflodWidget"

        },

        "ClipRRect": {

            "prefix": "myClipRRect",

            "body": [

                "ClipRRect(",

                "borderRadius: BorderRadius.circular(30),",

                "child: Container(",

                " MediaQuery.of(context).size.width,",

                "height: 88,",

                "decoration: BoxDecoration(",

                "borderRadius:BorderRadius.circular(20), ",

                "color: Colors.red",

                "boxShadow: [",

                    "BoxShadow(",

                        "color: Colors.black12,",

                        "offset: Offset(0.0, 15.0), //阴影xy轴偏移量",

                        "blurRadius: 15.0, //阴影模糊程度",

                        "spreadRadius: 1.0 //阴影扩散程度",

                        ")",

                  "]",

                "),",

                "child: Text('')",

                "),",

                "),",

            ],

            "description": "ClipRRect"

        },

        "ClipRRect_Util": {

            "prefix": "myClipRRect_Util",

            "body": [

                "ClipRRect(",

                "borderRadius: BorderRadius.circular(30),",

                "child: Container(",

                " ScreenUtil().setWidth(750),",

                "height: ScreenUtil().setHeight(88),",

                "decoration: BoxDecoration(",

                "borderRadius:BorderRadius.circular(20), ",

                "color: Colors.red",

                "boxShadow: [",

                    "BoxShadow(",

                        "color: Colors.black12,",

                        "offset: Offset(0.0, 15.0), //阴影xy轴偏移量",

                        "blurRadius: 15.0, //阴影模糊程度",

                        "spreadRadius: 1.0 //阴影扩散程度",

                        ")",

                  "]",

                "),",

                "child: Text('')",

                "),",

                "),",

            ],

            "description": "ClipRRect_Util"

        },

        

        "ShapeDecoration": {

            "prefix": "myShapeDecoration",

            "body": [

                "ShapeDecoration(",

                    "color: Colors.white,//AppColors.popupBackground,",

                    "shape: RoundedRectangleBorder(",

                        "borderRadius: BorderRadius.all(",

                            "Radius.circular(20),",

                        "),",

                    "),",

                ")",

            ],

            "description": "myShapeDecoration"

        },

        

        "BoxDecoration": {

            "prefix": "myBoxDecoration",

            "body": [

                "BoxDecoration(",

                "borderRadius:BorderRadius.circular(20),",

                "color: Colors.red,",

                "border: Border.all(color: Colors.red),",

                "boxShadow: [",

                    "BoxShadow(",

                        "color: Colors.black12,",

                        "offset: Offset(0.0, 15.0), //阴影xy轴偏移量",

                        "blurRadius: 15.0, //阴影模糊程度",

                        "spreadRadius: 1.0 //阴影扩散程度",

                        ")",

                  "]",

                "),",

            ],

            "description": "BoxDecoration",

        },

        "color0x": {

            "prefix": "mycolor0x",

            "body": [

                "Color(0x)",

            ],

            "description": "color0x"

        },

        "color0xff": {

            "prefix": "mycolor0xff",

            "body": [

                "Color(0xff)",

            ],

            "description": "color0xff"

        },

        "color0xOpacity": {

            "prefix": "mycolor0xOpacity",

            "body": [

                "Color(0xff).withOpacity(0.1),",

            ],

            "description": "color0xOpacity"

        },

        "myappbar": {

            "prefix": "myappbar",

            "body": [

                "appBar: AppBar(",

                "leading: IconButton(",

                "icon: Icon(Icons.arrow_back_ios), ",

                "onPressed: (){",

                "}),",

                "backgroundColor: Theme.of(context).accentColor,",

                "title: const Text('Basic AppBar'),",

                "actions: <Widget>[",

                "new IconButton( // action button",

                "icon: new Icon(Icons.fast_forward),",

                "onPressed: () { },",

                "),",

                "],",

                "),",

            ],

            "description": "Appbar"

        },

        "mycolumn": {

            "prefix": "mycolumn",

            "body": [

                "Column(",

                "mainAxisAlignment: MainAxisAlignment.start,",

                "crossAxisAlignment: CrossAxisAlignment.center,",

                "children:<Widget>[]",

                "),",

            ],

            "description": "Column"

        },

        "myRow": {

            "prefix": "myRow",

            "body": [

                "Row(",

                "mainAxisAlignment: MainAxisAlignment.start,",

                "crossAxisAlignment: CrossAxisAlignment.center,",

                "children: <Widget>[",

                "],",

                ");",

            ],

            "description": "Row"

        },

        "myContainer": {

            "prefix": "myContainer",

            "body": [

                "Container(",

                "padding: EdgeInsets.fromLTRB(10, 20, 10, 30),",

                "child: Text('Register'),",

                ")",

            ],

            "description": "Container"

        },

        "myContainerSPUtil": {

            "prefix": "myContainerSPUtil",

            "body": [

                "Container(",

                "padding: EdgeInsets.fromLTRB(ScreenUtil().getWidth(10), ScreenUtil().getHeight(20), ScreenUtil().getWidth(10), ScreenUtil().getHeight(30)),",

                "child: Text('Register'),",

                ")",

            ],

            "description": "ContainerSPUtil"

        },

        "myText": {

            "prefix": "myText",

            "body": [

                "Text('title',style:TextStyle(fontSize:14,color:Colors.black)),",

            ],

            "description": "myText"

        },

        "myTextNav": {

            "prefix": "myTextNav",

            "body": [

                "Text(tr(''),style:Theme.of(context).textTheme.display1),",

            ],

            "description": "myTextNav"

        },

        

        "myTextSPUtil": {

            "prefix": "myTextSPUtil",

            "body": [

                "Text('title',style:TextStyle(fontSize:ScreenUtil().getSp(12),color:Util_Tool.themsubTitleGrayColor)),",

            ],

            "description": "myTextSPUtil"

        },

        

        "myTextStyle": {

            "prefix": "myTextStyle",

            "body": [

                "TextStyle(fontSize:10,color:Colors.black)",

            ],

            "description": "myTextStyle"

        },

        "myTextStMClr": {

            "prefix": "myTextStMClr",

            "body": [

                "TextStyle(fontSize:10,color:Color(0xFF))",

            ],

            "description": "myTextStMClr"

        },

        "myTextSCloSPUtil": {

            "prefix": "myTextSCloSPUtil",

            "body": [

                "TextStyle(fontSize:ScreenUtil().getSp(14),color:Color(0xFF))",

            ],

            "description": "myTextSCloSPUtil"

        },

        "import package:flutter/gestures.dart": {

            "prefix": "myimportgestures",

            "body": [

                "import 'package:flutter/gestures.dart';",

            ],

            "description": "mport package:flutter/gestures.dart"

        },

        "myRichText": {

            "prefix": "myRichText",

            "body": [

                "RichText(text: TextSpan(",

                " text: 'By regisetering for an Shopsave account,you are agree that you have read and accepted our',",

                "style: TextStyle(",

                "color:Colors.grey,",

                "fontSize:14,",

                "),",

                "children: [",

                "TextSpan(",

                "text:'Shopsave FreeMenbership Agreement',",

                "style:TextStyle(fontSize:14,color:Colors.greenAccent),",

                "recognizer: TapGestureRecognizer()..onTap = () {},",

                "),",

                "TextSpan(",

                "text: 'and',",

                "style: TextStyle(",

                "color: Colors.grey,",

                "fontSize: 14)),",

                "TextSpan(",

                "text: 'Privacy Policy',",

                "style: TextStyle(",

                "color: Colors.greenAccent,",

                "fontSize: 14),",

                "recognizer: TapGestureRecognizer()",

                "..onTap = () {}",

                "),",

                "]",

                ")",

                "),",

            ],

            "description": "myRichText"

        },

        "myListTileC": {

            "prefix": "myListTileC",

            "body": [

                "ListTile(",

                "title: Text(tr('SIGN IN')),",

                "trailing: ClipOval(",

                "child: Image.network('http://blogimages.jspang.com/blogtouxiang1.jpg' ,",

                " 45,",

                "height: 45,",

                "fit: BoxFit.cover,)",

                "),",

                "leading: CircleAvatar(",

                "backgroundImage: NetworkImage(imageUrl),",

                "),",

                "onTap: (){",

                "Navigator.push(context, ",

                " MaterialPageRoute(",

                "builder: (context){",

                "return Text('title',style:TextStyle(fontSize:10,color:Colors.black));",

                "},",

                "fullscreenDialog: true",

                "),",

                ");",

                "},",

                "),",

            ],

            "description": "myListTileC"

        },

        "myListTileSystem": {

            "prefix": "myListTileSystem",

            "body": [

                "ListTile(",

                    "title:Text(",

                    "'title',",

                    "style:TextStyle(fontSize:ScreenUtil().getSp(12),",

                    "color:Util_Tool.themsubTitleGrayColor)),",

                    "subtitle: Text(",

                    "'title',",

                    "style:TextStyle(fontSize:ScreenUtil().getSp(12),",

                    "color:Util_Tool.themsubTitleGrayColor)),",

                    "leading:Text(''),",

                    "trailing:Text('')",

                    "onTap: (){},",

                "),",

                

            ],

            "description": "myListTileSystem"

        },

        

        "myNavPFD": {

            "prefix": "myNavPFD",

            "body": [

                "Navigator.push(context, ",

                "MaterialPageRoute(",

                "builder: (context){",

                "return Text('');",

                "},",

                "fullscreenDialog: true",

                "),",

                ");",

            ],

            "description": "myNavPFD"

        },

        "myNavNPName": {

            "prefix": "myNavNPName",

            "body": [

                "Navigator.of(context).pushNamed('/');",

            ],

            "description": "myNavNPName"

        },

        "myNavNPNaParam": {

            "prefix": "myNavNPNaParam",

            "body": [

                "Navigator.pushNamed(",

                    "context,",

                    "'/weather',",

                    "arguments: <String, String>{",

                    "'key': 'value',",

                    

                "},",

            ],

            "description": "myNavNPNaParam"

        },

        "myMediaQuery": {

            "prefix": "myMediaQuery",

            "body": [

                "MediaQuery.of(context).size"

            ],

            "description": "myMediaQuery"

        },

        

        "myNavNPRe": {

            "prefix": "myNavNPRe",

            "body": [

                "Navigator.of(context).pushReplacementNamed('/screen4');",

            ],

            "description": "myNavNPRe"

        },

        "myNavNPARUntil": {

            "prefix": "myNavNPARUntil",

            "body": [

                "Navigator.of(context).pushNamedAndRemoveUntil(",

                 "'/screen4', ModalRoute.withName('/screen1'));",

            ],

            "description": "myNavNPARUntil"

        },

        "myNavPRepalce": {

            "prefix": "myNavPRepalce",

            "body": [

                "Navigator.pushReplacement(",

                "context,",

                "new MaterialPageRoute(builder: (context) => RegisterAccount()),",

                ");",

            ],

            "description": "myNavPRepalce"

        },

        "myNavpop": {

            "prefix": "myNavpop",

            "body": [

                "Navigator.of(context).pop();",

            ],

            "description": "myNavpop"

        },

        "myNavpopNUntil": {

            "prefix": "myNavpopNUntil",

            "body": [

                "Navigator.of(context).popUntil(ModalRoute.withName('/'));",

            ],

            "description": "myNavpopNUntil"

        },

        "myNavpopNAndPName": {

            "prefix": "myNavpopNAndPName",

            "body": [

                "Navigator.of(context).popAndPushNamed('/screen3');",

            ],

            "description": "myNavpopNAndPName"

        },

        "myNavPPRemoveUtil": {

            "prefix": "myNavPPRemoveUtil",

            "body": [

                "Navigator.pushAndRemoveUntil(",

                "context, new MaterialPageRoute(builder: (context)=> Register_Login_Page()),",

                "(route) => Route == null,",

                ");",

            ],

            "description": "myNavPPRemoveUtil"

        },

        "myNavPTransition": {

            "prefix": "myNavPTransition",

            "body": [

                "Navigator.of(context).push(new PageRouteBuilder(pageBuilder:",

                        "(BuildContext context, Animation<double> animation,",

                            "Animation<double> secondaryAnimation) {",

                          "return Text('11');",

                        "}, transitionsBuilder: (",

                          "BuildContext context,",

                          "Animation<double> animation,",

                          "Animation<double> secondaryAnimation,",

                          "Widget child,",

                        ") {",

                         " // 添加一个平移动画",

                          "return BRouter.createTransition(animation, child);",

                        "}));",

                        "/// 创建一个平移变换",

                        "/// 跳转过去查看源代码,可以看到有各种各样定义好的变换",

                        "static SlideTransition createTransition(",

                            "Animation<double> animation, Widget child) {",

                          "return new SlideTransition(",

                            "position: new Tween<Offset>(",

                              "begin: const Offset(1.0, 0.0),",

                              "end: const Offset(0.0, 0.0),",

                            ").animate(animation),",

                            "child: child, // child is the value returned by pageBuilder",

                          ");",

                        "}",

            ],

            "description": "myNavPTransition"

        },

        "myIcon": {

            "prefix": "myIcon",

            "body": [

                "Icon(Icons.home,size: 20,color:Colors.red)",

            ],

            "description": "Icon"

        },

        "mythenvalue": {

            "prefix": ".mythenvalue",

            "body": [

                ".then((value) {",

                "print("页面成功了哦 $value");",

                "}).catchError((onError) {",

                "print("页面请求失败 $onError");",

                "}).whenComplete(() {",

                "print("页面whenComplete");",

                "});",

            ],

            "description": "mythenvalue"

        },

        "Print to console": {

            "prefix": "log",

            "body": [

                "FutureBuilder(",

                    "future: request(),",

                    "builder:(context,snapshot){",

                    "if (snapshot.hasData)",

                    "{",

                        "return Container(",

                        "padding: EdgeInsets.fromLTRB(10, 20, 10, 30),",

                        "child: Text('Register'),",

                        ");",

                    "}else{",

                        "return Center(",

                        "child:Text('text')",

                        ");",

                    "}",

                    "}",

                ")",

            ],

            "description": "Log output to console"

        },

        

        "myFluttertoast": {

            "prefix": "myFluttertoast",

            "body": [

                "Fluttertoast.showToast(",

                          "msg: "This is Center Short Toast",",

                          "toastLength: Toast.LENGTH_SHORT,",

                          "gravity: ToastGravity.CENTER,",

                          "timeInSecForIos: 1,",

                          "backgroundColor: Colors.white,",

                          "textColor: Colors.black",

                        ");",

            ],

            "description": "myFluttertoast"

        },

        "myInWell": {

            "prefix": "myInWell",

            "body": [

            "InkWell(",

                  

                "onTap: () {},",

                    "child: Container(",

                        " 40,//ScreenUtil().getWidth(100),",

                        "height: 40,//ScreenUtil().getHeight(70),",

                        "padding: EdgeInsets.fromLTRB(3, 16, 3, 16),",

                        "child: Image.asset("images/menu_white.png",fit: BoxFit.cover,ScreenUtil().getWidth(26),height:ScreenUtil().getHeight(24)),",

                    ")",

            ")",

            ],

            "description": "myInWell"

        },

        "myStack": {

            "prefix": "myStack",

            "body": [

                "Stack(",

                    "children: <Widget>[",

                    "Container(",

                        " 100,",

                        "height: 100,",

                        "color: Colors.red,",

                    "),",

                    "Container(",

                        " 90,",

                        "height: 90,",

                        "color: Colors.blue,",

                    "),",

                    "Container(",

                        " 80,",

                        "height: 80,",

                        "color: Colors.green,",

                    "),",

                    "],",

                "),",

            ],

            "description": "myStack"

        },

        "myStackPositioned": {

            "prefix": "myStackPositioned",

            "body": [

                "Stack(",

                    "children: <Widget>[",

                    "Positioned(",

                        "top: 100.0,",

                        "child: Container(",

                        "color: Colors.blue,",

                        "child: Text("第一个组件"),",

                        "),",

                    "),",

                    "Positioned(",

                        "top: 200,",

                        "right: 100,",

                        "child: Container(",

                        "color: Colors.yellow,",

                        "child: Text("第二个组件"),",

                        "),",

                    "),",

                    "Positioned(",

                        "left: 100.0,",

                        "child: Container(",

                        "color: Colors.red,",

                        "child: Text("第三个组件"),",

                        "),",

                    "),",

                    "],",

                "),",

            ],

            "description": "myStackPositioned"

        },

        

        "myClipPath": {

            "prefix": "myClipPath",

            "body": [

                "ClipPath(",

                  "clipper: OvalBottomBorderClipper(),",

                  "child: Container(",

                    "height: ScreenUtil().getHeight(80),",

                    " double.infinity,",

                    "color: Color(0xFFF34434),",

                  "),",

                "),",

            ],

            "description": "myClipPath"

        },

        "myStackAlign": {

            "prefix": "myStackAlign",

            "body": [

                "Stack(children: <Widget>[",

                    "Align(",

                      "alignment: Alignment.topCenter,",

                      "child: Container(",

                        

                      ")",

                    "),",

                    "Align(",

                        "alignment: Alignment.topCenter,", 

                        "child: Container(",

                          " double.infinity,",

                         "height: ScreenUtil().getHeight(221),",

                          "padding: EdgeInsets.fromLTRB(15, 10, 15, 0),",

                          "child: Container()",

                        ")",

                    ")",

                  "]",

                ")",

            ],

            "description": "myStackAlign"

        },

        "myListView": {

            "prefix": "myListView",

            "body": [

                "ListView(",

              

                    "children: <Widget>[",

                    

                    "],",

                "),",

            ],

            "description": "myListView"

        },

        "myFutureBuilder": {

            "prefix": "myFutureBuilder",

            "body": [

                "FutureBuilder(",

                    "future: requestdd(params),",

                    "builder: (context, snapshot){",

                        "return EasyRefresh(",

                        "refreshFooter: ClassicsFooter(",

                        "key: _footerKey,",

                        "bgColor: Theme.of(context).accentColor,",

                        "textColor: grefresh_textColor,",

                        "moreInfoColor: grefresh_moreInfoColor,",

                        "showMore: true,",

                        "noMoreText: '',",

                        "moreInfo: grefresh_moreInfo,",

                        "loadReadyText: grefresh_loadReadyText,",

                        "),",

                        "loadMore: () async {",

                        "var formPage = {'page': curPageNo};",

                        "// await request('url', formData: formPage).then((val) {",

                        "//   var data = json.decode(val.toString());",

                        "//   List moreList = (data['data'] as List).cast();",

                        "//   setState(() {",

                        "//     list.addAll(moreList);",

                        "//     curPageNo++;",

                        "//   });",

                        "// });",

                        "},",

                        "child:Container(",

                        "padding: EdgeInsets.fromLTRB(10, 20, 10, 30),",

                        "child: Text('Register'),",

                        ")",

                    ");",

                    "}",

                ")",

            ],

            "description": "myFutureBuilder"

        },

        "myCard": {

            "prefix": "myCard",

            "body": [

                "Card(",

                "elevation: 3,",

                "clipBehavior: Clip.antiAlias,",

                "semanticContainer: false,",

                "shape: RoundedRectangleBorder(",

                  "borderRadius: BorderRadius.all(Radius.circular(ScreenUtil().getWidth(6))),",

                "),",

                "child:Container(",

                

                "decoration: BoxDecoration(",

                  "// borderRadius:BorderRadius.circular(6),",

                  "color: Colors.white,",

                  "boxShadow: [",

                    "BoxShadow(",

                        "color: Colors.black12,",

                        "offset: Offset(0.0, 15.0), //阴影xy轴偏移量",

                        "blurRadius: 15.0, //阴影模糊程度",

                        "spreadRadius: 1.0 //阴影扩散程度",

                        ")",

                  "]",

                "),",

                "child: Column(",

                  "mainAxisAlignment: MainAxisAlignment.spaceAround,",

                  "crossAxisAlignment: CrossAxisAlignment.center,",

                    "children:<Widget>[",

                      "ListTile(",

                        "title: Text('data.',style:TextStyle(fontSize:ScreenUtil().getSp(20),color: Util_Tool.themHeadTitleBlackColor)),",

                        "subtitle: Text('5 mar 2020',style:TextStyle(fontSize:14,color:Colors.black)),",

                        "leading: InkWell(",

                            "onTap:(){},",

                            "child:ClipOval(", 

                              "child: SizedBox(",

                                "ScreenUtil().getWidth(35),",

                                "height: ScreenUtil().getHeight(35),",

                                "child:Image.network('http://blogimages.jspang.com/blogtouxiang1.jpg'),",

                              "),",

                            "),",

                        "),",

                        "trailing: InkWell(",

                          

                          "child:Container(",

                            "padding: EdgeInsets.fromLTRB(13, 6, 13, 6),",

                            "decoration: BoxDecoration(",

                              "borderRadius:BorderRadius.circular(13),",

                              "color: Colors.red,",

                              "boxShadow: [",

                                "BoxShadow(",

                                    "color: Colors.black12,",

                                    "offset: Offset(0.0, 15.0), //阴影xy轴偏移量",

                                    "blurRadius: 15.0, //阴影模糊程度",

                                    "spreadRadius: 1.0 //阴影扩散程度",

                                    ")",

                              "]",

                            "),",

                            "child: Text(tr('+FOLLOW'),style: TextStyle(fontSize:ScreenUtil().getSp(12),color:Colors.white),),",

                          "),",

                          "onTap:(){}",

                        ")",

                      "),",

                      "Image.network('http://blogimages.jspang.com/blogtouxiang1.jpg',double.infinity,height:ScreenUtil().getHeight(160)),",

                      "Text('Check out our sale items with discounts up to 50%.',maxLines: 2,style:TextStyle(fontSize:14,color:Util_Tool.themHeadTitleBlackColor)),",

                      "Row(",

                        "mainAxisAlignment: MainAxisAlignment.start,",

                        "crossAxisAlignment: CrossAxisAlignment.center,",

                        "children: <Widget>[",

                          "ButtonBar(",

                            "alignment: MainAxisAlignment.spaceEvenly,",

                            "mainAxisSize: MainAxisSize.min,",

                            "children:<Widget>[",

                              "InkWell(",

                                "child:Image.asset("images/graylike.png",fit: BoxFit.cover,24,height:24),",

                                "onTap: (){},",

                              "),",

                              "InkWell(",

                                "child:Text('223',style:TextStyle(fontSize:14,color:Colors.black)),",

                                "onTap:(){}",

                              "),",

                              

                            "],",

                            

                          "),",

                          "ButtonBar(",

                            "alignment: MainAxisAlignment.spaceEvenly,",

                            "mainAxisSize: MainAxisSize.min,",

                            "children:<Widget>[",

                              "Image.asset("images/message_1.png",fit: BoxFit.cover,24,height:24),",

                              "Text('223',style:TextStyle(fontSize:14,color:Colors.black))",

                            "],",

                            

                          "),",

                        "],",

                      ")",

                    "]",

                  "),",

                ")",

              ");",

            ],

            "description": "myCard"

        },

        "mySizedBoxH": {

            "prefix": "mySizedBoxH",

            "body": [

                "SizedBox(height:8,),",

            ],

            "description": "mySizedBoxH"

        },

        "mySizedBoxW": {

            "prefix": "mySizedBoxW",

            "body": [

                "SizedBox(height:8,),",

            ],

            "description": "mySizedBoxW"

        },

        "mySizedBoxH_SpUitl": {

            "prefix": "mySizedBoxH_SpUitl",

            "body": [

                "SizedBox(height:ScreenUtil().getHeight(8),),",

            ],

            "description": "mySizedBoxH_SpUitl"

        },

        "mySizedBoxW_SpUitl": {

            "prefix": "mySizedBoxW_SpUitl",

            "body": [

                "SizedBox(height:ScreenUtil().getWidth(8),),",

            ],

            "description": "mySizedBoxW_SpUitl"

        },

        "mySliverFixedExtentList": {

            "prefix": "mySliverFixedExtentList",

            "body": [

                "SliverFixedExtentList(",

                    "itemExtent: 50, //child的长度或者宽度,取决于滚动方向.",

                    "delegate: SliverChildBuilderDelegate((context, int index) {",

                    

                    

                    "},",

                    "childCount: 20,",

                    "),",

                ");",

            ],

            "description": "mySliverFixedExtentList"

        },

        

        "myBorder": {

            "prefix": "myBorder",

            "body": [

                "Border(bottom: BorderSide( ScreenUtil().getWidth(1),color: Util_Tool.themLineGrayColor))",

            ],

            "description": "myBorder"

        },

        "myClipOval": {

            "prefix": "myClipOval",

            "body": [

                "ClipOval(",

                    "child: Image.network(",

                    "'http://blogimages.jspang.com/blogtouxiang1.jpg',",

                    " ScreenUtil().getWidth(44),",

                    "height: ScreenUtil().getWidth(44),",

                    "fit: BoxFit.cover,",

                ")),",

            ],

            "description": "myClipOval"

        },

        "myFlexible": {

            "prefix": "myFlexible",

            "body": [

                "Flexible(",

                  "flex: 1,",

                  "child: Container(",

                  "color:Colors.white",

                "))",

            ],

            "description": "myFlexible"

        },

        "myrequestdd": {

            "prefix": "myrequestdd",

            "body": [

                "void requestdd(Map param){",

                    "NetDataUtil().postGetuseramountinfo(param).then((value) {",

                

                      "print("=========moneydata=====$value");",

                      "setState(() {",

                       "moneyData = value;",

                

                    "});",

                      

                    "}).catchError((onError) {",

                    "print("页面请求失败 $onError");",

                    "}).whenComplete(() {",

                    "print("页面whenComplete");",

                    "});",

                  "}",

            ],

            "description": "myrequestdd"

        },

        

        "mySmartRefresher": {

            "prefix": "mySmartRefresher",

            "body": [

                "SmartRefresher(",

                    "enablePullDown: true,",

                    "enablePullUp: true,",

                    "header: WaterDropHeader(),",

                    "footer: CustomFooter(",

                    "builder: (BuildContext context, LoadStatus mode) {",

                        "Widget body;",

                        "if (mode == LoadStatus.idle) {",

                        "body = Text(gLoadStatusIdle);",

                        "} else if (mode == LoadStatus.loading) {",

                        "body = Text(gLoadStatusLoading); //CupertinoActivityIndicator();",

                        "} else if (mode == LoadStatus.failed) {",

                        "body = Text(gLoadStatusFailed);",

                        "} else if (mode == LoadStatus.canLoading) {",

                        "body = Text(gLoadStatusCanLoading);",

                        "} else {",

                        "body = Text(gNomoreData);",

                        "}",

                        "return Container(",

                        "height: 55.0,",

                        "child: Center(child: body),",

                        ");",

                    "},",

                    "),",

                    "controller: _refreshController,",

                    "onRefresh: _onRefresh,",

                    "onLoading: _onLoading,",

                    "child:ListView.separated(",

                    "physics: AlwaysScrollableScrollPhysics(),",

                    "controller: _scrollController,",

                    "separatorBuilder: (BuildContext context, int index){",

                        "return Divider(color: Util_Tool.themLineGrayColor,);",

                    "},",

                    "itemBuilder: _buildListItem,",

                    "itemCount: glistData.length,",

                  ")",

                ")",

            ],

            "description": "mySmartRefresher"

        },

        "myListView.separated": {

            "prefix": "ListView.separated",

            "body": [

                "ListView.separated(",

                  "physics: AlwaysScrollableScrollPhysics(),",

                  "controller: _scrollController,",

                  "separatorBuilder: (BuildContext context, int index){",

                     "return Divider(color: Util_Tool.themLineGrayColor,);",

                  "},",

                  "itemBuilder: (BuildContext context, int index){",

                      "return Text('text');",

                  "},",

                  "itemCount: glistData.length,",

              ")",

            ],

            "description": "ListView.separated"

        },

        "myText.rich": {

         "prefix": "myText.rich",

         "body": [

            "Text.rich(",

                "TextSpan(",

                    "children: [",

                            "WidgetSpan(",

                            "child: SizedBox( 14),",

                            "),",

                            "TextSpan(text: description),",

                            "WidgetSpan(",

                            "alignment: PlaceholderAlignment.middle,",

                            "child: Icon(",

                                "Icons.arrow_forward_ios,",

                                "color: Colors.white70,",

                                "size: 14,",

                            "),",

                            "),",

                        "]),",

                "style: TextStyle(",

                "color: Colors.white70,",

                "fontSize: 14,",

                "fontWeight: FontWeight.w500,",

                "),",

            "),",

         ],

         "description": "myText.rich"

        },

        "myRichTextWidgetSpan": {

         "prefix": "myRichTextWidgetSpan",

         "body": [

            "RichText(",

            "text: TextSpan(",

              "text: '登陆即同意',",

              "style: TextStyle(fontSize: 14, color: Colors.black),",

              "children: [",

                "TextSpan(",

                  "text: '"服务条款"',",

                  "style: TextStyle(fontSize: 14, color: Colors.blue),",

                  "recognizer: TapGestureRecognizer()",

                    "..onTap = () {",

                      "print('点击了服务条款');",

                    "},",

                "),",

                "TextSpan(",

                  "text: '和',",

                  "style: TextStyle(fontSize: 14, color: Colors.black),",

                "),",

                "TextSpan(",

                  "text: '"隐私政策"',",

                  "style: TextStyle(fontSize: 14, color: Colors.blue),",

                  "recognizer: TapGestureRecognizer()",

                    "..onTap = () {",

                      "print('点击了隐私政策');",

                    "},",

                "),",

                "WidgetSpan(",

                  "alignment: PlaceholderAlignment.middle,",

                  "child: Image.asset(",

                    "'assets/noavatar.png',",

                    " 20,",

                    "height: 20,",

                  "),",

                "),",

              "],",

            "),",

          "),",

         ],

         "description": "myRichTextWidgetSpan"

        },

        "mySwiperView": {

         "prefix": "mySwiperView",

         "body": [

            

            "Widget SwiperView() {",

                "return Container(",

                  "padding: const EdgeInsets.fromLTRB(0, 50, 0, 5),",

                  " MediaQuery.of(context).size.width,",

                  "height: 300,",

                  "child: Swiper(",

                    "itemCount: imageList.length,",

                    "itemBuilder: _swiperBuilder,",

                    "pagination: SwiperPagination(",

                        "alignment: Alignment.bottomRight,",

                        "margin: const EdgeInsets.fromLTRB(0, 0, 20, 10),",

                        "builder: DotSwiperPaginationBuilder(",

                        "color: Colors.black54, activeColor: Colors.white)),",

                    "controller: SwiperController(),",

                    "scrollDirection: Axis.horizontal,",

                    "autoplay: true,",

                    "onTap: (index) => print('点击了第$index'),",

                  "),",

                ");",

              "}",

            

              "Widget _swiperBuilder(BuildContext context, int index) {",

                "return (imageList[index]);",

         ],

         "description": "mySwiperView"

        },

        // "Print to console": {

        //  "prefix": "log",

        //  "body": [

        //      "console.log('$1');",

        //      "$2"

        //  ],

        //  "description": "Log output to console"

        // },

        // "Print to console": {

        //  "prefix": "log",

        //  "body": [

        //      "console.log('$1');",

        //      "$2"

        //  ],

        //  "description": "Log output to console"

        // },

        // "Print to console": {

        //  "prefix": "log",

        //  "body": [

        //      "console.log('$1');",

        //      "$2"

        //  ],

        //  "description": "Log output to console"

        // },

        // "Print to console": {

        //  "prefix": "log",

        //  "body": [

        //      "console.log('$1');",

        //      "$2"

        //  ],

        //  "description": "Log output to console"

        // },

        // "Print to console": {

        //  "prefix": "log",

        //  "body": [

        //      "console.log('$1');",

        //      "$2"

        //  ],

        //  "description": "Log output to console"

        // },

    }

  • 相关阅读:
    BasKet Note Pads-运用软件作笔记
    K3b-全功用的光盘烧录器材
    GShutDown:自动化关机小工具
    Xournal-条记抄写软件
    Metisse:相称酷的窗口操持器
    Realtek ALC268集成声卡驱动成绩在ubuntu下的处置责罚方案
    Wixi-桌面端 Wiki 运用
    Avant Window Navigator:Dock 类的窗口导航要领
    DDM:剪贴板办理及截取屏幕
    快速搞定Windows Xp Pro繁体中文版的简体支持
  • 原文地址:https://www.cnblogs.com/sundaysme/p/12602955.html
Copyright © 2011-2022 走看看