Complete View

Here is our primary View/MainView/ that contains the complete code of the View explained in bits and pieces:

    /**     * Base view shown when the application is started     */    class MainView : View("Dictionary") {      // Get the REST client      private val api: Rest by inject()      private val controller: WordController by inject()      // UI elements      private var inputWord: TextField by singleAssign()      private var result: Label by singleAssign()      init {        // Configuring the client        api.baseURI = "https://wordsapiv1.p.mashape.com/words/"        api.engine.requestInterceptor = {          (it as HttpURLRequest).addHeader("X-Mashape-Key",            Constants.WORDS_API_KEY)        }      }      /**       * Root View       */      override val root = vbox {        addClass(cssRule)        form {          fieldset(labelPosition = Orientation. ...

Get Kotlin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.