GithubHelp home page GithubHelp logo

calclix's Introduction

Null safety example: A CLI-app for calculating lix

This is a small code example of an app that calculates the 'lix' readability index for a text file. The implementation uses the new Dart null safety feature, and is means to demonstrate how this feature works in a practical example, as-well-as serve as a demonstration of how to configure and run code with null safety at it's current technical preview stage.

Running the example code

The code example only works with the null safety technical preview 1 build, Dart SDK version 2.9.0-11.0.dev. You will need to download a copy of this Dart SDK even if you have a Flutter or Dart SDK installed already, and you want to use this preview SDK only for experimenting with null safety. Specifically, do not use it for any kind of production coding.

Dart preview SDK installation

  1. Download the preview SDK: Windows, macOS, Linux

  2. Unzip the SDK to a folder, e.g. /Users/michael/dev/preview/dart-sdk or C:\Users\michael\dev\preview\dart-sdk\

Running from the terminal/command-prompt

Because null safety is still in technical preview, we need to pass a so-called 'experiment flag' when invoking and Dart command in the terminal, which looks like this: --enable-experiment=non-nullable.

To run the main app, type these commands in the terminal/command-prompt:

  • Windows:
    • cd <the folder that contains this code example>
    • C:\Users\michael\dev\preview\dart-sdk\bin\dart --enable-experiment=non-nullable bin\main.dart text\lorem-ipsum.txt
  • macOS/Linux:
    • cd <the folder that contains this code example>
    • /Users/michael/dev/preview/dart-sdk/bin/dart --enable-experiment=non-nullable bin/main.dart text/lorem-ipsum.txt

Running from VSCode

TODO

Running from Android Studio

TODO

calclix's People

Contributors

mit-mit 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.