s.j
s.j

Reputation: 651

how to set text clickable getting error of recognizer in flutter

how to set text clickable getting error of recognizer in flutter --

Expanded(child: Text(BasicAction.formatDate(data.dataList[index].payDate), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: UtilColors.darkGrey))),
                  Padding(
                    padding: EdgeInsets.all(4),
                    child: Text('Edit', recognizer: _recognizer, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: UtilColors.blueColor)),

Upvotes: 0

Views: 982

Answers (1)

Raine Dale Holgado
Raine Dale Holgado

Reputation: 3460

Try this

            GestureDetector(
              onTap: () {
                print("Pressed");
              },
              child: Text("GestureDetector"),
            ),
            InkWell(
              onTap: () {
                print("Pressed");
              },
              child: Text("InkWell"),
            ),
            RichText(
              text: TextSpan(
                recognizer: new TapGestureRecognizer()
                  ..onTap = () {
                    print("Pressed");
                  },
                text: "RichText",
              ),
            )

Upvotes: 1

Related Questions