美文网首页
6.2.flutter-Plugin

6.2.flutter-Plugin

作者: ChaosHeart | 来源:发表于2020-09-11 08:20 被阅读0次

    (1)flutter Plugin (android和iOS 代码)

    截屏2020-09-09 18.18.47.png

    终端命令创建插件:

    //iOS和Android
    flutter create --template=plugin 包名(flutter_package) 
    

    -i swift : iOS平台swift语言
    -a kotlin : android平台 kotlin语言
    也可以指定平台和语言

    //iOS和Android
    flutter create --template=plugin -i swift -a kotlin  包名(flutter_package) 
    

    注意点(有些可能会出现一下情况):
    (1)报名不加下划线创建的项目


    截屏2020-09-10 11.57.48.png

    (2)使用as创建的时候,此处加下划线,是为了创建的项目里面的名字书写规范


    截屏2020-09-10 11.44.39.png

    加下划线创建的项目


    截屏2020-09-10 11.54.39.png

    所以建议使用终端命令创建,就不会出现以下情况

    (2)配置上传时的文件

    (1)pubspec.yaml

    name: flutter_ios_screenshots #(插件名字)
    description: Initiate iOS native screenshots and monitor iOS native screenshots. #(插件描述)
    version: 1.0.2 #(插件版本)
    homepage: https://www.jianshu.com/u/da7093c03e51 #(自己主页)
    

    (2)CHANGELOG.md

    ## 1.0.2 (插件版本)
    
    * TODO: Describe initial release.
    

    (3)LICENSE(#软件许可软件)

    BSD 3-Clause License
    
    Copyright (c) 2020, 1169886116
    All rights reserved.
    
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:
    
    1. Redistributions of source code must retain the above copyright notice, this
       list of conditions and the following disclaimer.
    
    2. Redistributions in binary form must reproduce the above copyright notice,
       this list of conditions and the following disclaimer in the documentation
       and/or other materials provided with the distribution.
    
    3. Neither the name of the copyright holder nor the names of its
       contributors may be used to endorse or promote products derived from
       this software without specific prior written permission.
    
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    

    可以通过在github创建仓库时得到


    截屏2020-09-22 10.07.33.png
    截屏2020-09-22 10.08.37.png
    截屏2020-09-22 10.09.10.png
    截屏2020-09-22 10.09.27.png

    参考:
    https://book.flutterchina.club/chapter12/
    https://www.yuque.com/qingjiaowohank/etm87a/qbq8gf

    相关文章

      网友评论

          本文标题:6.2.flutter-Plugin

          本文链接:https://www.haomeiwen.com/subject/eynuektx.html