RTL not supported if i m using alignment: Alignment.centerRight in text widget in flutter

Viewed 7

please check my code and correct me!

my language changed but the text shown in the same position only just language converted but does not support RTL.

Align(
                alignment: Alignment.centerRight,
                child: TextButton(
                  onPressed: () {
                    Navigator.of(context).push(MaterialPageRoute(
                        builder: (context) => MyForgot()));
                  },
                  child: Text(
                    'forgot'.tr, //title
                    style: TextStyle(color: Colors.white, fontSize: 16),
                  ),
                ),
              ),
1 Answers

There is an easy way

Row(
  children: [
    Spacer(), // use Spacer
     TextButton(
          onPressed: () {
                    Navigator.of(context).push(MaterialPageRoute(
                        builder: (context) => MyForgot()));
                  },
                  child: Text(
                    'forgot'.tr, //title
                    style: TextStyle(color: Colors.white, fontSize: 16),
                  ),
                ),
  ],
)
Related