From 5b4ff92138864b6f39e0cbe8942413c1ef5022e8 Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Tue, 12 Feb 2019 00:31:06 +0800 Subject: [PATCH] fix: event item tapable revert --- lib/utils/utils.dart | 20 +++++----- lib/widgets/event_item.dart | 75 ++++++++++++++++++------------------- 2 files changed, 46 insertions(+), 49 deletions(-) diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index c812026..6085051 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -126,16 +126,16 @@ TextSpan createLinkSpan(BuildContext context, String text, Function handle) { fontWeight: FontWeight.w600, // decoration: TextDecoration.underline, ), - // recognizer: TapGestureRecognizer() - // ..onTap = () { - // Navigator.of(context).push( - // CupertinoPageRoute( - // builder: (context) { - // return handle(); - // }, - // ), - // ); - // }, + recognizer: TapGestureRecognizer() + ..onTap = () { + Navigator.of(context).push( + CupertinoPageRoute( + builder: (context) { + return handle(); + }, + ), + ); + }, ); } diff --git a/lib/widgets/event_item.dart b/lib/widgets/event_item.dart index 71e750c..3d6cd43 100644 --- a/lib/widgets/event_item.dart +++ b/lib/widgets/event_item.dart @@ -66,48 +66,45 @@ class EventItem extends StatelessWidget { ]; _spans.addAll(spans); - return Link( - screenBuilder: screenBuilder, - child: Container( - padding: EdgeInsets.all(8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Avatar(login: event.actorLogin, url: event.actorAvatarUrl), - Padding(padding: EdgeInsets.only(left: 10)), - Expanded( - child: RichText( - text: TextSpan( - style: TextStyle( - color: Colors.black, height: 1.3, fontSize: 15), - children: _spans, - ), + return Container( + padding: EdgeInsets.all(8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Avatar(login: event.actorLogin, url: event.actorAvatarUrl), + Padding(padding: EdgeInsets.only(left: 10)), + Expanded( + child: RichText( + text: TextSpan( + style: TextStyle( + color: Colors.black, height: 1.3, fontSize: 15), + children: _spans, ), ), - Padding(padding: EdgeInsets.only(left: 8)), - Icon(iconData, color: Colors.black45, size: 22), - ], - ), - detail == null - ? Container() - : Container( - padding: EdgeInsets.only(left: 46, top: 6), - child: Text( - detail, - overflow: TextOverflow.ellipsis, - maxLines: 3, - style: TextStyle( - color: Colors.black87, - fontSize: 14, - height: 1.2, - fontWeight: FontWeight.w300, - ), + ), + Padding(padding: EdgeInsets.only(left: 8)), + Icon(iconData, color: Colors.black45, size: 22), + ], + ), + detail == null + ? Container() + : Container( + padding: EdgeInsets.only(left: 46, top: 6), + child: Text( + detail, + overflow: TextOverflow.ellipsis, + maxLines: 3, + style: TextStyle( + color: Colors.black87, + fontSize: 14, + height: 1.2, + fontWeight: FontWeight.w300, ), - ) - ], - ), + ), + ) + ], ), ); }