-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
75 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
//// | ||
//// NavigationModel.swift | ||
//// Runner | ||
//// | ||
//// Created by jigar fumakiya on 12/09/23. | ||
//// | ||
// | ||
// NavigationModel.swift | ||
// Runner | ||
// | ||
// Created by jigar fumakiya on 12/09/23. | ||
// | ||
|
||
import Flutter | ||
import Foundation | ||
|
||
class NavigationModel { | ||
let navigationMethodChannel = "lantern_method_channel" | ||
|
||
var flutterbinaryMessenger: FlutterBinaryMessenger | ||
|
||
init(flutterBinary: FlutterBinaryMessenger) { | ||
self.flutterbinaryMessenger = flutterBinary | ||
prepareNavigationChannel() | ||
} | ||
|
||
private func prepareNavigationChannel() { | ||
|
||
// Navigation Channel | ||
let navigationChannel = FlutterMethodChannel( | ||
name: navigationMethodChannel, binaryMessenger: flutterbinaryMessenger) | ||
navigationChannel.setMethodCallHandler(handleNavigationethodCall) | ||
} | ||
|
||
func handleNavigationethodCall(_ call: FlutterMethodCall, result: @escaping FlutterResult) { | ||
// Handle your method calls here | ||
// The 'call' contains the method name and arguments | ||
// The 'result' can be used to send back the data to Flutter | ||
switch call.method { | ||
case "yourMethod": | ||
// handle yourMethod | ||
break | ||
default: | ||
result(FlutterMethodNotImplemented) | ||
} | ||
} | ||
|
||
} | ||
//import Flutter | ||
//import Foundation | ||
// | ||
//class NavigationModel { | ||
// let navigationMethodChannel = "lantern_method_channel" | ||
// | ||
// var flutterbinaryMessenger: FlutterBinaryMessenger | ||
// | ||
// init(flutterBinary: FlutterBinaryMessenger) { | ||
// self.flutterbinaryMessenger = flutterBinary | ||
// prepareNavigationChannel() | ||
// } | ||
// | ||
// private func prepareNavigationChannel() { | ||
// | ||
// // Navigation Channel | ||
// let navigationChannel = FlutterMethodChannel( | ||
// name: navigationMethodChannel, binaryMessenger: flutterbinaryMessenger) | ||
// navigationChannel.setMethodCallHandler(handleNavigationethodCall) | ||
// } | ||
// | ||
// func handleNavigationethodCall(_ call: FlutterMethodCall, result: @escaping FlutterResult) { | ||
// // Handle your method calls here | ||
// // The 'call' contains the method name and arguments | ||
// // The 'result' can be used to send back the data to Flutter | ||
// switch call.method { | ||
// case "yourMethod": | ||
// // handle yourMethod | ||
// break | ||
// default: | ||
// result(FlutterMethodNotImplemented) | ||
// } | ||
// } | ||
// | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters