合肥在线网_专业打造合肥市网民最喜欢的企业资讯平台
您当前的位置 : 合肥在线网  >  美食
一个简单的flutter material APP应用Android IOS可运行建议收藏
2020-03-29 11:06:33 来源:互联网 阅读:-

本头条核心宗旨

欢迎来到「技术刚刚好」作者,「技术刚刚好」是个人维护,每天至少更新一篇Flutter技术文章,实时为大家播报Flutter最新消息。如果你刚好也在关注Flutter这门技术,那就跟我一起学习进步吧,你的赞,收藏,转发是对我个人最大的支持,维护不易,欢迎关注。

技术刚刚好经历

近几年,移动端跨平台开发技术层出不穷,从Facebook家的ReactNative,到阿里家WEEX,前端技术在移动端跨平台开发中大展身手,技术刚刚好作为一名Android开发,经历了从Reactjs到Vuejs的不断学习。而在2018年,我们的主角变成了Flutter,这是Goolge开源的一个移动端跨平台解决方案,可以快速开发精美的移动App。希望跟大家一起学习,一起进步!

今天我来介绍一个简单入门的flutter应用,


项目结构

main.dart文件

import 'package:flutter/material.dart';void main() {  runApp(MaterialApp(      // Title      title: "Simple Material App",      // Home      home: Scaffold(        // Appbar        appBar: AppBar(          // Title          title: Text("Simple Material App"),        ),        // Body        body: Container(          // Center the content          child: Center(            // Add Text            child: Text("Hello World!"),          ),        ),      )));}

pubspec.yaml文件

name: simple_material_appdescription: A new Flutter project.dependencies:  flutter:    sdk: flutterdev_dependencies:  flutter_test:    sdk: flutter# For information on the generic Dart part of this file, see the# following page: https://www.dartlang.org/tools/pub/pubspec# The following section is specific to Flutter.flutter:  # The following line ensures that the Material Icons font is  # included with your application, so that you can use the icons in  # the Icons class.  uses-material-design: true  # To add assets to your application, add an assets section, like this:  # assets:  #  - images/a_dot_burr.jpeg  #  - images/a_dot_ham.jpeg  # An image asset can refer to one or more resolution-specific "variants", see  # https://flutter.io/assets-and-images/.  # To add assets from package dependencies, first ensure the asset  # is in the lib/ directory of the dependency. Then,  # refer to the asset with a path prefixed with  # `packages/PACKAGE_NAME/`. The `lib/` is implied, do not  # include `lib/` in the asset path.  #  # Here is an example:  #  # assets:  #  - packages/PACKAGE_NAME/path/to/asset  # To add custom fonts to your application, add a fonts section here,  # in this "flutter" section. Each entry in this list should have a  # "family" key with the font family name, and a "fonts" key with a  # list giving the asset and other descriptors for the font. For  # example:  # fonts:  #   - family: Schyler  #     fonts:  #       - asset: fonts/Schyler-Regular.ttf  #       - asset: fonts/Schyler-Italic.ttf  #         style: italic  #   - family: Trajan Pro  #     fonts:  #       - asset: fonts/TrajanPro.ttf  #       - asset: fonts/TrajanPro_Bold.ttf  #         weight: 700

谢谢观看技术刚刚好的文章,技术刚刚好是个人维护,每天至少更新一篇Flutter技术文章,实时为大家播报Flutter最新消息。如果你刚好也在关注Flutter这门技术,那就跟我一起学习进步吧,你的赞,收藏,转发是对我个人最大的支持,维护不易,欢迎关注。

推荐阅读:苹果7p参数配置

频道推荐
  • 还记得飞信吗?如果中国移动把飞信做好,是不是就没微信什么事了
    还记得飞信吗?如果中国移动把飞信做好,是不是

    有些年龄的中国移动用户对飞信应该不太陌生你用过飞信吗?你还记得飞信吗?飞信已经淡出我们的视野太久,以至于年轻些的网友根本就不知道中国移动曾经推出过如此有前瞻性的...

    2019-12-24
  • 这厂商抄上瘾了,海报直接抄小米,手机复刻iPhone11 Pro
    这厂商抄上瘾了,海报直接抄小米,手机复刻iP

    小米在今年动作不断,在更新传统产品线的同时,积极开拓新的产品线,在今年打造了小米CC系列,专门面向年轻用户。在小米CC9Pro这款手机上,更是搭载了一亿像素的镜...

    2019-12-24
  • 苹果“智能戒指”正在赶来,果粉会跟风出手吗?
    苹果“智能戒指”正在赶来,果粉会跟风出手吗?

    苹果在智能穿戴方面一直处于领先地位,苹果的Apple Watch更是在智能手表领域,占据了不可捍卫的市场地位,Air Pods在上市后就成为了市场热门产品。早在...

    2019-12-24
  • 诺基亚重塑金身,新机机身通过军方标准,摔不坏的诺基亚回来了
    诺基亚重塑金身,新机机身通过军方标准,摔不坏

    在功能时代大放异彩的诺基亚在如今这个时代似乎已经找不到自己的位置了,转型智能手机不论是硬件还是系统不仅比不过苹果和华为,就连小米、OPPO、vivo等中低端品牌...

    2019-12-24
  • 大疆最新专利:无人小车360度旋转车轮,崎岖道路也能大展身手
    大疆最新专利:无人小车360度旋转车轮,崎岖

    大疆无人机在消费级市场中,一直是不可忽略的身影。据中商产业研究院数据显示,2018 年大疆无人机占全球市场份额 74%。然而,近两年,消费级无人机市场空间窄、消...

    2019-12-24
  • 请不要叫我们电动汽车
    请不要叫我们电动汽车

    电动汽车刚出来那一会,续航里程从200公里上升到300公里,然后到400公里,在这段期间,续航里程成为电动汽车唯一的关注点。因为在不同的环境下,比如零下温度;不...

    2019-12-24