Transform Widget In Flutter

Updated 31 August 2023

Save

In this blog, I will explain Transform Widget In Flutter use this widget to create an attractive mobile UI

Introduction:

Transform Widget In Flutter enables us to make a number of changes to its child widget, including rotating, scaling, translating, and skewing. This enables us to design dynamic user interfaces with enticing visuals.

Types Of Transform Widget:

The Scale, Skew, Translate, Rotate, and Depict properties of the Transform widget let us choose the activity’s kind that we require.

Transform Widget are:

  1. Transform.scale
  2. Transform.rotate
  3. Transform.translate
  4. Transform (default constructor)

Read more about Flutter app development services by Mobikul

Scale:

It is a Transform. Scale constructor. The child is scaled by the specified scale boundary by the scale constructor. You shouldn’t let the scale parameter be null. It provides the scalar needed to make the x and y axes bigger. The scale’s starting point is determined by the alignment; by default, this is the bottom-center of the container.

Code:

Output:

Rotate:

It is a Transform. rotate constructor.Use the rotate method from the Matrix4 class to rotate a widget. Enter the angle’s radius in radians and to use Matrix4 class please import (import ‘dart:math’ as math;)

Code:

Output:

Translate:

It is a Transform. translate constructor.Use the translate method to translate (move) a widget. Set the translation settings for X and Y.

Code:

Output:

Transform (default constructor) Skew:

It is a Transform constructor. To skew a widget, apply the skew method. Specify the X and Y skew angles in radians.

Code:

Output:

You may also check our other AnimationController in Flutter .

Thanks for reading this article.

For more understanding please can go through this Link

For more interesting blogs check here.

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home