对于已经认识Android的人:
UI- Android需要XML集成,而所有内容都是flutter中的小部件,可以在一个文件中制作
听众没有更多的听众来on Clicks,请致电方法,更改状态并享受视野
findView-不再使用FindViewById() - 只需在widget(){}内完成所有操作,然后将发现留给Android
gradle-不再有Gradle问题 - 在PubSpec.yaml文件中添加依赖项,并刷新使用新库的应用程序
资产- 必须分别管理扑朔迷离,您必须声明所使用的所有内容 - 例如:图像,字体。在Android中,您可以将其添加到“文件”部分中并使用它们。
动画要容易得多,并且在颤动中得到很好的支持 - 基本用途 - 例如:飞溅活动,刷卡,结果,分析页面,导航
运行该应用程序- 在颤音中进行热重新加载 - 只需重新加载'r',然后重新启动应用程序。 Android Studio每次重新加载最多需要20-30秒,如果有Gradle问题,则每次弹出了更多
API - 可以使用不同的库(例如使用GSON的改造)来完成api -android API,而在扑朔迷离中可以进行扑来而不会疼痛。常见的提取函数可用于扑动,并具有异步等待的方法来调用API。
回收器/列表视图- 回收器视图在Android中用于在屏幕上创建不同的列表。我们需要一个具有接口的适配器,我们需要知道各种不同的功能才能完全实施它。 Flutter只有一个用于ListView的小部件,我们可以在其中定义不同的listilites或动态添加内容。容易得多,看起来更简单。
学习曲线- 一旦您知道DART,就可以轻松地在扑朔迷离中工作,这类似于JavaScript,并了解有关小部件的基本概念。 Android允许您在设计师的帮助下进行布局,可用于制作约束布局。在Android中,制作基本应用程序绝对更容易学习,但是随着我们在碎片和其他内容中的深度,它开始变得复杂
片段与组件(窗口小部件) - 我们可以在任何需要的地方简单地使用小部件组件,而与我们在Android中制作的片段不同,在使用如何使用捆绑包,适配器,XML布局和其他方法(例如OnCreateview和layoutinflator)的方法之前,我们需要一些知识。
SQL数据库- 这两种技术都非常相似。唯一的区别是,如果您试图连续添加某些内容,则状态管理可以到位,您将必须在状态中存储密钥并使用setState(){_ key+= 1} - >仅使用用例。 Android中的房间库是相当广泛的,也易于实现
体系结构模式- 一切都归结为Android中的MVP/ MVVM/ MVC,而我们在Flutter中有bloc和提供商,它们的作用类似于MVC,通过创建水槽和流来分开业务逻辑
代码编辑器- VSCODE/ANDROID Studio -Android的Flutter和Android Studio
入门指南- 对于Android来说非常直截了当,下载录音室并入门,而您必须做很多事情来扑朔迷离 - 可能很烦人
firebase-扑面而为的资源: -
https://firebase.google.com/docs/flutter/setup
https://flutter.dev/docs/development/data-and-backend/firebase
https://www.youtube.com/watch?v=8m-fa239hy4
https://www.youtube.com/channel/ucftm1fgjzskospdzgtbp7ha/search?query=fireBase
https://codelabs.developers.google.com/codelabs/flutter-firebase/#0
FIREBASE连接- 绝对易于实现飞行,您可以根据您制作的列表视图在20行代码中进行操作。基础知识是相同的,您需要.json文件,并且必须将其添加到Firebase控制台中。在颤抖中进行编码有助于您以更好的方式理解它。总体而言,这是相似的。
Lists + Firebase- Android具有疯狂的回收器视图,使一切变得如此艰难,并且集成Firebase + Recycler View有大约200篇文章,而您无法掌握它。没有教程,我无法在Android中实施某些内容
获取,推动数据- 在flutter Firebase中也更容易推动数据,实际上有一个ontap()方法,它允许您发送数据快照
机器学习- 集成机器学习
UI -Flutter和RN具有一个一个文件系统,您可以在其中定义规则和UI。我个人喜欢Flutter应用程序的接口,因为它的定义更为明确。它也由Google维护,该Google拥有Android,并且可以与Google进行更好的集成。
类- Flutter使用小部件来实现所有内容,从文本视图到TabViews - 它们称为“小部件”。 Flutter使用DART,而React Antive使用Typescript或JavaScript。
组件-RN具有组件,我们必须从“反应原始”中导入它们才能使用它们。 Flutter具有可以在类似空间中使用的小部件。两者都相似,除了样式和渲染部分。
造型颤动 - 内部小部件 - 因此,如果您想要填充=>将小部件包裹在padding()窗口小部件中,请用一些填充,反应本机:定义const样式:样式表并在此处添加样式 - 类似于拥有CSS的Web样式。因此,React Native具有CSS样式,而Flutter具有“小部件”样式
动画- 颤动更容易抓取,而React Antial具有更广泛的方面
学习曲线- 反应天然和颤动的相似之处。
库-NPM有助于对本机进行反应,而对于flutter,我们只将其添加到PubSpec.yaml文件中
API-他们俩对使用API都有清晰的愿景。 RN的好文章-https://medium.com/better-programming/handling-api-like-a-boss-boss-inct-natt-native-364abd92dc3d
代码编辑器- vs代码都很受欢迎
入门- 就个人而言,与Windows上的React Native一起工作真的很难。如果您使用Mac,那会好多了,但是总体而言,红屏会让您烦恼很多。 Flutter没有最简单的入门指南,但是那里有帮助您的支持。
总的来说- 两者都可以制作交叉本地应用程序,我会在任何一天选择颤抖 - 黑客马拉松/快速项目/学习Android,并进行反应本机 - Web/ Learn react.js/ - >如果您想强调自己:P



fetch () async {
var url = "API-HERE" ;
var res = await http. get (url);
var body = jsonDecode (res.body);
// body is your API body
}content description类的内容添加到Android中的按钮,TextView等。 https://steemit.com/utopian-io/@tensor/advanced-flutter-project-- best-practices--基因 - 基因 - 基督 - 哥伦比亚省 - 帕特 - 三者 - part-three
class App extends StatelessWidget {
@override
Widget build ( BuildContext context) {
// TODO: implement build
return MaterialApp (
home : Home (),
theme : ThemeData (primaryColor : PrimaryColor ), //add-your-color here || or remove this
debugShowCheckedModeBanner : false ,
);
}
}
class Home extends StatefulWidget {
@override
State < StatefulWidget > createState () {
// TODO: implement createState
return new _HomeState ();
}
}
class _HomeState extends State < Home >{
@override
Widget build ( BuildContext context) {
return Scaffold (
body : Column ()
);
}child : users.length <= 0
? Center (
child : EmptyState (
title : 'Oops' ,
message : 'Add form by tapping add button below' ,
),
)
: ListView . builder (
addAutomaticKeepAlives : true ,
itemCount : users.length,
itemBuilder : (_, i) => users[i],
),
) fetch () async {
var url = "API-HERE" ;
var res = await http. get (url);
var body = jsonDecode (res.body);
// body is your API body
} for ( int i = 0 ;i < body[ 0 ][ 'staggered_tiles' ].length;i ++ ){
_staggeredTiles. add ( new StaggeredTile . count (
body[ 0 ][ 'staggered_tiles' ][i][ 'cross_axis' ], // body is what we get from the API
body[ 0 ][ 'staggered_tiles' ][i][ 'main_axis' ] // body is what we get from the API
));
}
if (body[i][ 0 ][ 'type' ] == 'donut' ) {
List < LabelPieSales > _d = [];
for ( int j = 0 ; j < body[i][ 0 ][ 'data' ].length; j ++ ) {
_d. add ( new LabelPieSales (
body[i][ 0 ][ 'data' ][j][ 'year' ], body[i][ 0 ][ 'data' ][j][ 'sales' ])); // body is what we get from the API
}
_wid_top. add ( new Container (
height : 200 ,
width : 200 ,
child : DonutChartWidget . withSampleData (_d),
));
}
else if (body[i][ 0 ][ 'type' ] == 'label-pie' ) {
List < LabelPieSales > _d = [];
for ( int j = 0 ; j < body[i][ 0 ][ 'data' ].length; j ++ ) {
_d. add ( new LabelPieSales (
body[i][ 0 ][ 'data' ][j][ 'year' ], body[i][ 0 ][ 'data' ][j][ 'sales' ])); // body is what we get from the API
}
_wid_top. add ( new Container (
height : 200 ,
width : 200 ,
child : SimpleBarChart . withSampleData (_d),
));
} return Container (
padding : const EdgeInsets . all ( 4.0 ),
child : appState.isFetching
? CircularProgressIndicator ()
: appState. getResponseJson () != null
? ListView . builder (
primary : false ,
shrinkWrap : true ,
itemCount : appState. getResponseJson ().length,
itemBuilder : (context, index) {
return Container (
height : 100 ,
width : 100 ,
child : graph (appState. getResponseJson ()),
);
},
)
: Text ( "Press Button above to fetch data" ),
); initDB () async {
return await openDatabase (
join ( await getDatabasesPath (), 'graphs_database.db' ),
onCreate : (db, version) {
return db. execute (
"CREATE TABLE graphs(id INTEGER PRIMARY KEY, type TEXT)" ,
);
},
version : 1 ,
);
}floatingActionButton : FloatingActionButton (
child : Icon ( Icons .add),
onPressed : () async {
Dog dog = new Dog (id : _id, name : "name" ,age : 22 );
await insertDog (dog);
setState (() {
_id += 1 ;
});
},
), List < Graph > graphs_sql = await graphs ();
List < String > graphs_sql_types = [];
for ( int i = 0 ;i < graphs_sql.length;i ++ ){
graphs_sql_types. add (graphs_sql[i].type);
}
if (graphs_sql.length != _types.length) {
for ( int i = 0 ; i < _types.length; i ++ ) {
if ( ! graphs_sql_types. contains (_types[i])){ // add only if a new type
await insertGraph ( new Graph (id : i, type : _types[i]));
}
}
} launchUrl () {
setState (() {
urlString = controller.text;
flutterWebviewPlugin. reloadUrl (urlString);
});
} class News {
String dateAdded;
String title;
String body;
String level;
String category;
News ( this .dateAdded, this .title, this .body, this .level, this .category);
}
class Record {
final String name;
final int votes;
final DocumentReference reference;
Record . fromMap ( Map < String , dynamic > map, { this .reference})
: assert (map[ 'name' ] != null ),
assert (map[ 'votes' ] != null ),
name = map[ 'name' ],
votes = map[ 'votes' ];
Record . fromSnapshot ( DocumentSnapshot snapshot)
: this . fromMap (snapshot.data, reference : snapshot.reference);
@override
String toString () => "Record<$ name :$ votes >" ;
} double _height = MediaQuery . of (context).size.height;
double _width = MediaQuery . of (context).size.width; @override
void initState () {
// TODO: implement initState
super . initState ();
_image = {url};
localList1 = globalList1;
localList1 = globalList2;
} export const sendToTopic = functions.firestore
.document( 'recipes/{recipyId}' )
.onCreate(async snapshot => {
// const recipe = snapshot.data();
const payload : admin.messaging.MessagingPayload = {
notification: {
title: 'new recipe added, check it out' ,
body: 'Make it and eat it'
}
};
return fcm. sendToTopic ( 'recipes' , payload);
}); @override
Widget build ( BuildContext context) {
return Scaffold (
appBar : AppBar (title : Text ( 'Recipes for you' )),
body : _buildBody (context),
);
}
Widget _buildBody ( BuildContext context) {
return StreamBuilder < QuerySnapshot >(
stream : Firestore .instance. collection ( 'recipes' ). snapshots (),
builder : (context, snapshot) {
if ( ! snapshot.hasData) return LinearProgressIndicator ();
return _buildList (context, snapshot.data.documents);
},
);
} List<Recipe> recipe_list = [];
// snapshot.map((data) => recipeList(context, data).toList());
for(int i=0;i<snapshot.length;i++){
Recipe recipe = Recipe.fromSnapshot(snapshot[i]);
recipe_list.add(recipe);
}
return AsymmetricView(products: recipe_list,);