flutter - 如何使用颤振访问用户的日历设备
问题描述
我正在编写一个简单的应用程序来测试可以访问用户设备日历的包的功能。到目前为止我做了什么:
class CalendarEvents extends StatelessWidget {
final CalendarPlugin _myPlugin = CalendarPlugin();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
'Calendar Testing',
style: TextStyle(color: Colors.black),
),
backgroundColor: TheBaseColors.lightGreen,
),
body: Center(
child: RaisedButton(
onPressed: () {
_myPlugin.hasPermissions().then((value) {
if (!value) {
_myPlugin.requestPermissions();
} else {
Text('We dont have permissions');
}
});
},
child: Text('Calendar'),
),
),
);
}
}
我还添加了 android 的权限。我需要做的是访问日历设备。知道怎么做吗?
解决方案
推荐阅读
- spring-boot - Spring Boot - 多数据源配置
- sql-server - 从 ASPStateTempSessions 数据库表中反序列化 Session 变量
- javascript - Vue - 来自外部 TypeScript 类的动态属性不是响应式的
- apache-kafka - KafkaStreams处理保证exact_once和exact_once_beta的区别
- javascript - 不工作在 React 中单击向左或向右滚动产品
- python - 如何在列表中找到数字最大的项目,然后将数字添加到相应的列表中?
- c++ - 写入指针位置时避免堆栈损坏
- openshift - “OKD 3.11 与主服务器的连接被拒绝 - 您是否指定了正确的主机或端口?”
- python - Seaborn countplot:在单独的df上为每个变量名使用相同的颜色
- excel - VBA Excel在循环时自动增加字符串值