This file contains hidden or 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
| import 'dart:math'; | |
| void main() { | |
| //Full function | |
| // double bmiCalculator(double height, double weight) { | |
| // final bmi = weight / pow(height, 2); | |
| // return bmi; | |
| // } | |
| //Fat arrow function |
This file contains hidden or 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
| class DicePageState extends State<DicePage> { | |
| int dice1Value = 1; | |
| int dice2Value = 2; | |
| @override | |
| Widget build(BuildContext context) { | |
| return Column( | |
| children: <Widget>[ | |
| FlatButton( | |
| child: Image( |
This file contains hidden or 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
| import 'package:flutter/material.dart'; | |
| void main() => runApp( | |
| MaterialApp( | |
| home: BallPage(), | |
| ), | |
| ); | |
| class BallPage extends StatelessWidget { | |
| @override |
This file contains hidden or 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
| import 'package:flutter/material.dart'; | |
| void main() => runApp( | |
| MaterialApp( | |
| home: BallPage(), | |
| ), | |
| ); | |
| class BallPage extends StatelessWidget { | |
| @override |
This file contains hidden or 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
| import 'package:flutter/material.dart'; | |
| void main() => runApp( | |
| MaterialApp( | |
| home: BallPage(), | |
| ), | |
| ); | |
| class BallPage extends StatelessWidget { | |
| @override |
This file contains hidden or 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
| import 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| void main() => runApp( | |
| MaterialApp( | |
| home: BallPage(), | |
| ), | |
| ); | |
| class BallPage extends StatelessWidget { |
This file contains hidden or 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
| import 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| void main() => runApp( | |
| MaterialApp( | |
| home: BallPage(), | |
| ), | |
| ); | |
| class BallPage extends StatelessWidget { |
This file contains hidden or 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
| import 'package:flutter/material.dart'; | |
| import 'package:audioplayers/audio_cache.dart'; | |
| const sounds = [ | |
| 'note1.wav', | |
| 'note2.wav', | |
| 'note3.wav', | |
| 'note4.wav', | |
| 'note5.wav', | |
| 'note6.wav', |
This file contains hidden or 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
| //Challenge: Without changing the main() function, can you make this code work and get the result printed in the console? | |
| void main() { | |
| int step1Result = add(n1: 5, n2: 9); | |
| int step2Result = multiply(step1Result, 5); | |
| double finalResult = step2Result / 3; | |
This file contains hidden or 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
| void main() { | |
| List<String> myList = [ | |
| 'Angela', | |
| 'James', | |
| 'Katie', | |
| 'Jack', | |
| ]; | |
| } |
OlderNewer