📜  Flutter与Flutter2

📅  最后修改于: 2022-05-13 01:58:10.760000             🧑  作者: Mango

Flutter与Flutter2

概述 :
在本文中,我们将研究Flutter 1 和Flutter 2 之间的区别Flutter 1 是 Google 于 2017 年推出的。推出它的原因是开发者可以只使用单个代码来开发适用于 Android 等多个平台的应用程序, iOS、Linux、macOS。此处的桌面版本处于测试阶段,并且没有 Null 安全性。最近他们发布了Flutter 2,解决了flutter 1 中的所有 bug,现在桌面不再处于 beta 阶段。他们介绍的最佳功能是 Null Safety 和内置上下文菜单。

Flutter1:
Flutter 1 于 2017 年由 Google 发布,它所基于的语言是dart。引入它是为了让开发人员可以创建跨平台的应用程序,如 Android、iOS、Linux 和 Web。但当时网络功能还处于测试阶段。 Flutter应用程序提供了 60fps 到 120fps 的动画。 Flutter允许热重载、重启,为开发者节省了大量时间。网络、桌面等许多功能都处于测试阶段。 Flutter 1 使 UI 设计更加轻松和美观。但是许多错误,例如应用程序崩溃,没有内置的上下文功能以及更多功能都没有。

Flutter2:
Flutter 2 由 Google 于 2021 年发布。许多功能与Flutter 1 相同,例如 60fps 动画、热重载、重启。 Web 应用程序和桌面版本不再处于测试阶段,现在使用单一代码开发人员可以创建适用于 Android、iOS、Linux、macOS、Windows 的应用程序。解决了应用程序崩溃错误并内置了上下文,还引入了有菜单功能。所有的主要功能是flutter 2 中引入的 Null Safety。引入了两个新的小部件,名为 ScaffoldMessenger 和 AutoComplete。

Flutter 1 和Flutter 2 的区别:
在这里,我们将讨论Flutter 1 和Flutter 2 的区别。

S.No.

Flutter 1

Flutter 2

1.It had web support but in the beta version.It now supports the web and mobile.
2.Developers suffered many App crashes in Flutter 1 as it didn’t have Null Safety.Flutter 2 is introduced with the sound null safety to reduce App crashing problems.
3.It didn’t have a built-in context menu that often leads the developers to wait for the lag while they were working on touch input.Google introduced a built-in context menu in flutter 2 which includes many features like text selection and pivot points. And helped the developers to use high-precision pointing devices.
4.It didn’t have desktop support.Desktop support is to introduce in flutter 2 but it is still in the beta version.
5.iOS library searching was tough in Flutter 1. It was a very difficult process for the developers to search for one.iOS search bar UI is introduced in developed flutter 2.
6.In Flutter 1 developers had to write different codes for different platforms.Now in Flutter 2, the developers can reuse the code for both platforms.
7.None of them were in Flutter 1.Two new widgets Autocomplete and ScaffoldMessenger are introduced to Flutter 2.
8.It was a difficult task to display or load ads in Flutter 1.Google Mobile Ads SDK plugin is introduced to Flutter 2 hence making it easier to use.

结论 :
Flutter 2 比 Flutter1 更加用户友好,并且具有更多的功能。 Flutter 2 允许开发人员对所有五种操作系统使用相同的代码库:Android、iOS、Linux、Windows 和 macOS。 Flutter 1 中没有的桌面支持在Flutter 2 中介绍给我们。他们引入了 null 安全性的最佳功能,消除了不必要的 App 崩溃。