uikit_bindings 0.0.1-dev.2 copy "uikit_bindings: ^0.0.1-dev.2" to clipboard
uikit_bindings: ^0.0.1-dev.2 copied to clipboard

Bindings of UIKit components for Flutter using FFI.

uikit_bindings #

This plugin allows you to use native UIKit components in your Flutter app using FFI.

Bindings are generated from UIKit Headers using ffigen.

This is experimental plugin and currently only limited number of components are supported.

Available UIKit Components #

The following table shows the UIKit components that are available through the bindings:

Component Status Description Example Usage
Views & Controls
UIView ✅ Available Base class for all views Used in example for custom backgrounds
UILabel ✅ Available Displays text Used in example for text display
UIButton ⚠️ Binding only Button control Not used in example
UITextField ⚠️ Binding only Text input field Not used in example
UISwitch ⚠️ No constructor Toggle switch control Known issue with constructor
UIScrollView ⚠️ No constructor Scrollable content view Known issue with constructor
UIRefreshControl ⚠️ Binding only Pull-to-refresh control Not tested
View Controllers
UIViewController ✅ Available Base view controller Used in example for custom screens
UINavigationController ⚠️ Binding only Navigation stack controller Not used in example
UIAlertController ✅ Available Alert and action sheet controller Used in example for alerts
Application & Window
UIApplication ✅ Available Main application object Used in example for window access
UIWindow ⚠️ Binding only Application window Accessed via UIApplication
UIScene ⚠️ Binding only Scene management Not used in example
UIWindowScene ⚠️ Binding only Window scene management Not used in example
Navigation & Bars
UINavigationBar ⚠️ Binding only Navigation bar Not used in example
UINavigationItem ⚠️ Binding only Navigation item configuration Not used in example
UIBarButtonItem ⚠️ Binding only Navigation bar button Not used in example
UIToolbar ⚠️ Binding only Toolbar Not used in example
Gestures & Input
UIGestureRecognizer ⚠️ Binding only Base gesture recognizer Not used in example
UITapGestureRecognizer ⚠️ Binding only Tap gesture recognition Not used in example
UIPanGestureRecognizer ⚠️ Binding only Pan gesture recognition Not used in example
UIPinchGestureRecognizer ⚠️ Binding only Pinch gesture recognition Not used in example
UITouch ⚠️ Binding only Touch event handling Not used in example
Presentation & Menus
UIPresentationController ⚠️ Binding only Custom presentation controller Not used in example
UISheetPresentationController ⚠️ Binding only Sheet presentation Not used in example
UIPopoverPresentationController ⚠️ Binding only Popover presentation Not used in example
UIMenu ⚠️ Binding only Menu system Not used in example
UIMenuElement ⚠️ Binding only Menu element base class Not used in example
UIAction ⚠️ Binding only Menu actions Not used in example
UICommand ⚠️ Binding only Menu commands Not used in example
UIKeyCommand ⚠️ Binding only Keyboard shortcuts Not used in example
Graphics & Styling
UIColor ✅ Available Color management Used via extension in example
UIFont ⚠️ Binding only Font management Not used in example
UIFontDescriptor ⚠️ Binding only Font descriptors Not used in example
UIImage ⚠️ Binding only Image handling Not used in example
UIBezierPath ⚠️ Binding only Vector path drawing Not used in example
Layout & Constraints
UILayoutGuide ⚠️ Binding only Layout guide system Not used in example
UIKeyboardLayoutGuide ⚠️ Binding only Keyboard layout guide Not used in example
Focus & Accessibility
UIFocusUpdateContext ⚠️ Binding only Focus update context Not used in example
UIFocusAnimationCoordinator ⚠️ Binding only Focus animation coordination Not used in example
UIFocusEffect ⚠️ Binding only Focus visual effects Not used in example
UIFocusMovementHint ⚠️ Binding only Focus movement hints Not used in example
Text & Input
UITextInputMode ⚠️ Binding only Text input mode Not used in example
UITextInputAssistantItem ⚠️ Binding only Text input assistant Not used in example
UIInputViewController ⚠️ Binding only Input view controller Not used in example
Notifications & Events
UILocalNotification ⚠️ Binding only Local notifications (deprecated) Not used in example
UIUserNotificationSettings ⚠️ Binding only Notification settings (deprecated) Not used in example
UIEvent ⚠️ Binding only Event handling Not used in example
UIPressesEvent ⚠️ Binding only Press event handling Not used in example
Storyboard & Segues
UIStoryboard ⚠️ Binding only Storyboard management Not used in example
UIStoryboardSegue ⚠️ Binding only Storyboard segues Not used in example
Search
UISearchController ⚠️ Binding only Search interface Not used in example
UISearchDisplayController ⚠️ Binding only Search display (deprecated) Not used in example
Context Menus
UIContextMenuConfiguration ⚠️ Binding only Context menu configuration Not used in example
UIContextMenuInteraction ⚠️ Binding only Context menu interaction Not used in example

Legend #

  • Available: Fully functional with examples
  • ⚠️ Binding only: Binding exists but not tested/used in examples
  • ⚠️ No constructor: Known issue where default constructor is not available*

Helper Functions #

The library also provides several helper functions and extensions:

Function/Extension Description
UIKitColorExtension.toUIColor() Convert Flutter Color to UIColor
createCGRect() Helper to create CGRect structures
createCGSize() Helper to create CGSize structures

Regenerating bindings #

This project uses Dart-API to use ffigen. To regenerate the bindings, run:

dart run tool/ffigen.dart

Known issues: #