Widget build(BuildContext context) {
return new Material(
child: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
new Text('Hello from Flutter!'),
new RaisedButton(
child: new Text('Get Location'),
onPressed: _getLocation
),
new Text('Latitude: $_latitude, Longitude: $_longitude'),
]
)
)
);
}
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
Why not some markup language?
Works in angular 2, worked for flex, and it is optional
"Some markup language" - you mean XML? HTML?Doesn't fit in dart. Syntax like from the other planet.
I really do not like to shove together controller and view....It gets ugly fast...
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
Widget build(BuildContext context) => '<Material>
<Center>
<Column mainAxisAlignment="{MainAxisAlignment.spaceEvenly}">
<Widget>
<Text>Hello from Flutter!</Text>
<RaisedButton (pressed)="_getLocation">
<Text>Get Location</Text>
</RaisedButton>
<Text>Latitude: $_latitude, Longitude: $_longitude</Text>
</Widget>
</Column>
</Center>
</Material>';
Actually,
Widget build(BuildContext context) => '<Material layout="{Layout.Center}">
<Column mainAxisAlignment="{MainAxisAlignment.spaceEvenly}">
<Widget>
Hello from Flutter!
<RaisedButton (pressed)="_getLocation">Get Location</RaisedButton>
Latitude: $_latitude, Longitude: $_longitude
</Widget>
</Column>
</Material>';
Or whatever variant
Yeah I would actually :)
But will dart ever change to accommodate this style? Big maybe, some react like markup, whatever the looks, can be easier to accomplish today.
Just look at angular 2, works fine with Dart the way it is today
So.... what stops you from doing it?
Nobody likes markups, they exist mostly because the underlying language is too limited to cleanly solve the problem.
I agree that large xml views are like spaghetti, then again coming from flex, I never really had that problem with mxml, also you can always move an xml chain to somewhere else and import it.
I think for now what would work best is to combine both, either build from code as in the current flutter examples, or from something xml based.
Flutter is new and needs to convince people to use it, the current syntax will turn many heads.
Whereas an xml like alternative for a v1.0, with the option to entirely skip it and go for a pure Dart code solution, wouldn't be so bad at all.
I'd personally love a super clean solution entirely made in pure Dart, but it may take quite some time still.
I don't really understand what is meant by child and children in Flutter. But, looking at the syntax,1. it looks wired and like a callback hell.2. Your example looks very clean but these semicolons need to be removed. (from the language itself)3. Varargs are necessary instead of collection literals.
Actually, I work on Android so I can give you a better feedback. I am comparing these with my XMLs : The point is XMLs looks even bad than this. And When I refactor class names or move something from my project (For example, just copying a XML layout from one project to another); It never complains about missing classes. It just crashes at runtime.Also, I hate writing markup languages for layouts. XMLs forces me to repeat everything.
For example, I want to draw four slices of a rectangle with linear layouts, then I have to end up taking 4 different LinearLayouts. I wish I could write something like:
for (int i=0 to 4){draw me a <LinearLayout>}
When layouts become complex, XMLs become spaghetti's. The bad Android view groups like RelativeLayouts add a sauce on it. XML layouts are always hard to read and change. I can write the same layout using pure Java code. But unfortunately, Java version will make it 10 times larger and complex than XML. I wish I would have some sort of groovy based DSL like (Gradle)[https://docs.gradle.org/current/userguide/tutorial_using_tasks.html] build system for layouts.
After 2 years of writing XMLs for Android, I would say NO to these ugly Markup Languages; especially XML for layouts. If you don't agree, try it for a year and write some complex layouts or ask any Android Dev. you will realise the pain better.
Haven't written yet. Looked at AngularDart a few days ago. But, they look more like DLS. They aren't pure XMLs. Are they?
--
What can Flutter do that isn't possible in the browser? I haven't taken a deep dive into Flutter since you can't develop on Windows so I'm genuinely curious since it was built by taking apart a browser.
function(a, b, [c, d], e...) {print("required $a, $b, optional $c, $d, varargs $e");}function(1, 2, 3, 4, 5, 6) // prints "required 1, 2, optional 3, 4, varargs [5, 6]".function(1, 2, 3, 4, 5) // prints "required 1, 2, optional 3, 4, varargs [5]".function(1, 2, 3, 4) // prints "required 1, 2, optional 3, 4, varargs []".function(1, 2, 3) // prints "required 1, 2, optional 3, null, varargs []".function(1, 2) // prints "required 1, 2, optional null, null, varargs []".function(1) // compile error
--
Right it doesn't have a DOM or CSS I get that. I don't see why you couldn't compile HTML and CSS out to something flutter can consume.
On Thursday, September 22, 2016, Lex Berezhny wrote:
Right it doesn't have a DOM or CSS I get that. I don't see why you couldn't compile HTML and CSS out to something flutter can consume.
It sounds a lot like react native to me, not that I've used either that or flutter before?
https://github.com/facebook/react-native/blob/master/Examples/Movies/MovieScreen.js
--
So, one could just swap the implementation of "dart:ui" (and other services the app uses) when targeting the web, ideally without changing a thing in our code.Aren't configurable imports supposed to allow this kind of stuff?
// Flt - flutter dsl
var layout = flt! {
// something in here less verbose and easy on the eye
}