App4 : Flags Quiz - Learning New Widgets

Table Of Content :

  1. ClipRRect
  2. GestureDetector
  3. Divider


  1. ClipRRect
  2. A widget that clips its child using a rounded rectangle.

    Some properties of ClipRRect Class:

    1. child : Widget
    2. The widget below this widget in the tree.

    3. borderRadius : BorderRadius
    4. The border radius of the rounded corners.

    Example :


              ClipRRect(

                borderRadiusBorderRadius.circular(25),

                childContainer(

                  colorColors.orange,

                  width250,

                  paddingEdgeInsets.all(9),

                  childText(

                    "lorem ipsum",

                    styleTextStyle(fontSize30),

                  ),

                ),

              )


    ClipRRect example

  3. GestureDetector
  4. A widget that detects gestures. Attempts to recognize gestures that correspond to its non-null callbacks.


    Some properties of GestureDetector Class:

    1. child : Widget
    2. The widget below this widget in the tree.

    3. onTap : GestureTapCallback
    4. A tap with a primary button has occurred.

    5. onLongPress : GestureLongPressCallback
    6. Called when a long press gesture with a primary button has been recognized.

    7. onDoubleTap : GestureLongPressCallback
    8. The user has tapped the screen with a primary button at the same location twice in quick succession

    Example

              GestureDetector(

                childIcon(

                  Icons.smart_display,

                  size100,

                  colorColors.red,

                ),

                onTap: () {

                  print("Tap");

                },

                onDoubleTap: () {

                  print("Dobule Tap");

                },

                onLongPress: () {

                  print("Long Press");

                },

              )


    GestureDetector Flutter Example

  5. Divider
  6. A thin horizontal line, with padding on either side.


    Some properties of Divider Class:

    1. color : Color
    2. The color to use when painting the line.

    3. height : double
    4. The divider's height extent.

    Example

            Column(

              children: [

                Text("Lorem ipsum dolor sit amet, consectetur adipiscing elit"),

                Divider(

                  height7,

                  colorColors.red,

                ),

                Text(

                    "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium"),

                Divider(

                  height10,

                  colorColors.green,

                ),

                Text(

                    "At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque")

              ],

            )


    Divider Flutter Example