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
void main(List<String> arguments) { | |
options = ['Multiply', 'Dart', 'Function', 'Gold', 'Silver', 'Bronze']; | |
String getColorForOption(String answer) { | |
bool correctAnswer = answer.startsWith("S"); | |
bool isSelected = answer.startsWith("D"); | |
if (isSelected) { | |
return correctAnswer ? 'Green' : 'Red'; | |
} else { | |
return correctAnswer ? 'Green-Correction' : 'Grey'; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
extension Str on List { | |
String joint([String separator = ""]) { | |
if (isEmpty) { | |
return ""; | |
} | |
final StringBuffer buffer = StringBuffer(); | |
for (var i = 0; i < length; i++) { | |
if (i > 0) { | |
buffer.write(separator); | |
} |
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
int divisions(String input) { | |
int divisions = 0; | |
for (var j = 3; j <= 4; ++j) { | |
//divisions = 2; | |
if (input.length % j == 0) { | |
return divisions = j; | |
} | |
} | |
return divisions; |
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
final RiffSwitchType type; | |
RiffSwitchType get _type => type; | |
@override | |
Widget build(BuildContext context) { | |
// Dart 2 | |
/*switch (_type) { | |
case RiffSwitchType.simple: | |
return _buildSimpleSwitch(); |
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
void main() { | |
WidgetsFlutterBinding.ensureInitialized(); | |
SystemChrome.setPreferredOrientations([ | |
DeviceOrientation.portraitUp, | |
DeviceOrientation.portraitDown, | |
DeviceOrientation.landscapeRight, | |
DeviceOrientation.landscapeLeft, | |
]).then(appCallback); | |
} |