SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Flutter vs React
Native
Nguyễn Đức Hoàng – Trịnh Minh Cường
React Native Flutter
Cross Platform
Hot Reload
Suitable to build business apps
Call native API iOS, Android
REST, WebSocket, GraphQL
GoogleFacebook
JavaScript – JavaScript Core
Born 2015
Good for Web developer
Component -> DOM
Build a bit slower
Render slower
Very strong community
Many cool components
Dart – Dart VM
Born 2017
Good for iOS, Android
Widget: stateless / stateful
Build faster, binary bigger
Render graphics better
Smaller community
Support gRPC
Easy config, better tool
CHỌN FRAMEWORK MOBILE NÀO?
IOS/Android React Native Flutter ResponsiveWeb
Tối ưu tốc độ, trải nghiệm
Code nhanh
Thân thiện web dev
Cộng đồng lớn, ổn định
Tiết kiệm chi phí code
Chạy offline, native API
REST,Socket,QraphQL,gRPC
UI đồng nhất IOS-Android
Google Search
Google Docs
Google Maps
Android
TensorFlow
Materialize Design
Golang
Kubernetes
Google Apps
Google Cloud
Dart
Google Home
Google Play
FireBase
gRPC
Google Car Waymo
Google GlassesGoogle Home
YouTube
main() {
var number = 1.618;
var title = 'Golden ratio';
print("$title is $number");
for (int i = 0; i < 5; i++) {
print(i);
}
}
Golden ratio is 1.618
0
1
2
3
4
Dart dễ học, cú pháp giống C,C++,Java,C#,Swift
không con trỏ
var number = 1.618;
var title = 'Golden ratio';
var isDone = false;
num number = 1.618;
String title = 'Golden ratio';
bool isDone = false;
Kiểu tường minh
Kiểu tự suy
dynamic obj = 12;
obj = "Cuong";
obj = new Point(10, 12);
obj = new Point3D(10, 12, 14);
print(obj);
class Point {
num x;
num y;
Point(this.x, this.y);
}
class Point3D extends Point {
num z;
Point3D(num x, num y, this.z) : super(x, y);
}
khai báo class
constructor
inheritance
var listInt = [1, 2, 3]; //Mảng số nguyên
var listObj = [false, 1, "Two", 3]; //Mảng đối tượng
var colors = {'red': 'FF0000', 'green': '00FF00', 'blue': '0000FF'};
//Map key là string
var dayOfWeek = { //Map key là integer
0: 'sunday',
1: 'monday',
2: 'tuesday',
};
var listObj = [false, 1, "Two", 3];
listObj.add("Four");
listObj.add(5);
for (int i = 0; i < listObj.length; i++) {
print(listObj[i]);
}
for (var j in listObj) { //Giống Swift nhỉ
print(j);
}
listObj.forEach((e) => print(e)); //Giống JS nhỉ
false
1
Two
3
Four
5
List<int> listInt = [1, 2, 3];
Map<String, String> colors = {
'red': 'FF0000',
'green': '00FF00',
'blue': '0000FF'
};
var setInt = new Set<int>.from([1, 2, 3, 1]);
Dart có sẵn List, Map, Set. Có thể mở rộng thêm Queue,
Link List,... nhờ package ngoài
abstract class Color {
String color;
Color(this.color);
paint();
}
class Point3DColor extends Point3D implements Color {
Point3DColor(num x, num y, num z):super(x, y, z);
String color;
@override
paint() {
print("paint $color");
return null;
}
}
interface
async – await dart giống JS và C#
printNews() async {
http.Response news = await getNewsFromServer();
}
Future<http.Response> getNewsFromServer() {
return http.get('https://cnn.com');
}
Đánh giá Dart
• Thiết kế tốt, OOP ngon, không vá víu
• Kiểu chặt chẽ + cởi mở
• 8 tiếng học là code thành thạo (JavaScript học trong 15
phút, mất nhiều tháng để thành thạo)
• Thư viện hỗ trợ chưa bằng JavaScript
• Xuất ra JavaScript dart2js
JavaScript Dart
Single Thread Run
Class Inheritance
Function as variable
Functional Programming
Throw – Try – Catch
Array, Map, Set
No Pointer !
Modules – Packages
Async – Await
Reactive
Generate binary
No REPL
Static typing
Interface, Mixin
AOT Compile
Generics
Operator overloading
Compile =>JavaScript
Metadata
Run in browers
REPL
Duck typing
Strong community
Strong adoption
Demo Flutter
Hiệu suất hiển thị 60 khung hình / giây
import 'package:flutter/material.dart';
void main() {
runApp(
new Center(
child: new Text(
'Hello, world!',
textDirection: TextDirection.ltr,
),
),
);
}
Minimal Flutter app
class MyHomePage extends StatelessWidget {
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text('Hello')
),
body: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Text(
'Hot Reload',
style: new TextStyle(fontSize: 60.0),
Flutter
flutter cli
flutter package, pub
VSCode, Android Studio
Tốt, line by line
Dart code
Faster
Faster
Dài và phức tạp cho web dev
React Native
react-native cli
npm, yarn
VS Code..
console.log, chrome inspect
CSS, dễ - thân quen hơn
Client
Package manager
IDE
Debug
Layout
Compile time
Hot Reload
Code
Layout theo cột
từ trên xuống dưới
Kết hợp layout theo cả hàng lẫn cột
IOS React Native Flutter
React Native
• Components
• Props. Eg:
Flutter
Layout comparison
• Widget: Stateless & Stateful
• Object’s properties.Eg:
React Native
Render các “component”
Flutter
Layout comparison
Build các “widget”
React Native
State (định nghĩa trong 1 class)
Flutter
Layout comparison – compare “state”
State(định nghĩa trong 2 class)
React Native
• set “state” .
Flutter
Layout comparison – compare “state”
• set “state” :
Where are “arrow functions” ?
React Native
Style kiểu CSS
Flutter
Layout comparison – compare “state”
Style kiểu “Java”
REST, WebSocket, gRPC, GraphQL
• Cả RN, Flutter đều hỗ trợ REST,WebSocket,
GraphQL tốt
• Flutter hỗ trợ gRPC.
gRPC + HTTP2 nhanh hơnJSON+HTTP khoảng 6-
10 lần
React Native Flutter
Truyền nhận qua
method channel
RCTBridgeModule
thông qua các
interface/protocol
Ko thể sử dụng hàm/View của
IOS cho android và ngược lại
Thêm thủ thuật mới
gọi được Swift & Kotlin
Dễ dàng hỗ trợ thêm
Kotlin và Swift
Hỗ trợ kiểu dữ liệu cơ
bản và Map<key,value>
Hỗ trợ gọi Objective-C & Java
Sử dụng được native UI
control của IOS và
Android như code rối
Không dùng được
native UI có thể chưa
biết cách !
Gọi native API

Weitere ähnliche Inhalte

Was ist angesagt?

Golang web database3
Golang web database3Golang web database3
Golang web database3NISCI
 
Cấp phát bộ nhớ động trong C
Cấp phát bộ nhớ động trong CCấp phát bộ nhớ động trong C
Cấp phát bộ nhớ động trong CIam Me
 
The Art of Readable Code - DongPV
The Art of Readable Code - DongPVThe Art of Readable Code - DongPV
The Art of Readable Code - DongPVĐông Đô
 
Python moi
Python moiPython moi
Python moiDÉp LÊ
 
Speaker dang minh tuan javascript for php developer
Speaker dang minh tuan   javascript for php developerSpeaker dang minh tuan   javascript for php developer
Speaker dang minh tuan javascript for php developerAiTi Education
 
DoThanhNghi2016_Python.pdf
DoThanhNghi2016_Python.pdfDoThanhNghi2016_Python.pdf
DoThanhNghi2016_Python.pdfTamDo58
 
Bài 3: Servlet&Cookie&Session - Lập Trình Mạng Nâng Cao
Bài 3: Servlet&Cookie&Session - Lập Trình Mạng Nâng CaoBài 3: Servlet&Cookie&Session - Lập Trình Mạng Nâng Cao
Bài 3: Servlet&Cookie&Session - Lập Trình Mạng Nâng CaoTuan Nguyen
 

Was ist angesagt? (13)

Lesson 1 practice
Lesson 1 practiceLesson 1 practice
Lesson 1 practice
 
Lesson 2 lý thuyết
Lesson 2 lý thuyếtLesson 2 lý thuyết
Lesson 2 lý thuyết
 
Golang web database3
Golang web database3Golang web database3
Golang web database3
 
Cấp phát bộ nhớ động trong C
Cấp phát bộ nhớ động trong CCấp phát bộ nhớ động trong C
Cấp phát bộ nhớ động trong C
 
Lesson01
Lesson01Lesson01
Lesson01
 
The Art of Readable Code - DongPV
The Art of Readable Code - DongPVThe Art of Readable Code - DongPV
The Art of Readable Code - DongPV
 
Python moi
Python moiPython moi
Python moi
 
Ung dung web chuong 8
Ung dung web  chuong 8Ung dung web  chuong 8
Ung dung web chuong 8
 
Học python
Học pythonHọc python
Học python
 
Speaker dang minh tuan javascript for php developer
Speaker dang minh tuan   javascript for php developerSpeaker dang minh tuan   javascript for php developer
Speaker dang minh tuan javascript for php developer
 
DoThanhNghi2016_Python.pdf
DoThanhNghi2016_Python.pdfDoThanhNghi2016_Python.pdf
DoThanhNghi2016_Python.pdf
 
Thuchanh unix moi
Thuchanh unix moiThuchanh unix moi
Thuchanh unix moi
 
Bài 3: Servlet&Cookie&Session - Lập Trình Mạng Nâng Cao
Bài 3: Servlet&Cookie&Session - Lập Trình Mạng Nâng CaoBài 3: Servlet&Cookie&Session - Lập Trình Mạng Nâng Cao
Bài 3: Servlet&Cookie&Session - Lập Trình Mạng Nâng Cao
 

Ähnlich wie Flutter vs React Native 2018

Javascript for php developer
Javascript for php developerJavascript for php developer
Javascript for php developerDang Tuan
 
Technical note playframework_documentation_working with play - java_vn
Technical note playframework_documentation_working with play - java_vnTechnical note playframework_documentation_working with play - java_vn
Technical note playframework_documentation_working with play - java_vnAsahina Infotech
 
Bai1 gioi thieu_servlet_va_jsp_8952
Bai1 gioi thieu_servlet_va_jsp_8952Bai1 gioi thieu_servlet_va_jsp_8952
Bai1 gioi thieu_servlet_va_jsp_8952Ham Chơi
 
Iphone programming
Iphone programmingIphone programming
Iphone programmingCoderseta Jp
 
Webanalytics with haddop and Hive
Webanalytics with haddop and HiveWebanalytics with haddop and Hive
Webanalytics with haddop and HiveLe Kien Truc
 
Flutter trong lập trình mobile - HUFLIT 2022
Flutter trong lập trình mobile - HUFLIT 2022Flutter trong lập trình mobile - HUFLIT 2022
Flutter trong lập trình mobile - HUFLIT 2022HongDuyLe1
 
Web course php co ban
Web course   php co banWeb course   php co ban
Web course php co ban慂 志慂
 
Web Services
Web ServicesWeb Services
Web Servicesask bills
 
Windows Presentation Foundation
Windows Presentation FoundationWindows Presentation Foundation
Windows Presentation Foundationquyloc
 
Bai tap thuc hanh javascript
Bai tap thuc hanh javascriptBai tap thuc hanh javascript
Bai tap thuc hanh javascriptnkquank7d
 
Javascript tong-hop a-z
Javascript tong-hop a-zJavascript tong-hop a-z
Javascript tong-hop a-zManhh Nguyễn
 
Introduction to python 20110917
Introduction to python   20110917Introduction to python   20110917
Introduction to python 20110917AiTi Education
 
Lab 11 apache hadoop map reduce
Lab 11 apache hadoop map reduceLab 11 apache hadoop map reduce
Lab 11 apache hadoop map reduceanhtrang181289
 
Bai4 basic jsp_4474
Bai4 basic jsp_4474Bai4 basic jsp_4474
Bai4 basic jsp_4474Ham Chơi
 

Ähnlich wie Flutter vs React Native 2018 (20)

Introduction Vs2008 Dot Net35
Introduction Vs2008 Dot Net35Introduction Vs2008 Dot Net35
Introduction Vs2008 Dot Net35
 
Javascript for php developer
Javascript for php developerJavascript for php developer
Javascript for php developer
 
LINQ presentation
LINQ presentationLINQ presentation
LINQ presentation
 
Technical note playframework_documentation_working with play - java_vn
Technical note playframework_documentation_working with play - java_vnTechnical note playframework_documentation_working with play - java_vn
Technical note playframework_documentation_working with play - java_vn
 
Bai1 gioi thieu_servlet_va_jsp_8952
Bai1 gioi thieu_servlet_va_jsp_8952Bai1 gioi thieu_servlet_va_jsp_8952
Bai1 gioi thieu_servlet_va_jsp_8952
 
Ung dung web chuong 5
Ung dung web  chuong 5Ung dung web  chuong 5
Ung dung web chuong 5
 
Iphone programming
Iphone programmingIphone programming
Iphone programming
 
Webanalytics with haddop and Hive
Webanalytics with haddop and HiveWebanalytics with haddop and Hive
Webanalytics with haddop and Hive
 
Flutter trong lập trình mobile - HUFLIT 2022
Flutter trong lập trình mobile - HUFLIT 2022Flutter trong lập trình mobile - HUFLIT 2022
Flutter trong lập trình mobile - HUFLIT 2022
 
Web course php co ban
Web course   php co banWeb course   php co ban
Web course php co ban
 
Lab04 mapview
Lab04 mapviewLab04 mapview
Lab04 mapview
 
Web Services
Web ServicesWeb Services
Web Services
 
Windows Presentation Foundation
Windows Presentation FoundationWindows Presentation Foundation
Windows Presentation Foundation
 
Bai tap thuc hanh javascript
Bai tap thuc hanh javascriptBai tap thuc hanh javascript
Bai tap thuc hanh javascript
 
LINQ
LINQLINQ
LINQ
 
Javascript tong-hop a-z
Javascript tong-hop a-zJavascript tong-hop a-z
Javascript tong-hop a-z
 
Introduction to python 20110917
Introduction to python   20110917Introduction to python   20110917
Introduction to python 20110917
 
Lab 11 apache hadoop map reduce
Lab 11 apache hadoop map reduceLab 11 apache hadoop map reduce
Lab 11 apache hadoop map reduce
 
Bai4 basic jsp_4474
Bai4 basic jsp_4474Bai4 basic jsp_4474
Bai4 basic jsp_4474
 
Bai08 10 java_fx
Bai08 10 java_fxBai08 10 java_fx
Bai08 10 java_fx
 

Mehr von TechMaster Vietnam

Authentication and Authorization
Authentication and AuthorizationAuthentication and Authorization
Authentication and AuthorizationTechMaster Vietnam
 
Chia sẻ kinh nghiệm giảng dạy CNTT
Chia sẻ kinh nghiệm giảng dạy CNTTChia sẻ kinh nghiệm giảng dạy CNTT
Chia sẻ kinh nghiệm giảng dạy CNTTTechMaster Vietnam
 
Cơ sở dữ liệu postgres
Cơ sở dữ liệu postgresCơ sở dữ liệu postgres
Cơ sở dữ liệu postgresTechMaster Vietnam
 
Tìm nền tảng lập trình cho 5 năm tới
Tìm nền tảng lập trình cho 5 năm tớiTìm nền tảng lập trình cho 5 năm tới
Tìm nền tảng lập trình cho 5 năm tớiTechMaster Vietnam
 
Manage your project differently
Manage your project differentlyManage your project differently
Manage your project differentlyTechMaster Vietnam
 
Hướng dẫn sử dụng CocoaPods trong dự án iOS hoặc MacOSX
Hướng dẫn sử dụng CocoaPods trong dự án iOS hoặc MacOSXHướng dẫn sử dụng CocoaPods trong dự án iOS hoặc MacOSX
Hướng dẫn sử dụng CocoaPods trong dự án iOS hoặc MacOSXTechMaster Vietnam
 
Day0: Giới thiệu lập trình ứng dụng Apple iOS
Day0: Giới thiệu lập trình ứng dụng Apple iOSDay0: Giới thiệu lập trình ứng dụng Apple iOS
Day0: Giới thiệu lập trình ứng dụng Apple iOSTechMaster Vietnam
 
Bài trình bày cho sinh viên Bách Khoa 9/2012
Bài trình bày cho sinh viên Bách Khoa 9/2012Bài trình bày cho sinh viên Bách Khoa 9/2012
Bài trình bày cho sinh viên Bách Khoa 9/2012TechMaster Vietnam
 

Mehr von TechMaster Vietnam (20)

Neural Network from Scratch
Neural Network from ScratchNeural Network from Scratch
Neural Network from Scratch
 
C đến C++ phần 1
C đến C++ phần 1C đến C++ phần 1
C đến C++ phần 1
 
Control structure in C
Control structure in CControl structure in C
Control structure in C
 
Basic C programming
Basic C programmingBasic C programming
Basic C programming
 
Authentication and Authorization
Authentication and AuthorizationAuthentication and Authorization
Authentication and Authorization
 
Postgresql security
Postgresql securityPostgresql security
Postgresql security
 
Knex Postgresql Migration
Knex Postgresql MigrationKnex Postgresql Migration
Knex Postgresql Migration
 
Arrowjs.io
Arrowjs.ioArrowjs.io
Arrowjs.io
 
Minimum Viable Products
Minimum Viable ProductsMinimum Viable Products
Minimum Viable Products
 
Chia sẻ kinh nghiệm giảng dạy CNTT
Chia sẻ kinh nghiệm giảng dạy CNTTChia sẻ kinh nghiệm giảng dạy CNTT
Chia sẻ kinh nghiệm giảng dạy CNTT
 
Cơ sở dữ liệu postgres
Cơ sở dữ liệu postgresCơ sở dữ liệu postgres
Cơ sở dữ liệu postgres
 
Tìm nền tảng lập trình cho 5 năm tới
Tìm nền tảng lập trình cho 5 năm tớiTìm nền tảng lập trình cho 5 năm tới
Tìm nền tảng lập trình cho 5 năm tới
 
iOS Master - Detail & TabBar
iOS Master - Detail & TabBariOS Master - Detail & TabBar
iOS Master - Detail & TabBar
 
Phalcon căn bản
Phalcon căn bảnPhalcon căn bản
Phalcon căn bản
 
Phalcon introduction
Phalcon introductionPhalcon introduction
Phalcon introduction
 
Slide that wins
Slide that winsSlide that wins
Slide that wins
 
Manage your project differently
Manage your project differentlyManage your project differently
Manage your project differently
 
Hướng dẫn sử dụng CocoaPods trong dự án iOS hoặc MacOSX
Hướng dẫn sử dụng CocoaPods trong dự án iOS hoặc MacOSXHướng dẫn sử dụng CocoaPods trong dự án iOS hoặc MacOSX
Hướng dẫn sử dụng CocoaPods trong dự án iOS hoặc MacOSX
 
Day0: Giới thiệu lập trình ứng dụng Apple iOS
Day0: Giới thiệu lập trình ứng dụng Apple iOSDay0: Giới thiệu lập trình ứng dụng Apple iOS
Day0: Giới thiệu lập trình ứng dụng Apple iOS
 
Bài trình bày cho sinh viên Bách Khoa 9/2012
Bài trình bày cho sinh viên Bách Khoa 9/2012Bài trình bày cho sinh viên Bách Khoa 9/2012
Bài trình bày cho sinh viên Bách Khoa 9/2012
 

Flutter vs React Native 2018

  • 1. Flutter vs React Native Nguyễn Đức Hoàng – Trịnh Minh Cường
  • 2. React Native Flutter Cross Platform Hot Reload Suitable to build business apps Call native API iOS, Android REST, WebSocket, GraphQL GoogleFacebook JavaScript – JavaScript Core Born 2015 Good for Web developer Component -> DOM Build a bit slower Render slower Very strong community Many cool components Dart – Dart VM Born 2017 Good for iOS, Android Widget: stateless / stateful Build faster, binary bigger Render graphics better Smaller community Support gRPC Easy config, better tool
  • 3. CHỌN FRAMEWORK MOBILE NÀO? IOS/Android React Native Flutter ResponsiveWeb Tối ưu tốc độ, trải nghiệm Code nhanh Thân thiện web dev Cộng đồng lớn, ổn định Tiết kiệm chi phí code Chạy offline, native API REST,Socket,QraphQL,gRPC UI đồng nhất IOS-Android
  • 4. Google Search Google Docs Google Maps Android TensorFlow Materialize Design Golang Kubernetes Google Apps Google Cloud Dart Google Home Google Play FireBase gRPC Google Car Waymo Google GlassesGoogle Home YouTube
  • 5. main() { var number = 1.618; var title = 'Golden ratio'; print("$title is $number"); for (int i = 0; i < 5; i++) { print(i); } } Golden ratio is 1.618 0 1 2 3 4 Dart dễ học, cú pháp giống C,C++,Java,C#,Swift không con trỏ
  • 6. var number = 1.618; var title = 'Golden ratio'; var isDone = false; num number = 1.618; String title = 'Golden ratio'; bool isDone = false; Kiểu tường minh Kiểu tự suy
  • 7. dynamic obj = 12; obj = "Cuong"; obj = new Point(10, 12); obj = new Point3D(10, 12, 14); print(obj);
  • 8. class Point { num x; num y; Point(this.x, this.y); } class Point3D extends Point { num z; Point3D(num x, num y, this.z) : super(x, y); } khai báo class constructor inheritance
  • 9. var listInt = [1, 2, 3]; //Mảng số nguyên var listObj = [false, 1, "Two", 3]; //Mảng đối tượng var colors = {'red': 'FF0000', 'green': '00FF00', 'blue': '0000FF'}; //Map key là string var dayOfWeek = { //Map key là integer 0: 'sunday', 1: 'monday', 2: 'tuesday', };
  • 10. var listObj = [false, 1, "Two", 3]; listObj.add("Four"); listObj.add(5); for (int i = 0; i < listObj.length; i++) { print(listObj[i]); } for (var j in listObj) { //Giống Swift nhỉ print(j); } listObj.forEach((e) => print(e)); //Giống JS nhỉ false 1 Two 3 Four 5
  • 11. List<int> listInt = [1, 2, 3]; Map<String, String> colors = { 'red': 'FF0000', 'green': '00FF00', 'blue': '0000FF' }; var setInt = new Set<int>.from([1, 2, 3, 1]); Dart có sẵn List, Map, Set. Có thể mở rộng thêm Queue, Link List,... nhờ package ngoài
  • 12. abstract class Color { String color; Color(this.color); paint(); } class Point3DColor extends Point3D implements Color { Point3DColor(num x, num y, num z):super(x, y, z); String color; @override paint() { print("paint $color"); return null; } } interface
  • 13. async – await dart giống JS và C# printNews() async { http.Response news = await getNewsFromServer(); } Future<http.Response> getNewsFromServer() { return http.get('https://cnn.com'); }
  • 14. Đánh giá Dart • Thiết kế tốt, OOP ngon, không vá víu • Kiểu chặt chẽ + cởi mở • 8 tiếng học là code thành thạo (JavaScript học trong 15 phút, mất nhiều tháng để thành thạo) • Thư viện hỗ trợ chưa bằng JavaScript • Xuất ra JavaScript dart2js
  • 15. JavaScript Dart Single Thread Run Class Inheritance Function as variable Functional Programming Throw – Try – Catch Array, Map, Set No Pointer ! Modules – Packages Async – Await Reactive Generate binary No REPL Static typing Interface, Mixin AOT Compile Generics Operator overloading Compile =>JavaScript Metadata Run in browers REPL Duck typing Strong community Strong adoption
  • 17. Hiệu suất hiển thị 60 khung hình / giây
  • 18. import 'package:flutter/material.dart'; void main() { runApp( new Center( child: new Text( 'Hello, world!', textDirection: TextDirection.ltr, ), ), ); } Minimal Flutter app
  • 19.
  • 20. class MyHomePage extends StatelessWidget { Widget build(BuildContext context) { return new Scaffold( appBar: new AppBar( title: new Text('Hello') ), body: new Center( child: new Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ new Text( 'Hot Reload', style: new TextStyle(fontSize: 60.0),
  • 21.
  • 22. Flutter flutter cli flutter package, pub VSCode, Android Studio Tốt, line by line Dart code Faster Faster Dài và phức tạp cho web dev React Native react-native cli npm, yarn VS Code.. console.log, chrome inspect CSS, dễ - thân quen hơn Client Package manager IDE Debug Layout Compile time Hot Reload Code
  • 23. Layout theo cột từ trên xuống dưới
  • 24. Kết hợp layout theo cả hàng lẫn cột
  • 25. IOS React Native Flutter
  • 26. React Native • Components • Props. Eg: Flutter Layout comparison • Widget: Stateless & Stateful • Object’s properties.Eg:
  • 27. React Native Render các “component” Flutter Layout comparison Build các “widget”
  • 28.
  • 29. React Native State (định nghĩa trong 1 class) Flutter Layout comparison – compare “state” State(định nghĩa trong 2 class)
  • 30. React Native • set “state” . Flutter Layout comparison – compare “state” • set “state” : Where are “arrow functions” ?
  • 31. React Native Style kiểu CSS Flutter Layout comparison – compare “state” Style kiểu “Java”
  • 32. REST, WebSocket, gRPC, GraphQL • Cả RN, Flutter đều hỗ trợ REST,WebSocket, GraphQL tốt • Flutter hỗ trợ gRPC. gRPC + HTTP2 nhanh hơnJSON+HTTP khoảng 6- 10 lần
  • 33. React Native Flutter Truyền nhận qua method channel RCTBridgeModule thông qua các interface/protocol Ko thể sử dụng hàm/View của IOS cho android và ngược lại Thêm thủ thuật mới gọi được Swift & Kotlin Dễ dàng hỗ trợ thêm Kotlin và Swift Hỗ trợ kiểu dữ liệu cơ bản và Map<key,value> Hỗ trợ gọi Objective-C & Java Sử dụng được native UI control của IOS và Android như code rối Không dùng được native UI có thể chưa biết cách ! Gọi native API

Hinweis der Redaktion

  1. Demo Flutter Gallery Launch cả 2 emulator bằng lệnh flutter run –d all