我扑在书上就像饥饿的人扑在_扑向下一件大事

我扑在书上就像饥饿的人扑在

Most experienced developers have seen many frameworks come and go in their lifetime. Very few stick on to become legendary like ReactJS. So there is always an inertia with any thing new in general. But Flutter has managed to create quite a flutter!

大多数经验丰富的开发人员在他们的一生中已经看到了许多框架。 很少有像ReactJS那样成为传奇的。 因此,总的来说,任何新事物总是存在惯性。 但是Flutter已经成功地制造了一个颤动!

Just officially released in late December 2018, it took roughly a year to gain more popularity than React Native on both GitHub and Stack Overflow.

刚刚于2018年12月下旬正式发布,在GitHub和Stack Overflow上,比React Native流行起来花了大约一年的时间。

Just have a look at the survey below!

看看下面的调查吧!

Survey

为什么现在要颤动 (Why Flutter now)

It is more than just a framework. This is a superior next generation framework as a tool. The best choice for MVP i.e. Minimum Viable Product in 2020. If you want to building a sleek mobile app, having only a single codebase for your project, Facebook’s React Native and Google’s Flutter are the most formidable contenders today.

它不仅仅是一个框架。 这是一种出色的下一代框架工具。 MVP的最佳选择,即2020年最低可行产品。如果您想要构建一个时尚的移动应用程序,并且只有一个代码库用于您的项目,那么Facebook的React Native和Google的Flutter就是当今最强大的竞争者。

A Flutter app is cheaper compared to the cost of two native apps. The development team is relatively smaller with linear processes. You can spend more time on polishing the app’s features.

与两个本机应用程序的成本相比,Flutter应用程序更便宜。 开发团队的规模相对较小,只有线性流程。 您可以花更多时间在完善应用程序的功能上。

Flutter基于Dart (Flutter is based on Dart)

Dart is relatively easy to pick up and is a good programming language though it does not have the popularity that JavaScript has. A developer trying out Flutter would need to learn Dart. Typically, developers from a C++ or Java background can relate to Dart more than a full-stack JavaScript developer.

Dart相对容易拿起,并且是一种很好的编程语言,尽管它没有JavaScript那样受欢迎。 试用Flutter的开发人员需要学习Dart。 通常,具有C ++或Java背景的开发人员与Dart的关系比与全栈JavaScript开发人员的联系还多。

The below graphs shows the growing number of queries on Flutter in Stack Overflow.

下图显示了Stack Overflow中Flutter的查询数量不断增长。

Image for post

颤振的优点 (Advantages of Flutter)

1.使用Dart (1. Use of Dart)

Dart is an excellent language with no standardization issues. Dart has some similarity with TypeScript which most full stack developers know. That makes it very natural to adopt.

Dart是一种出色的语言,没有任何标准化问题。 Dart与TypeScript有一些相似之处,大多数全栈开发人员都知道。 这使得采用非常自然。

2.设计 (2. Design)

Flutter was designed ground up on top of Dart and a fast high-performance rendering engine, Skia. Flutter is not directly compiled to iOS or Android apps. Apps are launched based on a combination of rendering engine (built on C++) and Flutter (built on Dart). All files generated this way attach to each app and SDK assemblies software for a specific platform.

Flutter是在Dart和快速高性能渲染引擎Skia之上进行设计的。 Flutter不能直接编译为iOS或Android应用程序。 应用是基于渲染引擎(基于C ++构建)和Flutter(基于Dart构建)的组合启动的。 以这种方式生成的所有文件都将附加到特定平台的每个应用程序和SDK程序集软件。

All apps based on the Flutter SDK replace parts of native frameworks with Flutter elements. Although it can impact the size of the end app, performance is still quite remarkable, rendering is made with speeds up to 120 fps.

所有基于Flutter SDK的应用程序都使用Flutter元素替换了部分本机框架。 尽管它会影响最终应用程序的大小,但性能仍然非常出色,渲染速度高达120 fps。

Due to native compilation for ARM processors, simple rendering, and a set of integrated widgets and tools, Flutter makes the development process simpler. Also it offers a few very exciting feature like Hot Reload.

由于针对ARM处理器的本机编译,简单的呈现以及一组集成的小部件和工具,Flutter使开发过程更简单。 它还提供了一些非常令人兴奋的功能,例如热重装。

Flutter comes with all native widgets for Android and iOS interfaces like Material Design and Cupertino. Besides, the framework can change the behavior of separate elements to create similar UX for the app’s users.

Flutter随附了适用于Android和iOS界面的所有本机小部件,例如Material Design和Cupertino。 此外,框架可以更改单独元素的行为,以为应用程序用户创建类似的UX。

Flutter makes it possible to implement discrete file compilation in the dev mode. JiT compilation speeds up development and software debugging.

Flutter使在dev模式下实现离散文件编译成为可能。 JiT编译加快了开发和软件调试的速度。

Flutter allows for a flexible and scalable backend. It supports plugins like Firebase, SQLite, and many more. Firebase makes the app’s infrastructure scalable, serverless and redundant.

Flutter允许灵活且可扩展的后端。 它支持Firebase,SQLite等插件。 Firebase使该应用程序的基础架构可扩展,无服务器且具有冗余性。

3.人气上升 (3. Rising Popularity)

Just released late 2018, it has already surpassed the popularity of React Native on both GitHub and Stack Overflow. Flutter’s very high performance compilation and different code efficiency factors are the primary contributors to its meteoric rise. These are the reasons why Flutter holds prominence and popularity in the field of mobile app development.

刚刚于2018年末发布,它已经在GitHub和Stack Overflow上超过了React Native的普及。 Flutter的高性能编译和不同的代码效率因素是其飞速发展的主要原因。 这就是Flutter在移动应用程序开发领域占据突出地位和受欢迎程度的原因。

4.大规模开发采用 (4. Massive Dev Adoption)

This means that for your application, there is a greater pool of resources to learn from, more skilled developers available to work on your app, and faster iterations over the technology itself. This also meaning that it will grow and mature faster and stay relevant much longer.

这意味着对于您的应用程序,有更多的资源可供学习,可以使用更熟练的开发人员来处理您的应用程序,并且可以在技术本身上进行更快的迭代。 这也意味着它将更快地成长和成熟,并保持更长的相关时间。

The dev community is evolving and there is a ready resource pool in the market for hiring. Thus companies can take a decision in favor of Flutter without any hiring hiccups. Also there are many Flutter open-source apps.

开发人员社区正在不断发展,市场上有可供招聘的现成资源库。 因此,公司可以在不招募员工的情况下做出支持Flutter的决定。 另外,还有许多Flutter 开源应用程序。

5.速度 (5. Speed)

Flutter applications can easily achieve a steady 60fps on most devices and an incredible 120fps on supported devices . It’s true that building truly native apps is hard to beat in terms of performance and smooth rendering but when it comes to cross-platform frameworks, Flutter has clear advantages over the competition. Instead of being a wrapper on top of native UI components like React Native and Xamarin, Flutter draws the UI from scratch.

Flutter应用程序可以轻松地在大多数设备上实现稳定的60fps,在受支持的设备上实现惊人的120fps。 确实,构建真正的本机应用程序在性能和流畅呈现方面很难被击败,但是在跨平台框架方面,Flutter具有明显的竞争优势。 Flutter并没有像React Native和Xamarin这样的本地UI组件之上包装,而是从头开始绘制UI。

Flutter apps are divided into native binaries that are based on graphics and rendering engines built-in C/C++. As a result of which, it produces a fast and high performing app.

Flutter应用程序分为基于二进制和基于内置C / C ++的渲染引擎的本机二进制文件。 结果,它产生了一个快速,高性能的应用程序。

6.跨平台 (6. Cross Platform)

The Flutter SDK is a cross-platform tool. It allows us to develop for desktop, mobile, and the Web using a single codebase. It also allows you to create beautiful UIs with Flutter’s widgets, layers and interactive assets.

Flutter SDK是跨平台的工具。 它使我们能够使用单个代码库针对台式机,移动设备和Web进行开发。 它还允许您使用Flutter的小部件,图层和交互式资产创建漂亮的UI。

Flutter Web, one of the most hyped features of Flutter implies that it has entered the web world. With the help of standard web technologies like HTML, CSS, and JavaScript, the apps built-in Flutter can comply and run in any modern browsers.

Flutter Web是Flutter最受推崇的功能之一,它暗示它已经进入了Web世界。 借助HTML,CSS和JavaScript等标准网络技术,Flutter内置的应用程序可以在任何现代浏览器中兼容并运行。

The same code base that is required to build Android and iOs apps also help in creating Flutter web applications. The mobile UIs for mobile are for large screens as there are different browsers on a desktop or laptop. Many widgets help Flutter to make this possible and responsive. The LayoutBuilder widget builder function has box constraints. The constraints can help show or hide the UI. With the help of the media query method in-built functions, you can know the device size. Thus the mobile app adjusts for the Web.

构建Android和iOs应用程序所需的相同代码库也有助于创建Flutter Web应用程序。 移动设备的移动用户界面适用于大屏幕,因为台式机或笔记本电脑上有不同的浏览器。 许多小部件可帮助Flutter使之成为可能并且响应Swift。 LayoutBuilder小部件构建器函数具有框约束。 约束可以帮助显示或隐藏UI。 借助媒体查询方法的内置功能,您可以知道设备的大小。 因此,移动应用程序会针对Web进行调整。

Flutter for Desktop i.e. macOS Flutter is in the alpha stage. This clearly means that the Flutter team will not stop with web support.

Flutter for Desktop,即macOS Flutter处于alpha阶段。 显然,这意味着Flutter团队将不会停止提供网络支持。

Currently there are a handful of plug-ins available for macOS support. So, there are a lot of considerations as an option for development. But, it is quite stable. New Flutter master, dev, and beta channels provide improved support for the web.

当前,有少数插件可用于macOS支持。 因此,有很多考虑作为开发的选择。 但是,它非常稳定。 Flutter的新的master,dev和beta频道为Web提供了更好的支持。

7.易学曲线 (7. Easy learning curve)

The Flutter documentation is very comprehensive with lots of good examples. A developers from a C++ or Java background can pick up Dart based Flutter as it is very similar. Also native developers will find it very natural and flowing.

Flutter文档非常全面,有很多很好的例子。 具有C ++或Java背景的开发人员可以选择基于Dart的Flutter,因为它非常相似。 同样,本地开发人员也会发现它非常自然和流畅。

8.单一代码库 (8. Single codebase)

Flutter supports both Android and iOS mobile platforms and lets you run everything off one codebase. Having various widgets, a complex UI is built that looks similar on different versions of operating systems.

Flutter支持Android和iOS移动平台,并允许您在一个代码库中运行所有内容。 具有各种小部件,构建了一个复杂的UI,在不同版本的操作系统上看起来相似。

9.开发人员友好 (9. Developer Friendly)

Flutter is supported on many different IDEs like IntelliJ and VS Code. Also supported on Android Studio. The user can download Flutter and dart plug-ins to begin the integration.

Flutter在许多不同的IDE(如IntelliJ和VS Code)上受支持。 在Android Studio上也受支持。 用户可以下载Flutter和dart插件来开始集成。

10.更少的开发时间 (10. Less development time)

You can create high performance applications in record time. Any beautiful interfaces in no time.

您可以在创纪录的时间内创建高性能应用程序。 任何精美的界面都将立即出现。

In Flutter, the user interface is built with widgets, small UI building blocks assembled using a technique called Composition, very similar to React components.

在Flutter中,用户界面由小部件,使用称为Composition的技术组装的小型UI构建块构建而成,与React组件非常相似。

There are two sets of widgets available out of the box:

开箱即用的有两组小部件:

  1. Material Design, which is compatible with Google’s design guidelines

    材料设计,与Google的设计指南兼容
  2. Cupertino, compatible with Apple’s Human Interface Guidelines for iOS.

    Cupertino,与Apple iOS的人机界面指南兼容。

Flutter manages every pixel of the screen and our widgets will look the same on every mobile device, even the older ones Thus removing device support woes allowing user interfaces that look exactly similar on both Android and iOS.

Flutter管理着屏幕上的每个像素,我们的小部件在每个移动设备上(甚至是较旧的设备)都将看起来相同,因此消除了设备支持的麻烦,使用户界面在Android和iOS上看起来都非常相似。

Very fast development with Hot reload. The hot reload feature provides the ability to introduce changes on-the-fly, allowing you to see them immediately during development. When you click on the Hot Reload button, all changes in code are reflected in gadgets, emulators, and simulators simultaneously. The app continues from where it was before and the code updates while execution continues.

通过热重装实现非常快速的开发。 热重载功能提供了动态引入更改的功能,使您可以在开发过程中立即看到它们。 当您单击Hot Reload按钮时,所有代码更改将同时反映在小工具,仿真器和仿真器中。 该应用程序从之前的位置继续运行,并且代码在执行过程中不断更新。

国家管理 (State Management)

Flutter may be a young development tool, there are many things that excites us. One thing which is beautifully handled is state management. Let us look at some of the simple approaches to this complex topic.

Flutter可能是一个年轻的开发工具,有很多东西使我们兴奋。 一件精美的事是状态管理。 让我们看看解决这个复杂主题的一些简单方法。

  1. Provider : If you are new to Flutter and you don’t have a strong reason to choose another approach like Redux, Rx, hooks, etc, this is probably the approach to start with.

    提供者:如果您是Flutter的新手,并且没有足够的理由选择其他方法,例如Redux,Rx,Hooks等,那么这可能就是开始的方法。
  2. setState : This is a very good feature to manage states. People familiar with ReactJS already know this concept. The very low-level approach to use for widget-specific and ephemeral state.

    setState:这是管理状态的很好的功能。 熟悉ReactJS的人已经知道这个概念。 用于小部件特定和短暂状态的非常低级的方法。
  3. InheritedWidget & InheritedModel

    InheritedWidget和InheritedModel

    The low-level approach used to communicate between ancestors and their children in the widget tree. This is what actually providers and many other approaches use under the hood.

    在小部件树中用于祖先与其子代之间进行通信的低级方法。 这实际上是提供者和许多其他方法在后台使用的方法。

  4. Redux : A state container approach familiar to many web developers. Redux implementation in Dart relies on the ScopedModel. The state is in one class that has the ability to change by action dispatch within the app. Changing the state further rebuilds the widget.

    Redux:许多Web开发人员都熟悉的状态容器方法。 Dart中的Redux实现依赖于ScopedModel。 状态处于一个类中,该类具有通过应用程序内的动作分派进行更改的能力。 更改状态将进一步重建小部件。
  5. BLoC / Rx : A family of stream and observable based patterns.

    BLoC / Rx:基于流和可观察的模式的系列。
  6. MobX : A popular library based on observables and reactions. The concept consists of Observables, Actions, and Reactions. Observables are changing data.

    MobX:基于观察和React的流行库。 该概念由可观察对象,动作和React组成。 观察值正在改变数据。
  7. GetX : A very simplified reactive state management solution.

    GetX:非常简化的React状态管理解决方案。

颤振的缺点 (Drawbacks of Flutter)

Nothing is perfect and there is always something that can improve. The road to becoming a legendary framework is beset with some hurdles.

没有什么是完美的,总有可以改善的地方。 成为传奇框架的道路充满了一些障碍。

  1. As of today, the popularity of dart is low compared to Java/Kotlin for Android or Swift/Objective-C for iOS. Flutter cannot avoid Dart. Even it’s killer feature, Hot Reload will not work without Dart.

    截至今天,与Android的Java / Kotlin或iOS的Swift / Objective-C相比,dart的普及率较低。 Flutter无法回避Dart。 即使是杀手级功能,如果没有Dart,Hot Reload也无法使用。
  2. Flutter apps are quite bigger in size compared to native developed applications

    与本机开发的应用程序相比,Flutter应用程序的大小要大得多
  3. It cannot support apps for 32-bit iOS devices like those older than iPhone 5s. It you cannot run Flutter on your 32-bit Windows too.

    它不支持32位iOS设备的应用程序,例如比iPhone 5s早的设备。 它也不能在32位Windows上运行Flutter。
  4. It has limitations in terms of UI rendering on native platforms like video on Apple TV and Android TV.

    就本地平台(如Apple TV和Android TV上的视频)的UI渲染而言,它具有局限性。
  5. Any features that are newly added on native iOS and Android systems will naturally be introduced in Flutter later. The native versions will always lead ahead.

    在本机iOS和Android系统上新添加的任何功能自然会在以后的Flutter中引入。 本机版本将始终领先。
  6. Flutter is a relatively new framework and has limited number of libraries. The developers community did not get had enough time to develop as many libs as native languages offer. Currently there are over 4000 libraries that can be used with Flutter apps.

    Flutter是一个相对较新的框架,并且库的数量有限。 开发人员社区没有足够的时间来开发本机语言提供的尽可能多的库。 当前,有超过4000个可与Flutter应用程序一起使用的库。
  7. Although Flutter is easy to learn, you might need some experience with native app development to build a production ready cross-platform app.

    尽管Flutter很容易学习,但是您可能需要一些本机应用程序开发经验才能构建可用于生产环境的跨平台应用程序。
  8. With Flutter, there is always a chance you are the first one facing a particular problem and there is little hope that someone will help you out.

    使用Flutter,您总是有机会成为第一个面临特定问题的人,几乎没有希望有人会帮助您的。

技术支持 (Technology Backing)

The brand Google is enough to signal a positive emotion. Also some very big companies have switched to Flutter, such as Google Ads, Alibaba, Reflectly, Hamilton music and many more.

Google品牌足以表达一种积极的情感。 也有一些非常大的公司转向Flutter,例如Google Ads,阿里巴巴,Reflectly,汉密尔顿音乐等等。

To set a lower the entry barrier, Google has carefully worked out documentation and resources. Also there are different specialization tracks based on your background.

为了降低进入门槛,Google精心设计了文档和资源。 另外,根据您的背景,还有不同的专业化途径。

  1. Android

    安卓系统

  2. iOS

    的iOS

  3. React Native

    React本机

  4. Xamarin.Forms

    Xamarin表格

  5. Web

    网页

比ReactNative更好 (Better than ReactNative)

Flutter uses Dart, an object-oriented programming language that supports static typing and exhibits a syntax that is quite different from JavaScript.

Flutter使用Dart,Dart是一种面向对象的编程语言,支持静态类型化,并具有与JavaScript完全不同的语法。

Flutter is written in Dart that eliminates JavaScript Bridge while compiling to native machine code. This compiles and releases an application way faster than you do with React Native.

Flutter用Dart编写,在编译为本地机器代码时消除了JavaScript Bridge。 这比使用React Native更快地编译和发布应用程序。

Also Flutter performs better than React Native because Flutter does not have a JavaScript bridge like React Native to interact with native components. Dart code is compiled to native machine code, hence eliminating the JS bridge. This hugely improves the performance in comparison to React Native.

Flutter的性能也比React Native更好,因为Flutter没有像React Native这样JavaScript桥与本地组件进行交互。 Dart代码被编译为本机代码,从而消除了JS桥。 与React Native相比,这极大​​地提高了性能。

结论 (Conclusion)

If Flutter sticks around, it could bring you some exciting mobile development experience and opportunities in the future. You are looking at one very potent future tool.

如果Flutter坚持不懈,它将为您带来未来一些激动人心的移动开发经验和机会。 您正在寻找一种非常强大的未来工具。

All the very best Flutter!

祝一切顺利!

翻译自: https://medium.com/@gp.greatworld/flutter-the-next-big-thing-b7b901d1fd1b

我扑在书上就像饥饿的人扑在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值