flutter之快捷代码块

时间:2020-03-31 11:14:00   收藏:0   阅读:157

"myscaffold": {

        "prefix": "myscaffold",

        "body": [

            "Scaffold(",

                "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: () { },",

                        "),",

                    "],",

                "),",

                "body: Container(",

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

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

                "),",

            ");",

        ],

        "description": "ScaflodWidget"

    },

 

    "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"

    },

    "myText": {

        "prefix": "myText",

        "body": [

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

        ],

        "description": "myText"

    },

    "myTextStyle": {

        "prefix": "myTextStyle",

        "body": [

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

        ],

        "description": "myTextStyle"

    },

    "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:10,color:Colors.greenAccent),",

                   "),",

                  "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"

    },

    "myListTile": {

        "prefix": "myListTile",

        "body": [

            "ListTile(",

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

              "trailing: ClipOval(",

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

                  "width: 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": "myListTile"

    },

    "myNavigator": {

        "prefix": "myNavigator",

        "body": [

            "Navigator.push(context, ",

                "MaterialPageRoute(",

                "builder: (context){",

                    "return RegisterAccount();",

                "},",

                "fullscreenDialog: true",

                "),",

            ");",

        ],

        "description": "myNavigator"

    },

    "myNavigatorpop": {

        "prefix": "myNavpop",

        "body": [

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

        ],

        "description": "Navigator"

    },

    "myNavigatorpopUtil": {

        "prefix": "myNavpopUtil",

        "body": [

            "Navigator.pushAndRemoveUntil(",

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

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

                

                ");",

        ],

        "description": "NavigatorUtil"

    },

    "myIcon": {

        "prefix": "myIcon",

        "body": [

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

        ],

        "description": "Icon"

    },

    

 

    

}

 

原文:https://www.cnblogs.com/sundaysme/p/12602955.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!