Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
424 additions
and
884 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.PHONY: build | ||
build: | ||
pub run build_runner build --release --output build | ||
rm -r docs | ||
mv build/web docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Source code for [Dart By Example](http://jpryan.me/dartbyexample). | ||
|
||
## Building | ||
|
||
``` | ||
pub run build_runner build --release --output build/ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,40 @@ | ||
<html> | ||
<head> | ||
<title>Dart by example</title> | ||
<title>Dart by example: Constants</title> | ||
<link rel="stylesheet" href="../../site.css"> | ||
<link rel="stylesheet" href="../../hljs/styles/mono-blue.css"> | ||
<script src="../../hljs/highlight.pack.js"></script> | ||
<script>hljs.initHighlightingOnLoad();</script> | ||
</head> | ||
<body> | ||
<div class="example"> | ||
<!-- Google Tag Manager --> | ||
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-WLPW3F" | ||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> | ||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | ||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | ||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | ||
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | ||
})(window,document,'script','dataLayer','GTM-WLPW3F');</script> | ||
<!-- End Google Tag Manager --> | ||
<h2><a href="../../">Dart By Example: </a> Constants</h2> | ||
<p>In dart, compile-time constants can be created as long | ||
<h2><a href="/">Dart by Example</a>: Constants</h2> | ||
<p>In dart, compile-time constants can be created as long | ||
as the object's deep structure can be determined at compile time.</p><pre> | ||
<code class="hljs dart">import 'dart:math'; | ||
|
||
// compile-time constants are defined using 'const' | ||
const name = "greg"; | ||
|
||
// Objects can also be declared at compile-time | ||
const Rectangle<int> bounds = const Rectangle(0, 0, 5, 5); | ||
const Rectangle<int> bounds = const Rectangle(0, 0, 5, 5); | ||
|
||
main() { | ||
print(name); | ||
print(bounds); | ||
} | ||
</code> | ||
</pre> | ||
<pre><code class="bash">$ dart const.dart | ||
<pre><code class="language-bash">$ dart const.dart | ||
greg | ||
Rectangle (0, 0) 5 x 5 | ||
</code></pre> | ||
|
||
|
||
<div class="footer"> | ||
<p>by <a href="http://twitter.com/jryanio">@jryanio</a> | <a href="http://github.com/johnpryan/dartbyexample">source</a> | <a href="https://github.com/johnpryan/dartbyexample/blob/master/LICENSE">license</a></p> | ||
|
||
by <a href="http://twitter.com/jryanio">@jryanio</a> | <a href="http://github.com/johnpryan/dartbyexample">source</a> | <a href="https://github.com/johnpryan/dartbyexample/blob/master/LICENSE">license</a> | ||
|
||
</div> | ||
</div> | ||
</body> |
Oops, something went wrong.