Chapter 1

  1. What is a widget?
    A widget is a description of the user interface. This description gets “inflated” into an actual view when objects are built.

  2. What is the starting point of a Dart and Flutter app?
    The main() function is the starting point of every Dart and Flutter application.

  3. How many named constructors can you have in a Dart/Flutter class?
    In a Dart/Flutter class, you can have any number of named constructors, but only one unnamed constructor.

  4. Can you name three EdgeInsets constructors?
    In this chapter, we used EdgeInsets.all, EdgeInsets.only, and EdgeInsets.symmetric.

  5. How can you style the text in a Text widget?
    The Text widget has a style property. There you can use TextStyle() to set the font size, its weight, color, and several other properties.

  6. What is the purpose of the flutter doctor command?
    It is a CLI tool that you can use to check the Flutter installation on your system.

  7. What widget would you use to contain several other widgets, one below the other?
    The Column widget contains a children property that places widgets one below the other.

  1. What is the "arrow syntax"?
    The arrow syntax is a concise way to return values in a function. An example of arrow syntax is as follows:
bool convertToBool(int value) => (value == 0) ? false : true;
  1. Which widget can you use to create space between widgets?

    Several widgets can be used for that. A Padding widget can be used to create space between its child and all other widgets on the screen.

  2. How can you show an image to the user?

    You can show images using the Image widget. Image has a network constructor, which automatically downloads an image from a URL with a single line of code.

 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.246.148