- Copy Dart SDK (
${FLUTTER_DIR}/bin/cache/dart-sdk/include
) to your project, e.g.ios/Classes/
- Add your own code like the following fragment
#include "dart_api_dl.h"
// Receives NativePort ID from Flutter code
static Dart_Port_DL dart_port = 0;
import 'dart:async'; | |
import 'dart:math' as math; | |
import 'dart:typed_data'; | |
import 'dart:ui'; | |
import 'package:vector_math/vector_math.dart'; | |
typedef Renderer = void Function(Canvas canvas, Rect paintBounds); | |
Renderer render; |
import 'package:flutter/services.dart'; | |
import 'package:flutter/widgets.dart' hide Draggable; | |
void main() { | |
runApp(App()); | |
} | |
class App extends StatefulWidget { | |
const App({Key key}) : super(key: key); |
import 'dart:ui' as ui show window; | |
import 'package:flutter/rendering.dart'; | |
import 'package:flutter/services.dart'; | |
import 'package:flutter/gestures.dart'; | |
import 'package:flutter/widgets.dart'; | |
void main() { | |
runApp(App()); | |
} |
import 'dart:ui' as ui show window; | |
import 'package:flutter/material.dart' show Colors; | |
import 'package:flutter/widgets.dart'; | |
void main() { | |
runApp(App()); | |
} | |
class App extends StatelessWidget { |