Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created June 11, 2021 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fredgrott/bdb7333f3a713b0fd12e939d423bfa81 to your computer and use it in GitHub Desktop.
Save fredgrott/bdb7333f3a713b0fd12e939d423bfa81 to your computer and use it in GitHub Desktop.
dart begin
// Copyright 2021 Fredrick Allan Grott. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
/// Entry-point of the app
/// @author Fredrick Allan Grott
void main(List<String> arguments) {
// In-line comment
/*
Block comment
*/
/// Documentation
var firstName = 'Mahmud'; // String type inference
// ignore: omit_local_variable_types
String lastName =
'Ahsan'; // String type declared, not really needed as far as type annotation as we can instead inference it
// ignore: omit_local_variable_types
int number =
100; // integer type declared, not really needed as far as type annotation as we can instead inference it
// ignore: omit_local_variable_types
double cost =
11.40; // double type declared, not really needed as far as type annotation as we can instead inference it
dynamic isOkay = true; // dynamic type can holds any type
// print functions print to the screen in a console app
print(firstName + ' ' + lastName);
print(number);
print(cost);
print(isOkay);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment