flutter开发实战-手势Gesture与ListView滚动竞技场的可滑动关闭组件

news2024/9/22 5:21:52

flutter开发实战-手势Gesture与ListView滚动竞技场的可滑动关闭组件

最近看到了一个插件,实现一个可滑动关闭组件。滑动关闭组件即手指向下滑动,组件随手指移动,当移动一定位置时候,手指抬起后组件滑出屏幕。

一、GestureDetector嵌套Container非ListView

如果要可滑动关闭,则需要手势GestureDetector,GestureDetector这里实现了onVerticalDragDown、onVerticalDragUpdate、onVerticalDragEnd,通过手势,更新AnimatedContainer的高度。

@override
  Widget build(BuildContext context) {
    Size screenSize = MediaQuery.of(context).size;
    return Column(
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        GestureDetector(
          onVerticalDragDown: _onVerticalDragDown,
          onVerticalDragUpdate: _onVerticalDragUpdate,
          onVerticalDragEnd: _onVerticalDragEnd,
          child: AnimatedContainer(
            curve: Curves.easeOut,
            duration: Duration(milliseconds: 250),
            onEnd: () {
              _onAniPositionedEnd(context);
            },
            height: yBottomOffset + widget.displayHeight,
            width: screenSize.width,
            clipBehavior: Clip.hardEdge,
            decoration: const BoxDecoration(
              color: Colors.transparent,
            ),
            child: widget.child,
          ),
        ),
      ],
    );
  }
    

我们通过onVerticalDragUpdate来更新AnimatedContainer的高度height,

void _onVerticalDragUpdate(DragUpdateDetails details) {
    print("_onVerticalDragUpdate");
    if (details.delta.dy <= 0) {
      // 向上
      isDragDirectionUp = true;
    } else {
      // 向下
      isDragDirectionUp = false;
    }
    yBottomOffset -= details.delta.dy;
    if (yBottomOffset > 0.0) {
      yBottomOffset = 0.0;
    }

    if (yBottomOffset < -widget.displayHeight) {
      yBottomOffset = -widget.displayHeight;
    }
    setState(() {});
  }
    

当拖动手势结束之后,来检测是否是隐藏状态。

void _onVerticalDragEnd(DragEndDetails details) {
    print("_onVerticalDragEnd");
    if (yBottomOffset < -widget.displayHeight / 3) {
      // 隐藏移除
      yBottomOffset = -widget.displayHeight;
      isCompleteHide = true;
    } else {
      yBottomOffset = 0.0;
      isCompleteHide = false;
    }
    setState(() {

    });
  }
    

AnimatedContainer中有onEnd方法回调,当动画结束之后,在此方法回调中来处理是否pop等操作

void _onAniPositionedEnd(BuildContext context) {
    print("_onAniPositionedEnd");
    if (isCompleteHide) {
      // 隐藏了,则移除
      Navigator.of(context).pop();
    }
  }
    

DragBottomSheet2完整代码如下

import 'package:flutter/material.dart';

class DragBottomSheet2 extends StatefulWidget {
  const DragBottomSheet2({
    super.key,
    required this.child,
    required this.displayHeight,
  });

  // child
  final Widget child;

  // 展示的child高度
  final double displayHeight;

  @override
  State<DragBottomSheet2> createState() => _DragBottomSheet2State();
}

class _DragBottomSheet2State extends State<DragBottomSheet2> {
  bool? isDragDirectionUp;
  double yBottomOffset = 0.0;
  bool isCompleteHide = false;

  void _onVerticalDragDown(DragDownDetails details) {
    print("_onVerticalDragDown");
  }

  void _onVerticalDragUpdate(DragUpdateDetails details) {
    print("_onVerticalDragUpdate");
    if (details.delta.dy <= 0) {
      // 向上
      isDragDirectionUp = true;
    } else {
      // 向下
      isDragDirectionUp = false;
    }
    yBottomOffset -= details.delta.dy;
    if (yBottomOffset > 0.0) {
      yBottomOffset = 0.0;
    }

    if (yBottomOffset < -widget.displayHeight) {
      yBottomOffset = -widget.displayHeight;
    }
    setState(() {});
  }

  void _onVerticalDragEnd(DragEndDetails details) {
    print("_onVerticalDragEnd");
    if (yBottomOffset < -widget.displayHeight / 3) {
      // 隐藏移除
      yBottomOffset = -widget.displayHeight;
      isCompleteHide = true;
    } else {
      yBottomOffset = 0.0;
      isCompleteHide = false;
    }
    setState(() {});
  }

  void _onAniPositionedEnd(BuildContext context) {
    print("_onAniPositionedEnd");
    if (isCompleteHide) {
      // 隐藏了,则移除
      Navigator.of(context).pop();
    }
  }

  @override
  Widget build(BuildContext context) {
    Size screenSize = MediaQuery.of(context).size;
    return Column(
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        GestureDetector(
          onVerticalDragDown: _onVerticalDragDown,
          onVerticalDragUpdate: _onVerticalDragUpdate,
          onVerticalDragEnd: _onVerticalDragEnd,
          child: AnimatedContainer(
            curve: Curves.easeOut,
            duration: Duration(milliseconds: 250),
            onEnd: () {
              _onAniPositionedEnd(context);
            },
            height: yBottomOffset + widget.displayHeight,
            width: screenSize.width,
            clipBehavior: Clip.hardEdge,
            decoration: const BoxDecoration(
              color: Colors.transparent,
            ),
            child: widget.child,
          ),
        ),
      ],
    );
  }
}

    

点击按钮弹出bottomSheet2代码如下

void showBottomSheet2(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    double displayHeight = size.height - 88;
    showModalBottomSheet(
      context: context,
      isScrollControlled: true,
      builder: (ctx) {
        return DragBottomSheet2(
          displayHeight: displayHeight,
          child: Container(
            width: size.width,
            height: displayHeight,
            color: Colors.orangeAccent,
            child: Text(
              '内容',
              style: TextStyle(
                color: Colors.black,
              ),
            ),
          ),
        );
      },
    );
  }
    

效果图如下

在这里插入图片描述

二、GestureDetector嵌套ListView

GestureDetector嵌套ListView后,Flutter会根据竞技场Arena机制,通过一定逻辑选择一个组件胜出。
Flutter为了解决手势冲突问题,Flutter给开发者提供了一套解决方案。在该方案中,Flutter引入了Arena(竞技场)概念,然后把冲突的手势加入到Arena中并竞争,谁胜利,谁就获得手势的后续处理权。

Arena竞技场的原理请看https://juejin.cn/post/6874570159768633357

所以在GestureDetector嵌套ListView后,Flutter框架会将这些Gesture与ListView组件都加入竞技场,然后通过一定的逻辑选择一个组件胜出,通常同类组件嵌套时最内层的组件胜出,胜出的组件会处理接下来的move和up事件,其它组件则不会继续处理这些事件了。所以在GestureDetector嵌套ListView的场景中,由于是ListView最终胜出,所以后续的事件都交由ListView处理,而GestureDetector收不到后续的事件,也就不会响应用户的手势了。因此,我们解决这个问题的第一步就是要让GestureDetector在这种场景下也能收到后续的事件

参考请看https://zhuanlan.zhihu.com/p/680586251

我们需要根据GestureDetector真正处理用户手势事件的是内部的Recognizer,比如处理上下滑动的是VerticalDragGestureRecognizer而Recognizer在竞技场失败后也可以单方面宣布自己胜出这样即使在竞技场失败了,GestureDetector也能收到后续的手势事件
因此我们现定义一个单方面宣布胜出的Recognizer

class _MyVerticalDragGestureRecognizer extends VerticalDragGestureRecognizer {
  @override
  void rejectGesture(int pointer) {
    // 单方面宣布自己胜出
    acceptGesture(pointer);
  }
}
    

我们需要将Recognizer加入到GestureDetector中,会用到RawGestureDetector

RawGestureDetector(
      gestures: {
        _MyVerticalDragGestureRecognizer: GestureRecognizerFactoryWithHandlers<
                _MyVerticalDragGestureRecognizer>(
            () => _MyVerticalDragGestureRecognizer(),
            (_MyVerticalDragGestureRecognizer recognizer) {
          recognizer
            ..onStart = (DragStartDetails details) {
              
            }
            ..onUpdate = (DragUpdateDetails details) {
              
            }
            ..onEnd = (DragEndDetails details) {
             
            };
        }),
      },
      child: ...
    );
    

这时候当滚动ListView时候,也能收到手势事件了。

监听ListView的滚动,时候我们需要用到NotificationListener

 NotificationListener(  // 监听内部ListView的滑动变化
              onNotification: (ScrollNotification notification) {
                if (notification is OverscrollNotification && notification.overscroll < 0) {
                  // 用户向下滑动,ListView已经滑动到顶部,处理GestureDetector的滑动事件
                } else if (notification is ScrollUpdateNotification) {
                  // 用户在ListView中执行滑动动作,关闭外部GestureDetector的滑动处理
                } else {
                  
                }

                return false;
              },
              child:  //ListView
            ),
    

最后DragGestureBottomSheet完整代码如下

import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app_demolab/drag_sheet_controller.dart';

class DragGestureBottomSheet extends StatefulWidget {
  const DragGestureBottomSheet({
    super.key,
    required this.child,
    required this.displayHeight,
    this.duration = const Duration(milliseconds: 200),
    this.openDraggable = true,
    this.autoNavigatorPop = true,
    this.onShow,
    this.onHide,
  });

  // child
  final Widget child;

  // 展示的child高度
  final double displayHeight;

  // 拖动动画时长duration
  final Duration duration;

  // 是否需要拖动
  final bool openDraggable;

  // 是否需要自动pop
  final bool autoNavigatorPop;

  // This method will be executed when the solid bottom sheet is completely
  // opened.
  final void Function()? onShow;

  // This method will be executed when the solid bottom sheet is completely
  // closed.
  final void Function()? onHide;

  @override
  State<DragGestureBottomSheet> createState() => _DragGestureBottomSheetState();
}

class _DragGestureBottomSheetState extends State<DragGestureBottomSheet> {
  bool? isDragDirectionUp;
  double yBottomOffset = 0.0;
  bool isDraggable = false;
  bool isCompleteHide = false;

  DragSheetController? dragSheetController;

  @override
  void initState() {
    // TODO: implement initState
    dragSheetController = DragSheetController();
    dragSheetController?.dispatch(widget.displayHeight);
    super.initState();
  }

  @override
  void dispose() {
    // TODO: implement dispose
    dragSheetController?.dispose();
    super.dispose();
  }

  void _onVerticalDragUpdate(data) {
    if (widget.openDraggable) {
      print("data.delta.dy:${data.delta.dy}");
      if (data.delta.dy <= 0) {
        // 向上
        isDragDirectionUp = true;
      } else {
        // 向下
        isDragDirectionUp = false;
      }
      yBottomOffset -= data.delta.dy;
      if (yBottomOffset > 0.0) {
        yBottomOffset = 0.0;
      }

      if (yBottomOffset < -widget.displayHeight) {
        yBottomOffset = -widget.displayHeight;
      }

      double height = widget.displayHeight + yBottomOffset;
      dragSheetController?.dispatch(height);
    }

  }

  void _onVerticalDragEnd(data) {
    if (widget.openDraggable) {
      // 根据判断是否隐藏与显示
      if (false == isDragDirectionUp) {
        if (yBottomOffset < -widget.displayHeight / 3) {
          // 隐藏移除
          yBottomOffset = -widget.displayHeight;
          isCompleteHide = true;
        } else {
          yBottomOffset = 0.0;
          isCompleteHide = false;
        }
      } else {
        yBottomOffset = 0.0;
        isCompleteHide = false;
      }

      double height = widget.displayHeight + yBottomOffset;
      dragSheetController?.dispatch(height);
    }
  }

  void _onAniPositionedEnd(BuildContext context) {
    // 动画结束
    print("_onAniPositionedEnd");
    if (isCompleteHide) {
      // 隐藏,则调用hiden
      if (widget.onHide != null) {
        widget.onHide!.call();
      }
    } else {
      // 显示,则调用show
      if (widget.onShow != null) {
        widget.onShow!.call();
      }
    }

    if (isCompleteHide && widget.autoNavigatorPop) {
      // 隐藏了,则移除
      Navigator.of(context).pop();
    }
  }

  @override
  Widget build(BuildContext context) {
    Size screenSize = MediaQuery.of(context).size;
    return Column(
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        RawGestureDetector(
          gestures: {
            _MyVerticalDragGestureRecognizer:
                GestureRecognizerFactoryWithHandlers<
                        _MyVerticalDragGestureRecognizer>(
                    () => _MyVerticalDragGestureRecognizer(),
                    (_MyVerticalDragGestureRecognizer recognizer) {
              recognizer
                ..onStart = (DragStartDetails details) {}
                ..onUpdate = (DragUpdateDetails details) {
                  if (!isDraggable) {
                    return;
                  }
                  _onVerticalDragUpdate(details);
                }
                ..onEnd = (DragEndDetails details) {
                  _onVerticalDragEnd(details);
                };
            }),
          },
          child: StreamBuilder(
            stream: dragSheetController?.streamData,
            initialData: widget.displayHeight,
            builder: (_, snapshot) {
              return AnimatedContainer(
                curve: Curves.easeOut,
                duration: widget.duration,
                onEnd: () {
                  _onAniPositionedEnd(context);
                },
                height: snapshot.data,
                width: screenSize.width,
                clipBehavior: Clip.hardEdge,
                decoration: const BoxDecoration(
                  color: Colors.transparent,
                ),
                child: NotificationListener(
                  // 监听内部ListView的滑动变化
                  onNotification: (ScrollNotification notification) {
                    if (notification is OverscrollNotification &&
                        notification.overscroll < 0) {
                      // 用户向下滑动,ListView已经滑动到顶部,处理GestureDetector的滑动事件
                      isDraggable = true;
                    } else if (notification is ScrollUpdateNotification) {
                      // 用户在ListView中执行滑动动作,关闭外部GestureDetector的滑动处理
                      isDraggable = false;
                    } else {}

                    return false;
                  },
                  child: widget.child,
                ),
              );
            },
          ),
        )
      ],
    );
  }
}

class _MyVerticalDragGestureRecognizer extends VerticalDragGestureRecognizer {
  @override
  void rejectGesture(int pointer) {
    // 单方面宣布自己胜出
    acceptGesture(pointer);
  }
}

三、DragSheetController处理数据流

这里定义了DragSheetController来处理数据流,DragSheetController中包括streamController、subscription、streamSink、streamData

StreamBuilder是一个Widget,它依赖Stream来做异步数据获取刷新widget。
Stream是一种用于异步处理数据流的机制,它允许我们从一端发射一个事件,从另外一端去监听事件的变化.Stream类似于JavaScript中的Promise、Swift中的Future或Java中的RxJava,它们都是用来处理异步事件和数据的。Stream是一个抽象接口,我们可以通过StreamController接口可以方便使用Stream。

使用详情请查看https://brucegwo.blog.csdn.net/article/details/136232000

最后DragSheetController代码如下

import 'dart:async';

/// 处理Stream、StreamController相关逻辑
class DragSheetController  {
  StreamSubscription<double>? subscription;

  //创建StreamController
  StreamController<double>? streamController = StreamController<double>.broadcast();

  // 获取StreamSink用于发射事件
  StreamSink<double>? get streamSink => streamController?.sink;

  // 获取Stream用于监听
  Stream<double>? get streamData => streamController?.stream;

  // Adds new values to streams
  void dispatch(double value) {
    streamSink?.add(value);
  }

  // Closes streams
  void dispose() {
    streamSink?.close();
  }
}
    

通过DragSheetController,当拖动时候高度发生变化时候会调用dispatch方法,dispatch来发射数据流,DragGestureBottomSheet中通过StreamBuilder来调整AnimatedContainer的高度。

最后调用使用DragGestureBottomSheet

我们使用showModalBottomSheet展示DragGestureBottomSheet时候

// 显示底部弹窗
  void showCustomBottomSheet(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    double displayHeight = size.height - 88;
    showModalBottomSheet(
      context: context,
      isScrollControlled: true,
      builder: (ctx) {
        return DragGestureBottomSheet(
          displayHeight: displayHeight,
          autoNavigatorPop: true,
          openDraggable: true,
          onHide: () {
            print("onHide");
          },
          onShow: () {
            print("onShow");
          },
          child: Container(
            width: size.width,
            height: displayHeight,
            color: Colors.white,
            child: ScrollConfiguration(
              behavior: NoIndicatorScrollBehavior(),
              child: ListView.builder(
                itemCount: 20,
                physics: ClampingScrollPhysics(),
                itemBuilder: (context, index) {
                  return GestureDetector(
                    child: Container(
                      width: size.width,
                      height: 100,
                      decoration: BoxDecoration(
                        color: Colors.transparent,
                        border: Border.all(
                          color: Colors.black12,
                          width: 0.25,
                          style: BorderStyle.solid,
                        ),
                      ),
                      child: Column(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Text('index -- $index'),
                          SizedBox(
                            width: 50,
                            child: ClipOval(
                                child:
                                    Image.asset("assets/images/hero_test.png")),
                          ),
                        ],
                      ),
                    ),
                    onTap: () {
                      Navigator.of(context).push(
                          CupertinoPageRoute(builder: (BuildContext context) {
                        return HeroPage();
                      }));
                    },
                  );
                },
              ),
            ),
          ),
        );
      },
    );
  }
    

效果图如下

在这里插入图片描述

https://brucegwo.blog.csdn.net/article/details/136241765

四、小结

flutter开发实战-手势Gesture与ListView滚动竞技场的可滑动关闭组件

学习记录,每天不停进步。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1464474.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

数据安全治理实践路线(上)

基于以上数据安全治理实践理念&#xff0c;可以按照自顶向下和自底向上相结合的思路推进实践过程。一方面&#xff0c;组织自顶向下,以数据安全战略规划为指导,以规划、建设、运营、优化为主线&#xff0c;围绕构建数据安全治理体系这一核心&#xff0c;从组织架构、制度流程、…

这份攻略帮助你分分钟构建出“幻兽帕鲁游戏”极致体验【下】

在上一篇文章这份攻略帮助你分分钟构建出“幻兽帕鲁游戏”极致体验【上】中写了&#xff0c;极狐GitLab 将 terraform state 文件管理了起来。这篇文章将演示如何将所有的 terraform 文件存储到极狐GitLab 中&#xff0c;并且使用 CI/CD 自动实现 terraform 命令的执行。 在 D…

HGAME week2 web

1.What the cow say? 测试发现可以反引号命令执行 ls /f* tac /f*/f* 2.myflask import pickle import base64 from flask import Flask, session, request, send_file from datetime import datetime from pytz import timezonecurrentDateAndTime datetime.now(timezone(…

在word中将latex格式的公式转化为带有编号的mathtype公式

在word中将latex格式的公式转化为带有编号的mathtype公式 1.先在word里面配置好mathtype2.在word中设置mathtype的格式3.先将latex格式的公式转化为mathml格式4.读到这里&#xff0c;是不是觉得这个方法麻烦 1.先在word里面配置好mathtype 注意&#xff1a;1.word的版本应该是 …

关于运行flutter app 运行到模拟器出现异常提示

Exception: Gradle task assembleDebug failed with exit code 1 解决方案&#xff1a; 1.讲当前文件的distributionUrl值改为 https://mirrors.cloud.tencent.com/gradle/gradle-7.4-all.zip

Codeforces Round 928 (Div. 4)

目录 A. Vlad and the Best of Five B. Vlad and Shapes C. Vlad and a Sum of Sum of Digits D. Vlad and Division E. Vlad and an Odd Ordering F. Vlad and Avoiding X G. Vlad and Trouble at MIT A. Vlad and the Best of Five 我们可以使用string中的count函数来…

cmd命令开启windows桌面远程控制并设置防火墙允许远程

cmd命令开启桌面远程控制 1、开启之前&#xff1a; 2、使用管理员身份运行cmd 3、执行cmd命令 reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlset\Control\Terminal server" /v fDenyTSConnections /t REG_DWORD /d 0 /f4、如果这台电脑的防火墙打开&#xff…

#LLM入门|Prompt#1.8_聊天机器人_Chatbot

聊天机器人设计 以会话形式进行交互&#xff0c;接受一系列消息作为输入&#xff0c;并返回模型生成的消息作为输出。原本设计用于简便多轮对话&#xff0c;但同样适用于单轮任务。 设计思路 个性化特性&#xff1a;通过定制模型的训练数据和参数&#xff0c;使机器人拥有特…

Redis中的AOF重写到底是怎么一回事

首先我们知道AOF和RDB都是Redis持久化的方法。RDB是Redis DB&#xff0c;一种二进制数据格式&#xff0c;这样就是相当于全量保存数据快照了。AOF则是保存命令&#xff0c;然后恢复的时候重放命令。 AOF随着时间推移&#xff0c;会越来越大&#xff0c;因为不断往里追加命令。…

WooCommerce商品采集与发布插件

如何采集商品或产品信息&#xff0c;并自动发布到Wordpress系统的WooCommerce商品&#xff1f; 推荐使用简数采集器&#xff0c;操作简单方便&#xff0c;且无缝衔接WooCommerce插件&#xff0c;快速完成商品的采集与发布。 简数采集器的智能自动生成采集规则和可视化操作功能…

Linux第62步_备份移植好的所有的文件和文件夹

1、备份“my-tfa”目录下所有的文件和文件夹 1)、打开终端 输入“ls回车”&#xff0c;列出当前目录下所有的文件和文件夹 输入“cd linux回车”&#xff0c;切换“linux”目录下 输入“ls回车”&#xff0c;列出当前目录下所有的文件和文件夹 输入“cd atk-mp1/回车”&am…

Nginx -2

接着上文写 5.4.7 验证模块 需要输入用户名和密码 模块名称&#xff1a;ngx_http_auth_basic_module 访问控制基于模块 ngx_http_auth_basic_module 实现&#xff0c;可以通过匹配客户端资源进行限制 语法&#xff1a; Syntax: auth_basic string | off; Default: auth_ba…

React 模态框的设计(二)

自定义组件是每个前端开发者必备的技能。我们在使用现有框架时难免有一些超乎框架以处的特别的需求&#xff0c;比如关于弹窗&#xff0c;每个应用都会用到&#xff0c;但是有时我们使用的框架中提供的弹窗功能也是功能有限&#xff0c;无法满足我们的应用需求&#xff0c;今天…

wondows10用Electron打包threejs的项目记录

背景 电脑是用的mac&#xff0c;安装了parallels desktop ,想用electron 想同时打包出 苹果版本和windows版本。因为是在虚拟机里安装&#xff0c;它常被我重装&#xff0c;所以记录一下打包的整个过程。另外就是node生态太活跃&#xff0c;几个依赖没记录具体版本&#xff0…

【开源】SpringBoot框架开发音乐平台

目录 一、摘要1.1 项目介绍1.2 项目录屏 二、功能模块三、系统展示 四、核心代码4.1 查询单首音乐4.2 新增音乐4.3 新增音乐订单4.4 查询音乐订单4.5 新增音乐收藏 五、免责说明 一、摘要 1.1 项目介绍 基于微信小程序JAVAVueSpringBootMySQL的音乐平台&#xff0c;包含了音乐…

如何在java中使用 Excel 动态函数生成依赖列表

前言 在Excel 中&#xff0c;依赖列表或级联下拉列表表示两个或多个列表&#xff0c;其中一个列表的项根据另一个列表而变化。依赖列表通常用于Excel的业务报告&#xff0c;例如学术记分卡中的【班级-学生】列表、区域销售报告中的【区域-国家/地区】列表、人口仪表板中的【年…

Leetcoder Day17| 二叉树 part06

语言&#xff1a;Java/C 654.最大二叉树 给定一个不含重复元素的整数数组。一个以此数组构建的最大二叉树定义如下&#xff1a; 二叉树的根是数组中的最大元素。左子树是通过数组中最大值左边部分构造出的最大二叉树。右子树是通过数组中最大值右边部分构造出的最大二叉树。 …

petalinux_zynq7 驱动DAC以及ADC模块之六:qt显示adc波形

前文&#xff1a; petalinux_zynq7 C语言驱动DAC以及ADC模块之一&#xff1a;建立IPhttps://blog.csdn.net/qq_27158179/article/details/136234296petalinux_zynq7 C语言驱动DAC以及ADC模块之二&#xff1a;petalinuxhttps://blog.csdn.net/qq_27158179/article/details/1362…

C# .Net 发布后,把dll全部放在一个文件夹中,让软件目录更整洁

PublishFolderCleaner – Github 测试环境: .Net 8 Program.cs 代码 // https://github.com/dotnet-campus/dotnetcampus.DotNETBuildSDK/tree/master/PublishFolderCleanerusing System.Diagnostics; using System.Text;// 名称, 不用写 .exe var exeName "AbpDemo&…