-
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.
Organise code and removed not used class
- Loading branch information
Showing
5 changed files
with
136 additions
and
138 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// NavigationModel.swift | ||
// Runner | ||
// | ||
// Created by jigar fumakiya on 12/09/23. | ||
// | ||
|
||
import Foundation | ||
import Flutter | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// LoadingIndicatorManager.swift | ||
// Runner | ||
// | ||
// Created by jigar fumakiya on 12/09/23. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
class LoadingIndicatorManager { | ||
private var loadingIndicator: UIActivityIndicatorView? | ||
private weak var parentView: UIView? | ||
|
||
init(parentView: UIView) { | ||
self.parentView = parentView | ||
setupLoadingIndicator() | ||
} | ||
|
||
private func setupLoadingIndicator() { | ||
loadingIndicator = UIActivityIndicatorView(style: .gray) | ||
guard let loadingIndicator = loadingIndicator, let parentView = parentView else { | ||
return | ||
} | ||
loadingIndicator.center = parentView.center | ||
loadingIndicator.hidesWhenStopped = true | ||
parentView.addSubview(loadingIndicator) | ||
} | ||
|
||
func show() { | ||
loadingIndicator?.startAnimating() | ||
} | ||
|
||
func hide() { | ||
loadingIndicator?.stopAnimating() | ||
loadingIndicator?.removeFromSuperview() | ||
loadingIndicator = nil | ||
} | ||
} |