DEV Community

Max Rose
Max Rose

Posted on

If designers could give you a working UI that you could modify programmatically, would you use it?

Top comments (4)

Collapse
 
rhymes profile image
rhymes

Are you talking about something like Flutter? A UI completely expressed through the programming language?

This is an example:

import 'package:flutter/material.dart';

void main() {
  runApp(new MaterialApp(
    home: new MyHome(),
  ));
}

class MyHome extends StatefulWidget {
  @override
  MyHomeState createState() => new MyHomeState();
}

class MyHomeState extends State<MyHome> {
  // Generate dialog
  AlertDialog dialog = new AlertDialog(
      content: new Text(
    "Hello World!",
    style: new TextStyle(fontSize: 30.0),
  ));

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
        appBar: new AppBar(
          title: new Text("Using Alert Dialog"),
        ),
        body: new Container(
          child: new Center(
            child: new RaisedButton(
                child: new Text("Hit to alert!"),
                // On press of the button
                onPressed: () {
                  // Show dialog
                  showDialog(context: context, builder: (BuildContext context) => dialog);
                }),
          ),
        ));
  }
}

which compiled does this:

taken from flutter-examples/using_alert_dialog

Collapse
 
maxrose profile image
Max Rose • Edited

Hi Rhymes!

I'm thinking something like a designer customizing the UI in something like Sketch, and being able to access the content of that with code. And maybe even auto initializing objects from the designers visual editor.

Collapse
 
rhymes profile image
rhymes

I think that if Flutter becomes mainstream (or at least it takes hold on a bigger scale) a design tool around it will pop up.

Someone's thinking about this, see this AppBuilder and others are experimenting with reorganizing their designer-developer flow through it.

But I'm not a designer so I can't answer your question, I just wanted to ask if you knew about Flutter's potential for a tool like that.

Collapse
 
link2twenty profile image
Andrew Bone • Edited

Like Dreamweaver? A WYSIWYG web editor that produces code?

Many years ago you could export a Macromedia Fireworks project to Dreamweaver.

It was a strange concept you made a "slice" and said if the user clicks here do this or navigate here.

EDIT: a tutorial from 2006 adobepress.com/articles/article.as... 😯