我有一个 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) 我想在读取 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)