Skip to content

DotCorr/DCFlight

Repository files navigation

                               ▂▄▓▄▂         

██████╗  ██████╗███████╗██╗     ██╗ ██████╗ ██╗  ██╗████████╗
██╔══██╗██╔════╝██╔════╝██║     ██║██╔════╝ ██║  ██║╚══██╔══╝
██║  ██║██║     █████╗  ██║     ██║██║  ███╗███████║   ██║   
██║  ██║██║     ██╔══╝  ██║     ██║██║   ██║██╔══██║   ██║   
██████╔╝╚██████╗██║     ███████╗██║╚██████╔╝██║  ██║   ██║   
╚═════╝  ╚═════╝╚═╝     ╚══════╝╚═╝ ╚═════╝ ╚═╝  ╚═╝   ╚═╝

📌 Key Points

DCFlight in short is a framework that renders actual native UI. It uses the flutter engine (Flutter engine here provides us the runtime and some utilities to initialize DCFlight. More like Hermes in react native). As seen below DCFlight:

import dcflight

@main
@objc class AppDelegate: DCFAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
      GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

It diverges from the flutter abstraction for UI rendering and renders the root view that dcflight depends on to render native UI. No platform views and no absurd abstractions. As a bonus you can still render a flutter Widget by using the WidgetToDCFAdaptor without impacting performance.

📝 Dart Example

import 'package:dcflight/dcflight.dart';
void main() async {
  DCFlight.setLogLevel(DCFLogLevel.debug);

  await DCFlight.start(app: DCFView(
    layout: DCFLayout(flex: 1, justifyContent: YogaJustifyContent.center, alignItems: YogaAlign.center),
    styleSheet: DCFStyleSheet(backgroundColor: Colors.amber),
    children: [
    DCFText(content: "Hello World ✈️"),
  ]));
}

☕ Buy Me a Coffee

Your support fuels the grind. Every contribution keeps this journey alive.

Buy Me A Coffee

https://coff.ee/squirelboy360**

About

Build Native Cross-platform apps and web-apps in dart with native performance

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published