SlideShare a Scribd company logo
Communication between Flutter
and
native modules Baby Step
Speaker. 장인수
Introduce
현) Woowahan Bros. / Baemin Market Mobile platform Development
HydaiCapital / Mobile Platform Development
SOCAR Mobile Developer / Mobile , Tablet
DreamPlus with Hanwha S&C / ZUMO Application
Lassoh inc. (Toronto in Canada) / Mobile SNS platform
Samsung Mobile Group / 갤럭시 시리즈 개발.
Agenda
- About Flutter
- Flutter Platform Channel
- Demo
- Q & A (?)
About Flutter
Flutter is Google's mobile UI framework
About Flutter
Flutter is a cross-platform mobile SDK
Fast development
Expressive and Flexible UI
Native Performance
Free and open source
Flutter History
Announcing Flutter 1.0
Current Version
v1.4.1
The First Release
Announcing Flutter Release Preview 2
2017 MAY 2018 SEP 2018 DEC 2019 NOW
x 1.5
2,169
Watch
59,136
Stars
6,463
Forks
370
Contributors
Communication between Flutter  and native modules Baby Step
Communication between Flutter  and native modules Baby Step
StackOverflow trend
Communication between Flutter  and native modules Baby Step
Communication between Flutter  and native modules Baby Step
Communication between Flutter  and native modules Baby Step
Communication between Flutter  and native modules Baby Step
Communication between Flutter  and native modules Baby Step
Flutter Structure
Native Code
Widgets,
Rendering
Platform
Channels
Canvas
Events
Location Bluetooth
Audio Sensors
Camera Etc.
Service
Platform
Application
Platform Channels Overview
Platform Channels
About Platform Channels
Platform channels are the gateway to accessing
platform-specific code in Flutter.
About Platform Channels
What do I mean by platform-specific?
About Platform Channels
Access to device inputs
Secure storage (a.k.a. keychain on iOS)
About Platform Channels
The Basic building block for
creating plugins
Communication between Flutter  and native modules Baby Step
About Platform Channels
MethodChannel class is defined
inside the ‘service’ package.
import 'package:flutter/services.dart';
About Platform Channels
Need to import the ‘async’ package to support async
features in our dart codebase.
import 'dart:async';
Need to import the ‘async’ package to support async features in our dart codebase.
static const channel =
const MethodChannel('droidknights.github.io/flutter_BabyStep');
To define MethodChannel in dart we use :
Like this…
You can name it  anything, but the best practice is to name
it domain_name/channel_name. 
final response = await channel.invokeMethod(message, [optional_arguments])
You can name it  anything, but the best practice is to name
it domain_name/channel_name. 
Future<Null> _showDialog() async {
final response =
await channel.invokeMethod("showDialog", [“. . .”//전달메세지]);
final snackbar = new SnackBar(content: new Text(response));
Scaffold.of(context).showSnackBar(snackbar);
}
Future<Null> _openNewPage() async {
final response =
await channel.invokeMethod("openPage", [“. . .” //전달메세지]);
print(response);
}
Future<Null> _requestNetwork() async {
final response = await channel.invokeMethod(
"request", [“. . . .(URL)”]);
Navigator.push(
context,
new MaterialPageRoute(
builder: (context) => new SecondRoute(data: response),
),
);
}
class MainActivity : FlutterActivity() {
...
}
val channel = MethodChannel(flutterView, "droidknight.github.io/
platformchannel”)
channel.setMethodCallHandler { methodCall, result ->
val args = methodCall.arguments as List<*>
val param = args.first() as String
when (methodCall.method) {
"openPage" -> openSecondActivity(param)
"showDialog" -> showDialog(param, result)
"request" -> callService(param, result)
else -> return@setMethodCallHandler
}
}
private fun openSecondActivity(info: String) {
startActivity<SecondActivity>("info" to info)
}
private fun showDialog(content: String, channelResult: MethodChannel.Result)
{
MaterialDialog.Builder(this).title(“Android Dialog").theme(Theme.LIGHT)
.content(content)
.positiveText("Ok")
.negativeText("Cancel")
.onPositive { _, _ -> channelResult.success("Ok was clicked") }
.onNegative { _, _ -> channelResult.success("Cancel was
clicked") }
.show()
}
private fun callService(url: String, channelResult: MethodChannel.Result) {
...
service.teams().enqueue(object : Callback<ResponseData> {
override fun onFailure(call: Call<ResponseData>?, t: Throwable?) {
… // Fail 처리
}
override fun onResponse(call: Call<ResponseData>?, response:
Response<ResponseData>?) {
// 성공처리
channelResult.success(Gson().toJson(response?.body()?.teams))
}
})
}
DEMO
Communication between Flutter  and native modules Baby Step
Q & A
감사합니다.

More Related Content

DOCX
Apostila execução trabalhista
PDF
Simulación en Salud Pública (tipos y funciones de la comunicación)
PDF
2 7) 1001 questões de concurso - direito constitucional - fcc - 2012
PPT
Lesão corporal
PDF
Flutter 에서 Native(iOS, Android) 코드와 통신하기
PPTX
Flutter technology Based on Web Development
PDF
Why is Flutter the prime choice for entrepreneurs in app development?
PPTX
Flutter Beta but Better and Better
Apostila execução trabalhista
Simulación en Salud Pública (tipos y funciones de la comunicación)
2 7) 1001 questões de concurso - direito constitucional - fcc - 2012
Lesão corporal
Flutter 에서 Native(iOS, Android) 코드와 통신하기
Flutter technology Based on Web Development
Why is Flutter the prime choice for entrepreneurs in app development?
Flutter Beta but Better and Better

Similar to Communication between Flutter and native modules Baby Step (20)

PDF
Flutter101
PPTX
Flutter Intro
PDF
Flutter Forward EXTENDED - Flutter로 앱 개발 입문하기
PDF
Native mobile application development with Flutter (Dart)
PDF
A Complete Guide to Building Your First App with Flutter
PDF
Flutter Web Development Service - Connect Infosoft.pdf
PPTX
Flutter_Visual_Introduc_Presentation.pptx
PDF
Tech winter break - GDG on campus PPT1.pptx.pdf
PPTX
Choose flutter
PDF
Flutter Tutorial For Beginners | Edureka
PDF
Technologies Used by Adequate Infsoft for Mobile App Development.pdf
PPTX
Take your Flutter app from boring to beautiful.pptx
PDF
What makes Flutter the Ideal Choice for Global Startups.pdf
DOCX
What makes Flutter the Ideal Choice for Global Startups.docx
PDF
Technologies Used in Flutter App Development.pdf
PPTX
Looking For Flutter Dev Team
PPTX
Lecture -Introduction to Flutter and Dart.pptx
PDF
Google flutter app development
PPTX
Lecture 1-INTRODUCTION TO FLUTTER.pptx
PPTX
Exploring-the-World-of-Flutter-Development.pptx
Flutter101
Flutter Intro
Flutter Forward EXTENDED - Flutter로 앱 개발 입문하기
Native mobile application development with Flutter (Dart)
A Complete Guide to Building Your First App with Flutter
Flutter Web Development Service - Connect Infosoft.pdf
Flutter_Visual_Introduc_Presentation.pptx
Tech winter break - GDG on campus PPT1.pptx.pdf
Choose flutter
Flutter Tutorial For Beginners | Edureka
Technologies Used by Adequate Infsoft for Mobile App Development.pdf
Take your Flutter app from boring to beautiful.pptx
What makes Flutter the Ideal Choice for Global Startups.pdf
What makes Flutter the Ideal Choice for Global Startups.docx
Technologies Used in Flutter App Development.pdf
Looking For Flutter Dev Team
Lecture -Introduction to Flutter and Dart.pptx
Google flutter app development
Lecture 1-INTRODUCTION TO FLUTTER.pptx
Exploring-the-World-of-Flutter-Development.pptx
Ad

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Getting Started with Data Integration: FME Form 101
PPTX
1. Introduction to Computer Programming.pptx
PDF
Hybrid model detection and classification of lung cancer
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
Tartificialntelligence_presentation.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
Chapter 5: Probability Theory and Statistics
Building Integrated photovoltaic BIPV_UPV.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
A comparative analysis of optical character recognition models for extracting...
Getting Started with Data Integration: FME Form 101
1. Introduction to Computer Programming.pptx
Hybrid model detection and classification of lung cancer
Zenith AI: Advanced Artificial Intelligence
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
A Presentation on Artificial Intelligence
Digital-Transformation-Roadmap-for-Companies.pptx
SOPHOS-XG Firewall Administrator PPT.pptx
Univ-Connecticut-ChatGPT-Presentaion.pdf
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Enhancing emotion recognition model for a student engagement use case through...
Tartificialntelligence_presentation.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
OMC Textile Division Presentation 2021.pptx
Chapter 5: Probability Theory and Statistics
Ad

Communication between Flutter and native modules Baby Step