Skip to content

pedro-afk/platform_channel_sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter Platform Channels Example

This project is a practical example of how to use Platform Channels in Flutter to communicate between Dart code and native platform code (Android/iOS).

What are Platform Channels?

Platform Channels allow Flutter to communicate with native platform code (Kotlin/Java on Android and Swift/Objective-C on iOS). This is useful when you need to access device-specific features not directly available in Flutter.

Types of Platform Channels used in this project

  • 🔹 MethodChannel: calls native methods and waits for a response. Example: Getting the battery level (based on Flutter’s official documentation).

  • 🔸 EventChannel: receives continuous streams of data from native code. Example: Sensor monitoring (custom example created for this project).

  • BasicMessageChannel: exchanges messages more freely, without the traditional request-response structure (not implemented in this example but important to know).

References

About

This app show two examples about use Platform Channels on Flutter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published