swiftui 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • new14

swiftui #

A research implementation of SwiftUI view transformations on Flutter Widgets using Dart extensions.

    sdk: flutter
    git: https://github.com/lukepighetti/flutter_swiftui
class Example extends StatelessWidget {
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        Text("offsetDegrees").offsetDegrees(180, 100),
        Text("More padded").padded(40),

Contributing #

Since this API is intended for research, I'm totally happy with people submitting breaking changes and altering the direction of this project. My starting point was to try to implement the most-common View transformations you see in SwiftUI, but I make no claims that the architecture I've chosen makes the most sense. I'd much rather someone break the API with something novel than try to fight with implementing the SwiftUI api extactly.

In other words, SwiftUI is merely an inspiration, and not a specification.

0.1.0 - October 10, 2019 #

  • Super alpha alpha preview release


example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  swiftui: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:swiftui/swiftui.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Oct 10, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4


Detected platforms:

Error(s) prevent platform classification:

Make sure flutter format successfully runs on your package's source files.

Analysis issues and suggestions

Make sure flutter format successfully runs on your package's source files.

Running flutter format failed with the following output:

Exception: dartfmt on lib/ failed with exit code 65
Could not format because the source could not be parsed:

line 9, column 1 of lib/src/view.dart: This requires the 'extension-methods' experiment to be enabled.
9 │ extension SettingTheSizeOfAView on Widget {
  │ ^^^^^^^^^
line 9, column 36 of lib/src/view.dart: Functions must have an explicit list of parameters.

Fix dependencies in pubspec.yaml.

Running flutter pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.5.0.
 Because swiftui requires SDK version >=2.6.0-dev <3.0.0, version solving failed.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Make sure flutter format successfully runs on your package's source files.

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0-dev <3.0.0