Git Product home page Git Product logo

counter-fmx's Introduction

Flutter/MX Starter

A starter/instructional repo to help get you started on your own app using ClojureDart and Flutter/MX.

This repo out of the box will run this "Hello, world." app, a display-only exercise:

That is Brian Kernighan, popularizer of the "Hello, world." app/instructional approach.

Once we have that running, we will go through the source code in detail, with complete f/mx beginners in mind, be they Clojurians or Flutteristas. The highlight will be how native Flutter constructors can be combined with f/mx widgets, and especially how we use syntax to make that mixture more readable.

Next, we will build something from scratch, viz. the classic Flutter Counter app. That will introduce our first UI control and a bit of reactive state, our first encounter with Matrix (MX) state management.

With that under your belt, you should be able to get rolling on your own Unicorn, with help as always from @kennytilton on the Clojurians Slack, in #matrix or #clojuredart.

Prerequisites

First, work thru steps #1 and #2 in this CLJD Quick Start to get you rocking on ClojureDart and Flutter development in general. You can skip this if you are already coding with CLJD and Flutter.

Clone

Clone this repo locally, changing to your desired project name, here "unicorn":

git clone https://github.com/kennytilton/flutter-mx-starter.git unicorn
cd unicorn
rm -rf .git

We will do a fresh git init after a few more steps.

Now we start the internal name change, from "counter-fmx":

mv src/counter-fmx src/unicorn

Now edit the source globally replacing "counter-fmx" with "unicorn":

find . -type f -exec sh -c 'file -b "$1" | grep -q ASCII' sh {} \; -exec sed -i '' 's/counter-fmx/unicorn/g' {} +

When that ^^^ is done, initialize the project, BUT ignore the final instructions on how "to run your application". WARNING: this step can pause for a minute after displaying "Got dependencies.":

clj -M:cljd init

...and test. To use an iOS sim:

open -a Simulator
clj -M:cljd flutter

You should now see Mr. Kernighan and the app on your sim.

To test other ways, check out this section of the f/mx README.

Now to get git back into the picture:

git init
git add .gitignore .gitattributes README.md clean.sh deps.edn lib/main.dart pubspec.* src image
git commit -am "clone from flutter-mx-starter"

Maintenance

As Clojure Dart and Flutter/MX move forward, you might want to move with them

Flutter/Dart

Easy:

flutter upgrade

ClojureDart

Easy:

clj -M:cljd upgrade

Flutter/MX

Get the latest SHA from the f/mx repo and copy into deps.edn:

{:paths ["src"] ; where your cljd files are
 :deps {tensegritics/clojuredart
        {:git/url "https://github.com/tensegritics/ClojureDart.git"
         :sha "84b18f8e67556862f265ea41f3a9e5f9506cdbef"}

        kennytilton/flutter-mx
        {:git/url "https://github.com/kennytilton/flutter-mx.git"
         :sha "a7250e50a7016499ca1effb63b8d0606f373c247"}} <================= COPY NEW F/MX SHA HERE
 :aliases {:cljd {:main-opts ["-m" "cljd.build"]}}
 :cljd/opts {:kind :flutter
             :main unicorn.main}}

Next steps

If we followed the steps above accurately, we did manage to get a CLJD Flutter/MX demo app running, but we did not learn very much about how it all works. In our next doc, we look at the infrastructure behind the scenes: The Making of "Hello, world.".

Then we build a second "app" from scratch, a Flutter/MX implementation of the classic Flutter Counter app.

Support

Look for @kennytilton in the #matrix or #clojuredart channels on the #Clojurians Slack and I will help you get going.

counter-fmx's People

Contributors

kennytilton avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.