Steps to Install POD in macOS
1. Navigate to the iOS Directory
Navigate to the `ios` directory of your Flutter project in the terminal by using the below command
cd your_flutter_project/ios
2. Check for Podfile
Check if you already have a `Podfile` in the `ios` directory. If you don’t have it, just run the following command in the terminal. This command will initialize a Podfile for your project.
pod init
3. Edit Podfile
Open the generated `Podfile` in a text editor of your choice and add your dependencies inside the target block.
# This is an example
platform :ios, '9.0'
target 'Runner' do
use_frameworks!
# replace 'PodDependency' with the name of the CocoaPod you want to install
pod 'PotDependency'
end
4. Install Pods
Save the `Podfile` and run the following command. This command will install the specified CocoaPods and sets up the necessary Xcode workspace.
pod install
5. Open Xcode Workspace
Open the `.xcworkspace` file in the `ios` dir.
open Runner.xcworkspace
Note: From now on, always open the `.xcworkspace` instead of `.xcproj` when working on any Flutter project.
Flutter – Install POD in Windows and macOS
Flutter is an open-source UI software development kit created by Google. It is used to develop cross-platform applications from a single codebase for any web browser,[4] Fuchsia, Android, iOS, Linux, macOS, and Windows. Flutter apps are written in the Dart language and make use of many of the language’s more advanced features. If you want to learn more about it you can visit this page.
In Flutter it’s not common to install CocoaPods. Flutter has its package manager. You interact with it using the `pub` command. However, in cases where you’re dealing with native iOS code or plugins that rely on CocoaPods you may need to interact with it.