Created
January 22, 2020 00:04
-
-
Save ybakos/badad377e248987ff0b8e424a3ae0233 to your computer and use it in GitHub Desktop.
CS 492 Week 5 Exploration 1 Exercise
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
| Look for the occurrences of FIXME. | |
| FIXME 1 | |
| Be sure the data type is correct. | |
| FIXME 2 | |
| Remember the best practice. | |
| FIXME 3 | |
| Remember to invoke super. | |
| FIXME 4 | |
| Be sure the method signature is correct. | |
| FIXME 5 | |
| What should it do with this widget? |
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(PuppyApp(puppyName: 'Fido')); | |
| } | |
| abstract class PuppyApp { // FIXME 1 | |
| final String puppyName; | |
| /* FIXME 2 */ PuppyApp({Key key, this.puppyName}) : /* FIXME 3 */ ; | |
| @override | |
| void build() { /* FIXME 4 */ | |
| Center(child: Text('$puppyName', textDirection: TextDirection.ltr)); /* FIXME 5 */ | |
| } | |
| } | |
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(PuppyApp(puppyName: 'Fido')); | |
| } | |
| class PuppyApp extends StatelessWidget { // FIXED: Extend StatelessWidget | |
| final String puppyName; | |
| // FIXED: Define a const constructor | |
| const PuppyApp({Key key, this.puppyName}) : super(key: key); // FIXED: Invoke super. | |
| @override | |
| Widget build(BuildContext context) { // FIXED: Return a Widget, receive a BuildContext. | |
| return Center(child: Text('$puppyName', textDirection: TextDirection.ltr)); | |
| } // FIXED: Return the widget | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment