Open originlan opened 4 years ago
Widget getListView() { return Container( height: 450.0, width: double.infinity, color: Colors.white, child: Column( children: [ Container( child: Image.asset( "assets/images/note_listbar.png", width: double.infinity, height: 50, fit: BoxFit.fill, ), width: double.infinity, ), Container( margin: EdgeInsets.only(left: 15, right: 15, bottom: 10), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "想法", style: TextStyle(fontSize: 18, color: SelectionColor.TitleColor), ), Row( children: [ GestureDetector( //这个事件 onTap: () { Routes.router.navigateTo(context, "${Routes.notesEdit}?fromByWho=addActicleNote&articleId=${articleDetail.data.id}&albumId=${widget.albumId}"); }, child: ExtendedText.rich(TextSpan(children: [ WidgetSpan( child: Container( margin: EdgeInsets.only(right: 5), child: Image.asset( "assets/images/write_note.png", width: 18, height: 18, ))), TextSpan( text: "写想法", style: TextStyle( fontSize: 14, color: SelectionColor.Blue_2B8CFE)) ])), ), GestureDetector( //这个事件 onTap: () { showModalBottomSheet( context: context, builder: (BuildContext context) { return Container( child: new ShareListView( articleID: widget.articleId, ), ); }); }, child: ExtendedText.rich(TextSpan(children: [ WidgetSpan( child: Container( margin: EdgeInsets.only(right: 5, left: 18), child: Image.asset( "assets/images/share_article.png", width: 18, height: 18, ))), TextSpan( text: "分享", style: TextStyle( fontSize: 14, color: SelectionColor.Blue_2B8CFE)) ])), ), ], ) ], ), ), Expanded(child: newListView()) //这个是list ], ), ); }
@override void handleEvent(PointerEvent event) { super.handleEvent(event); if (!event.synthesized && (event is PointerDownEvent || event is PointerMoveEvent)) { final VelocityTracker tracker = _velocityTrackers[event.pointer]; assert(tracker != null); tracker.addPosition(event.timeStamp, event.position); } }
在使用BottomDragWidget中 drawer: getListView()的widget里面有两个独立的gesturedetector,抽屉没有拉起来之前,这个手势不生效,目前分析是事件穿透了,需要阻止事件单独处理
事件会走MyVerticalDragGestureRecognizer
应该这个理冲突了,已经尝试过去掉或者分开写手势但是不生效,最后竞技场还是会被clean