objective_c 1.0.1 copy "objective_c: ^1.0.1" to clipboard
objective_c: ^1.0.1 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),
      ),
    );
  }
}
1
likes
150
pub points
37%
popularity

Publisher

verified publisherlabs.dart.dev

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, plugin_platform_interface, yaml

More

Packages that depend on objective_c