objective_c 4.0.0 copy "objective_c: ^4.0.0" to clipboard
objective_c: ^4.0.0 copied to clipboard

PlatformiOSmacOS

A library to access Objective C from Flutter that acts as a support library for package:ffigen.

example/lib/main.dart

// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:objective_c/objective_c.dart';

void main() {
  runApp(const MaterialApp(home: MainApp()));
}

class MainApp extends StatefulWidget {
  const MainApp({super.key});

  @override
  State<MainApp> createState() => _MainAppState();
}

class _MainAppState extends State<MainApp> {
  late final String message;

  @override
  void initState() {
    super.initState();

    message = NSString('Hello World!').toString();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Text(message),
      ),
    );
  }
}
3
likes
160
points
7.87k
downloads

Publisher

verified publisherlabs.dart.dev

Weekly Downloads

A library to access Objective C from Flutter that acts as a support library for package:ffigen.

Repository (GitHub)
View/report issues
Contributing

Topics

#interop #ffi #objective-c #codegen

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

ffi, flutter

More

Packages that depend on objective_c