Functions
📄️ Overview
Surely, functions are supported. For example,
📄️ Methods
In addition to standard functions,
📄️ Callables
Your Rust struct can be a callable object at the Dart side.
📄️ Properties
Properties, or called accessors, are supported.
📄️ Constructors
Firstly, when a Rust struct has synchronous new method,
📄️ Equals and Hash
This page discusses the operator== (equals) and hashCode of the automatically generated Dart class.
📄️ Ignoring functions
This page explains how to let a function not to be translated by flutterrustbridge.
📄️ Renaming functions
To customize the name on Dart side to be different from the name on Rust side, the #[frb(name = ...)] can be used.
📄️ Default parameters
Dart allows default values for function and constructor parameters, and you can achieve the same effect using #[frb(default)]. The syntax is as follows: