Closed subodh-badavate closed 1 year ago
Hey Hi, Create a child text widget. getText will work only for the text widget.
_card(int i, String? word) {
return Card(
elevation: 6,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
color: Colors.white,
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"$word",
style: const TextStyle(fontWeight: FontWeight.w600, fontSize: 40),
key: Key("word$i"),
)
],
),
), // this line
);
}
Please see above code, How can we retrieve the text word from above code. I am not able to find value by using function findByKeyValue method. Can you elaborate on that?
@ashwithpoojary98 we can able to do that. Thanks. I am closing this issue.
Hello @ashwithpoojary98 How can we retrieve text element from card widget because whenever i am trying that way, server says Type Card is currently not supported by getText. have you any idea? and How can we assign keys in flutter application so we can easily access flutter widgets? Is there any another way? I am simply giving keys to widgets by using key attribute of widget.