小编cam*_*leB的帖子

如何在Flutter中创建服务以使应用始终在后台运行?

我想使Flutter应用程序始终在后台运行。使用android,我们必须创建一个始终在后台运行的服务。在Flutter文档中找不到关于服务的任何信息。

Flutter可以做这种事情吗?

service dart flutter

11
推荐指数
4
解决办法
2万
查看次数

如何从 Apache 调用 shell 脚本?

我想显示由 Apache 调用的 shell 脚本生成的“Hello from shell”。

为此,我在 /usr/lib/cgi-bin/ 文件夹中创建了一个脚本 test.sh。在这个文件中我写道:

#!/bin/bash
# get today's date
OUTPUT="$(date)"
# You must add following two lines before
# outputting data to the web browser from shell
# script
 echo "Content-type: text/html"
 echo ""
 echo "<html><head><title>Demo</title></head><body>"
 echo "Today is $OUTPUT <br>"
 echo "Current directory is $(pwd) <br>"
 echo "Shell Script name is $0"
 echo "</body></html>"
Run Code Online (Sandbox Code Playgroud)

我的 Apache (apache2.conf) 配置是:

# Sets the default security model of the Apache2 HTTPD server. It does
# …
Run Code Online (Sandbox Code Playgroud)

linux apache bash shell

5
推荐指数
1
解决办法
1万
查看次数

Flutter:未处理的异常:MissingPluginException(在通道plugins.flutter.io/shared_preferences上未找到方法getAll的实现)

我的Flutter应用程序使用Flutter SharedPreferences插件,并通过platform.invokeMethod将值发送到iOS端。如果我启动应用程序,则出现此错误:

[VERBOSE-2:dart_error.cc(16)] Unhandled exception:
MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
#0      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
<asynchronous suspension>
#1      SharedPreferences.getInstance (package:shared_preferences/shared_preferences.dart:25:27)
<asynchronous suspension>
#2      main (file:///Users/Developer/workspace/flutter-app/q_flutter2/lib/main.dart:25:53)
<asynchronous suspension>
#3      _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:279:19)
#4      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
Run Code Online (Sandbox Code Playgroud)

如果我注释了将值发送到iOS端的函数,则不会显示错误,并且SharedPreferences可以正常工作。

有人可以帮我吗?

sharedpreferences ios flutter

4
推荐指数
14
解决办法
5044
查看次数

标签 统计

flutter ×2

apache ×1

bash ×1

dart ×1

ios ×1

linux ×1

service ×1

sharedpreferences ×1

shell ×1