๐
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(){ | |
| var squares = 64; | |
| numberOfGrain(squares); | |
| } | |
| void numberOfGrain(int numberOfSquares){ | |
| // To get the total sum of grians we use a sum of GP where n is number of squares | |
| // common ratio r is 2 (grains in square two / grains in square one) | |
| // Sum of GP = a*(r^n-1)/r-1 where r=2;n=64 |
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
| // Banks database containing all created accts both active and inactive | |
| List<BankAccount> _bankDB = []; | |
| BankAccount myBankAccount(String accountNumber){ | |
| //function that checks if acct exists in DB else create new acct | |
| var hiddenAccNumber = List.generate(accountNumber.length-4,(_)=>'*').join("")+accountNumber.substring(accountNumber.length-4); | |
| try{ | |
| var x = _bankDB.firstWhere((b)=>b.accountNumber==accountNumber); | |
| print('Account $hiddenAccNumber active....'); | |
| return x; |
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() { | |
| print(append([1, 2], [3, 4, 5])); // append | |
| print(concatenate([ | |
| [1, 2, 3], | |
| [4, 5, 6] // concatenate | |
| ])); | |
| print(filter(isOdd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 0])); // filter | |
| print(length([1, 2, 3, 4, 5, 6, 7])); // length | |
| print(map(cubeIt, [1, 2, 3, 4, 5, 6])); // map | |
| print(reverse([0, 1, 2, 3, 4, 5])); // reverse |
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( | |
| debugShowCheckedModeBanner: false, // removing the debug tag | |
| home: new Home(), // the app | |
| ), | |
| ); | |
| } |
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(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| title: 'WhatsApp', | |
| debugShowCheckedModeBanner: false, // remove debug banner |
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(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| title: 'WhatsApp', | |
| debugShowCheckedModeBanner: false, |
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(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| title: 'WhatsApp', | |
| debugShowCheckedModeBanner: false, |
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(new MaterialApp( | |
| home: new MyHomePage(), // runApp(); | |
| )); | |
| } | |
| class MyHomePage extends StatefulWidget { |
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
| /// EXC attendance form UI withoout onpressed method | |
| /// and validation | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(new MaterialApp( | |
| debugShowCheckedModeBanner: false, | |
| home: new MyHomePage(), // runApp(); | |
| )); |
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
| /// ECX attendance form with form validation on | |
| /// button pressed | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(new MaterialApp( | |
| debugShowCheckedModeBanner: false, | |
| home: new MyHomePage(), // runApp(); | |
| )); |