我正在尝试将多个参数传递给命名路由。我尝试了多种方法,但到目前为止还没有成功。谁能告诉我如何实现这一目标?
路线.dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:brandcare/views/pdf_view.dart';
import 'package:brandcare/views/reports_view.dart';
class RouteGenerator {
static Route<dynamic> generateRoute(RouteSettings settings) {
final args = settings.arguments;
switch (settings.name) {
case 'reports':
return CupertinoPageRoute(builder: (BuildContext context) => ReportsView());
case 'pdf':
return CupertinoPageRoute(builder: (BuildContext context) => PDFView());
default:
return CupertinoPageRoute(builder: (BuildContext context) => DashboardView());
}
}
}
Run Code Online (Sandbox Code Playgroud)
列表项上的 Ontap 事件 reports_view.dart
onTap: () {
Navigator.pushNamed(
context, 'pdf',
arguments: PDFView(
reportTitle: 'January Report',
reportFullPath: 'https://static.example.com/reports/123456.pdf'
)
);
},
Run Code Online (Sandbox Code Playgroud)
我想访问多个参数的页面
pdf_view.dart
class PDFView extends StatefulWidget {
final String …
Run Code Online (Sandbox Code Playgroud) 我正在尝试建立一个 Dart 项目来使用Shelf。现在为了启用热重载,我正在尝试安装dartman。关于做
pub global activate dartman
Run Code Online (Sandbox Code Playgroud)
未找到命令“pub”,您的意思是:
我尝试的
dart pub global activate dartman
Run Code Online (Sandbox Code Playgroud)
我收到错误:读取“pub”时出错:没有这样的文件或目录
我该如何解决这个问题?
我正在尝试使用 Google Apps 脚本发送电子邮件。
\n// try 1\nconst subject = \'Hello World \';\n\n// try 2\nconst subject = \'Hello World \' + String.fromCodePoint(\'0x1F600\');\n\nGmailApp.sendEmail(\n \'abc@gmail.com\', subject, \'\',\n {htmlBody: \'<p>Hello World </p>\', name: \'ABC\'}\n);\n
Run Code Online (Sandbox Code Playgroud)\n当我使用 \xe2\xad\x90 时,它在主题和 HTML 正文中都能完美运行。但是,当我使用 时,它在主题和 HTML 正文中显示带有问号的黑色菱形。
\n我还检查了如何将表情符号插入使用 GmailApp 发送的电子邮件中?但它只展示了如何在电子邮件正文中使用它,而不是主题。
\n我尝试过使用 MailApp 并且它有效,但由于某些原因我不想使用它。
\n关于如何解决这个问题有什么想法吗?
\n