Made by
Dec 01, 2019 A step-by-step guide on setting up Flutter for people learning to code on Mac. I found the official documentation to set up Flutter a bit lacking in information. Since I had to Google quite a bit of what some of the instructions meant, I thought I’d write a comprehensive guide for Mac users with little to no programming experience & for anybody else stuck in the process. MacOS supports developing Flutter apps for both iOS and Android. Complete at least one of the two platform setup steps now, to be able to build and run your first Flutter app. IOS setup Install Xcode. To develop Flutter apps for iOS, you need a Mac with Xcode 9.0 or newer: Install Xcode 9.0 or newer (via web download or the Mac App Store).
Flutter is Google's UI toolkit for building beautiful, natively compiled applications for mobile, web, desktop, and embedded devices from a single codebase.
Coming from another platform? Docs: iOS, Android, Web, React Native, Xamarin.
Fast Development
Paint your app to life in milliseconds with Stateful Hot Reload. Use a rich set of fully-customizable widgets to build native interfaces in minutes.
Expressive and Flexible UI
Quickly ship features with a focus on native end-user experiences. Layered architecture allows for full customization, which results in incredibly fast rendering and expressive and flexible designs.
Native Performance
Flutter’s widgets incorporate all critical platform differences such as scrolling, navigation, icons and fonts, and your Flutter code is compiled to native ARM machine code using Dart's native compilers.
Try Flutter in your browser
Want more practice? Try a codelab or workshop.
Fast development
Flutter's hot reload helps you quickly and easily experiment, build UIs, add features, and fix bugs faster. Experience sub-second reload times without losing state on emulators, simulators, and hardware.
Learn moreReflectly
An award winning mindfulness app built with Flutter.
Download: iOS, AndroidLearn more
Expressive, beautiful UIs
Delight your users with Flutter's built-in beautiful Material Design and Cupertino (iOS-flavor) widgets, rich motion APIs, smooth natural scrolling, and platform awareness.
Browse the widget catalogNative Performance
Flutter’s widgets incorporate all critical platform differences such as scrolling, navigation, icons and fonts to provide full native performance on both iOS and Android.
Demo design inspired by Aurélien Salomon's Google Newsstand Navigation Pattern
Learn from developers
Watch these videos to learn from Google and developers as you build with Flutter.
Visit our YouTube playlistWho's using Flutter?
Organizations around the world are building apps with Flutter.
See what’s being createdNews
Flutter Download For Mac Free
Performance improvements to Flutter Hot Reload
Read moreThe Flutter barcode SDK series is coming to the end. This week, we switch the coding environment to macOS to finish the rest of the plugin platforms - iOS and macOS - using Swift.
The Series of Flutter Barcode SDK
Download Flutter For Mac
Download
- Dynamsoft Barcode Reader
Flutter Barcode and QR Code Plugin for iOS
As always, we add the iOS template to the existing plugin project first:
The command generates a flutter_barcode_sdk.podspec
file for build configuration and a Classes
folder containing code implementation.
You can either set vendored_frameworks
or dependency
for linking in flutter_barcode_sdk.podspec
. The difference is vendored_frameworks
are the paths of the framework bundles shipped with the plugin, whereas setting dependency
triggers pod install
if the framework is not locally cached. If you have trouble in building the project with dependency
, vendored_frameworks
could be the alternative. The only problem of using vendored_frameworks
is you cannot publish the package to pub.dev if the package size is over 100 MB.
Next, we open Classes/SwiftFlutterBarcodeSdkPlugin.swift
file to start coding.
Here is the code snippet for importing and initializing Dynamsoft Barcode Reader:
Flutter Download For Mac Os
The organization ID 200001
authorizes developers to use the SDK for 7 days.
The public func handle()
function is used to handle Flutter method call:
We can implement the corresponding methods as follows:
Before testing the plugin, we have to open example/ios/Runner.xcworkspace
in Xcode to configure the signing certificate. After that, we can run flutter run
in terminal to launch the barcode scanner demo app. No extra Flutter code needed, because the Dart code for UI is shared between Android and iOS:
Flutter Barcode and QR Code Plugin for macOS
Once the Flutter barcode plugin is done for iOS, developing the plugin for macOS is much easier. Probably you have noticed that there is no framework for macOS but only dylib. To utilize the barcode SDK for macOS, we need to create a bridging header.
Here are the steps:
Add the Flutter macOS template to the current plugin project:
Create a bridging header
macos/Runner/Runner-Bridging-Header.h
:Set the path of the bridging header in Xcode:
Copy the Swift code from
ios/Classes/SwiftFlutterBarcodeSdkPlugin.swift
tomacos/Classes/FlutterBarcodeSdkPlugin.swift
.
Although the macOS application can now run successfully, it will fail to access files due to the sandbox restriction. To enable loadings file via file path string, we disable the entitlementcom.apple.security.app-sandbox
in example/macos/Runner/DebugProfile.entitlements
:
Finally, the Flutter macOS barcode reader can work perfectly. Let’s test it with a distorted QR Code image:
Ending
So far, the Flutter barcode SDK has covered Windows, Linux, macOS, iOS, Android, and web. It will also support Fuchsia OS in the near future.