Skip to content

Instantly share code, notes, and snippets.

View ykmnkmi's full-sized avatar
🎯
I may be slow to respond.

Olzhas Suleimen ykmnkmi

🎯
I may be slow to respond.
  • Kazakhstan, Almaty
  • 01:40 (UTC +05:00)
View GitHub Profile
@ykmnkmi
ykmnkmi / flutter-ffi-async-nativeport.md
Created June 26, 2023 09:32 — forked from espresso3389/flutter-ffi-async-nativeport.md
Async messaging between Flutter and C++ using Dart ffi NativePort

C++

  • 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;
@ykmnkmi
ykmnkmi / main.dart
Created October 1, 2020 07:15
Flutter simple drawer
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 {
@ykmnkmi
ykmnkmi / main.dart
Created August 26, 2020 14:30
Flutter web tab switch and unfocus example
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());
}
@ykmnkmi
ykmnkmi / main.dart
Last active June 19, 2020 12:51
flutter transparent bg
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);
@ykmnkmi
ykmnkmi / main.dart
Last active September 25, 2020 18:15
gl vertex math dart:ui
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;