-1

i use show case view package and i want to have rtl direction , how can i do this ?enter image description here

                     Showcase(
                      showArrow: false,
                      key: _twoCaseShow,
                      disableAnimation: true,
                      description: 'مشاهده کلیه درخواست های شما',
                      child: Align(
                          alignment: Alignment.center,
                          child: 
                              Icon(
                                FontAwesomeIcons.list,
                                color: ColorsBase.blue,
                              ),                               
                            ],
                          )),
                         )

1 Answers1

0

From the Showcaseview official repository, we can see that the description property is being used as follows:

Text(
                                      description,
                                      style: descTextStyle ??
                                          Theme.of(context)
                                              .textTheme
                                              .subtitle
                                              .merge(TextStyle(color: textColor)),
                                    )

This means you can change this line of the package to include the direction property:

Text(
                                      description,
                                      textDirection: TextDirection.rtl,
                                      style: descTextStyle ??
                                          Theme.of(context)
                                              .textTheme
                                              .subtitle
                                              .merge(TextStyle(color: textColor)),
                                    )

However, as this answer suggests, other solution is to use the Directionality class to change the directionality of the text widget from outside of it:

Directionality(
 textDirection: TextDirection.rtl,
 child: Showcase(
                      showArrow: false,
                      key: _twoCaseShow,
                      disableAnimation: true,
                      description: 'مشاهده کلیه درخواست های شما',
                      child: Align(
                          alignment: Alignment.center,
                          child: 
                              Icon(
                                FontAwesomeIcons.list,
                                color: ColorsBase.blue,
                              ),                               
                            ],
                          )),
                         ),
    )

Naslausky
  • 3,443
  • 1
  • 14
  • 24