小编Bor*_*ayi的帖子

GitHub Action 无法从私有 GitHub 存储库获取 pub 包

我有一个 flutter 项目,它依赖于 GitHub 上的私有存储库,例如:

dependencies:
  flutter:
    sdk: flutter

  my_package:
    git:
      url: git@github.com:username/my_package.git
      ref: main
Run Code Online (Sandbox Code Playgroud)

当我flutter pub get在本地计算机上运行时,一切正常,因为我的计算机通过 SSH 对拥有存储库的 GitHub 帐户进行身份验证,但是一旦我尝试从 GitHub Action 运行它,它就会失败并显示以下消息:

git@github.com: Permission denied (publickey)
Run Code Online (Sandbox Code Playgroud)

那么如何正确、安全地让构建机器有权获取存储库呢?

以下是 GitHub 操作工作流程:

git@github.com: Permission denied (publickey)
Run Code Online (Sandbox Code Playgroud)

github dart flutter github-actions private-repository

6
推荐指数
1
解决办法
2952
查看次数

如何在颤振中的降价中向文本添加超链接

我想在读取 Markdown 小部件的屏幕底部添加一个超链接。我试图在 Markdown 文件中包含超链接,但 flutter 没有启动它。

然后我尝试了这个:

Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Protective measures'),
      ),
      body: Column(
        children: <Widget>[
          Flexible(
            child: FutureBuilder(
              future: DefaultAssetBundle.of(context)
                  .loadString("assets/docs/protective_measures.md"),
              builder:
                  (BuildContext context, AsyncSnapshot<String> snapshot) {
                if (snapshot.hasData) {
                  return Markdown(
                    data: snapshot.data,
                    styleSheet: MarkdownStyleSheet(
                      textAlign: WrapAlignment.start,
                      p: TextStyle(
                        fontSize: 16,
                        color: isDark ? Colors.white : Colors.black,
                      ),
                      h2: TextStyle(
                        fontSize: 20,
                        fontWeight: FontWeight.bold,
                        color: isDark ? Colors.white : Colors.black,
                      ),
                      h1: TextStyle(
                        fontWeight: FontWeight.bold,
                        fontSize: 25,
                        color: isDark ? …
Run Code Online (Sandbox Code Playgroud)

markdown android ios dart flutter

3
推荐指数
1
解决办法
2104
查看次数