Comments (4)
The code that is generated :
%inline
public export
new : HasIO io => TextButton.New.NamedParameters -> io TextButton
new ps = primIO $ prim__dart_new TextButton [] ps
%foreign "Dart:TextButton.styleFrom,package:flutter/material.dart"
prim__styleFrom : -> -> PrimIO ButtonStyle
export
styleFrom : HasIO io => -> -> io ButtonStyle
styleFrom = primIO $ prim__styleFrom
from idris2dart.
If It can generate something like this, it can work
namespace TextButton
export
IsAssignableFrom Widget TextButton where
namespace New
data Tag : Type where
%inline
public export
onPressed : Parameter TextButton.New.Tag
onPressed = mkParameter "onPressed" (IO ())
%inline
public export
style : Parameter TextButton.New.Tag
style = mkParameter "style" ButtonStyle
%inline
public export
child : Parameter TextButton.New.Tag
child = mkParameter "child" Widget
%inline
public export
NamedParameters : Type
NamedParameters = Parameters [TextButton.New.onPressed, TextButton.New.style, TextButton.New.child]
namespace StyleFrom
data Tag : Type where
%inline
public export
primary : Parameter StyleFrom.Tag
primary = mkParameter "primary" Color
%inline
public export
backgroundColor : Parameter StyleFrom.Tag
backgroundColor = mkParameter "backgroundColor" Color
%inline
public export
NamedParameters : Type
NamedParameters = Parameters [StyleFrom.primary, StyleFrom.backgroundColor]
%inline
public export
new : HasIO io => TextButton.New.NamedParameters -> io TextButton
new ps = primIO $ prim__dart_new TextButton [] ps
%extern prim__dart_new : Type -> HVect positional -> Parameters named -> (1 x : %World) -> IORes ButtonStyle
%inline
public export
styleFrom : TextButton.StyleFrom.NamedParameters -> IO ButtonStyle
styleFrom ps = primIO $ prim__dart_new (Struct "TextButton.styleFrom,package:flutter/material.dart" []) [] ps
from idris2dart.
I have a fix here @bamboo rafaelprev@50a35a5
But I'm not really satisfied with this fix, unless you want me to do a PR because its a small project or because you think its good enough, I will improve that solution on my fork
from idris2dart.
Hey @rafaelprev, thanks for the report, I'll take a look at this in the next couple of days.
from idris2dart.
Related Issues (7)
- variable already declared in this scope HOT 4
- Does not compile with latest Idris2 HOT 1
- Your flutter examples doesn't compile anymore HOT 1
- Foreign function argument values of type `Bool` should be converted to Dart `bool` HOT 2
- Make all stops with Error HOT 3
- A question regarding type safety of generated code HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from idris2dart.