dart_node_react_native library

External Documentation

React Native bindings for Dart

Extension Types

AppRegistry

AppRegistry for registering the root component

ReactNative

React Native core - accessed via require('react-native')

RNActivityIndicatorElement

ActivityIndicator component type

RNButtonElement

Button component type

RNFlatListElement

FlatList component type

RNImageElement

Image component type

RNSafeAreaViewElement

SafeAreaView component type

RNScrollViewElement

ScrollView component type

RNSwitchElement

Switch component type

RNTextElement

Text component type

RNTextInputElement

TextInput component type

RNTouchableOpacityElement

TouchableOpacity component type

RNViewElement

View component type

Properties

appRegistry AppRegistry

Get AppRegistry from react-native
no setter

reactNative ReactNative

no setter

Functions

activityIndicator({bool? animating, String? color, String? size, Map<String, dynamic>? props}) RNActivityIndicatorElement

ActivityIndicator component

createElement(JSAny type, [JSObject? props, JSAny? children]) ReactElement

Create a React element (convenience wrapper)

createElementWithChildren(JSAny type, JSObject? props, List<JSAny> children) ReactElement

Create a React element with multiple children using spread

createFunctionalComponent(ReactElement render(JSObject props)) JSFunction

Create a functional component - returns the component function itself

createProps(Map<String, dynamic> props) JSObject

Create props object from a Map (with function conversion)

flatList({required JSArray<JSAny?> data, required JSFunction renderItem, JSFunction? keyExtractor, Map<String, dynamic>? style, Map<String, dynamic>? props}) RNFlatListElement

FlatList component

functionalComponent(String name, ReactElement render(JSObject props)) ReactElement

Create a React element with an inline functional component

registerApp(String appName, JSFunction component) → void

Register the main app component

rnButton({required String title, void onPress()?, String? color, bool? disabled, Map<String, dynamic>? props}) RNButtonElement

Button component

rnElement(String componentName, {Map<String, dynamic>? props, List<ReactElement>? children, JSAny? child}) ReactElement

Create a React Native element Note: child accepts JSAny? to support both ReactElement and text strings

rnImage({required Map<String, dynamic> source, Map<String, dynamic>? style, String? resizeMode, Map<String, dynamic>? props}) RNImageElement

Image component

rnSwitch({bool? value, void onValueChange(bool)?, String? trackColor, String? thumbColor, Map<String, dynamic>? props}) RNSwitchElement

Switch component

safeAreaView({Map<String, dynamic>? style, Map<String, dynamic>? props, List<ReactElement>? children, JSAny? child}) RNSafeAreaViewElement

SafeAreaView component

scrollView({Map<String, dynamic>? style, Map<String, dynamic>? contentContainerStyle, Map<String, dynamic>? props, List<ReactElement>? children, JSAny? child}) RNScrollViewElement

ScrollView component

text(String content, {Map<String, dynamic>? style, Map<String, dynamic>? props, void onPress()?}) RNTextElement

Text component

textInput({String? value, String? placeholder, bool? secureTextEntry, void onChangeText(String)?, Map<String, dynamic>? style, Map<String, dynamic>? props}) RNTextInputElement

TextInput component

touchableOpacity({void onPress()?, Map<String, dynamic>? style, Map<String, dynamic>? props, List<ReactElement>? children, JSAny? child}) RNTouchableOpacityElement

TouchableOpacity component

useCallback(JSFunction callback, JSArray<JSAny?> deps) JSFunction

useCallback hook

useEffect(JSFunction effect, [JSArray<JSAny?>? deps]) → void

useEffect hook

useMemo(JSFunction factory, JSArray<JSAny?> deps) JSAny?

useMemo hook

useRef(JSAny? initialValue) JSObject

useRef hook

useState(JSAny? initialValue) → (JSAny?, JSFunction)

useState hook - returns (value, setter)

view({Map<String, dynamic>? style, Map<String, dynamic>? props, List<ReactElement>? children, JSAny? child, void onPress()?}) RNViewElement

View component - the fundamental building block