Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
/.preview
/build
/.cxx
/.test
/.test
**/BuildProfile.ets
**/oh-package-lock.json5
**/libs/**
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ project(${PROJECT_NAME} LANGUAGES CXX)
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
if (OHOS_ARCH STREQUAL "arm64-v8a")
set(FLUTTER_TARGET_PLATFORM "ohos-arm64")
elseif(OHOS_ARCH STREQUAL "armeabi-v7a")
set(FLUTTER_TARGET_PLATFORM "ohos-arm")
elseif(OHOS_ARCH STREQUAL "x86_64")
set(FLUTTER_TARGET_PLATFORM "ohos-x64")
elseif(OHOS_ARCH STREQUAL "armeabi-v7a")
message(FATAL_ERROR
"The current HarmonyOS Flutter/Hvigor toolchain does not support "
"the armeabi-v7a ABI. Use arm64-v8a or x86_64.")
else()
message(WARNING "Unknown OHOS_ARCH: ${OHOS_ARCH}, defaulting to ohos-arm64")
set(FLUTTER_TARGET_PLATFORM "ohos-arm64")
message(FATAL_ERROR
"Unsupported OHOS_ARCH: ${OHOS_ARCH}. Use arm64-v8a or x86_64.")
endif()
message(STATUS "Detected OpenHarmony platform: ${FLUTTER_TARGET_PLATFORM}")
message(STATUS "Detected OpenHarmony platform: ${FLUTTER_TARGET_PLATFORM}")
endif()
include("../../../../cargokit/cmake/cargokit.cmake")
apply_cargokit(${PROJECT_NAME} ../../../../../rust REPLACE_ME_RUST_CRATE_NAME "")
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
/.preview
/build
/.cxx
/.test
/.test
**/BuildProfile.ets
**/oh-package-lock.json5
**/libs/**
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ project(${PROJECT_NAME} LANGUAGES CXX)
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
if (OHOS_ARCH STREQUAL "arm64-v8a")
set(FLUTTER_TARGET_PLATFORM "ohos-arm64")
elseif(OHOS_ARCH STREQUAL "armeabi-v7a")
set(FLUTTER_TARGET_PLATFORM "ohos-arm")
elseif(OHOS_ARCH STREQUAL "x86_64")
set(FLUTTER_TARGET_PLATFORM "ohos-x64")
elseif(OHOS_ARCH STREQUAL "armeabi-v7a")
message(FATAL_ERROR
"The current HarmonyOS Flutter/Hvigor toolchain does not support "
"the armeabi-v7a ABI. Use arm64-v8a or x86_64.")
else()
message(WARNING "Unknown OHOS_ARCH: ${OHOS_ARCH}, defaulting to ohos-arm64")
set(FLUTTER_TARGET_PLATFORM "ohos-arm64")
message(FATAL_ERROR
"Unsupported OHOS_ARCH: ${OHOS_ARCH}. Use arm64-v8a or x86_64.")
endif()
message(STATUS "Detected OpenHarmony platform: ${FLUTTER_TARGET_PLATFORM}")
message(STATUS "Detected OpenHarmony platform: ${FLUTTER_TARGET_PLATFORM}")
endif()
include("../../../../cargokit/cmake/cargokit.cmake")
apply_cargokit(${PROJECT_NAME} ../../../../rust REPLACE_ME_RUST_CRATE_NAME "")
41 changes: 41 additions & 0 deletions frb_example/flutter_via_create/lib/src/rust/api/ohos_smoke.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.14.0-beta.2.

// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import

import '../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`

Uint8List reverseBytes({required List<int> value}) =>
RustLib.instance.api.crateApiOhosSmokeReverseBytes(value: value);

OhosSmokePayload transformPayload({required OhosSmokePayload value}) =>
RustLib.instance.api.crateApiOhosSmokeTransformPayload(value: value);

Future<String> asyncGreet({required String name}) =>
RustLib.instance.api.crateApiOhosSmokeAsyncGreet(name: name);

String fallibleValue({required bool shouldFail}) =>
RustLib.instance.api.crateApiOhosSmokeFallibleValue(shouldFail: shouldFail);

Stream<int> emitValues() => RustLib.instance.api.crateApiOhosSmokeEmitValues();

class OhosSmokePayload {
final int code;
final String label;

const OhosSmokePayload({required this.code, required this.label});

@override
int get hashCode => code.hashCode ^ label.hashCode;

@override
bool operator ==(Object other) =>
identical(this, other) ||
other is OhosSmokePayload &&
runtimeType == other.runtimeType &&
code == other.code &&
label == other.label;
}
Loading
Loading