小编jin*_*yus的帖子

如何在没有 AppStore 的情况下构建 flutter iOS 应用

我为我和我的朋友制作了一个应用程序,我不打算在应用程序商店上发布它,为 Android 构建 apk 文件并将其发送给他们很容易,但有些人有 iPhone。是否可以在没有 Apple 开发帐户、macOS 和所有这些证书的情况下构建 IPA?

我会用 cydia Impactor 安装它,并租用 mac 服务器来进行构建是没有问题的。我读了 flutter.dev 上的帖子,但它对我想做的事情来说是压倒性的。

app-store ios dart flutter

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

从过去 2 年的 Python 中随机选择一个月份

我想在当前年份和 2016 年之间随机选择一个月份。这是我目前非常幼稚的解决方案

from random import choice
def get_month():
    return choice({'2018-06','2018-05','2018-04','2018-03'})
Run Code Online (Sandbox Code Playgroud)

很明显,这个集合在未来会变得太大,那么实现这一目标的更好方法是什么?

python random

4
推荐指数
1
解决办法
1260
查看次数

Python将redis对象转换为原始数据类型

我正在使用 redis-py,每当我在缓存中存储列表或字典时,运行 get 函数都会返回一个字符串。如何取回原始数据类型?

cache = redis.StrictRedis(host='localhost', port=6379, decode_responses=True)
cache.set("posts",[["bob","My first post"],["mary","My second post"]])

cache.get("post")
>>>"[["bob","My first post"],["mary","My second post"]]"
Run Code Online (Sandbox Code Playgroud)

这是我必须手动做的事情吗?

python redis

2
推荐指数
1
解决办法
2218
查看次数

在网格视图的中心底部显示小部件

我有一个 2/3 列的网格视图,当用户滚动到最后时,我想在网格的底部中心显示一个加载指示器。添加加载指示器作为网格的最后一个元素看起来不太好,因为它没有居中。这可能吗?

代码片段:

GridView.builder(
  gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
      crossAxisCount: 2, childAspectRatio: 480 / 315),
  controller: controller,
  itemCount: videos.length + 1,
  itemBuilder: (context, index) {
    if (index == videos.length) {
      //show loading indicator at last index
      return SpinKitThreeBounce(
               color: Colors.white,
               size: 35.0,
            );
    }
    return VideoItem(video: videos[index]);
  },
);
Run Code Online (Sandbox Code Playgroud)

我拥有的:

在此处输入图片说明

我想要的是:

在此处输入图片说明

dart flutter flutter-layout

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

在项目文件夹之外运行 dart 脚本

我正在尝试用 dart 替换 python 作为我的工具的脚本语言。我可以在任何地方创建一个 python 文件,导入全局包并运行它,但我似乎无法使用 dart 来实现它。我是否总是需要 pubspec.yaml 文件来运行 dart 脚本?

这是我试图运行的脚本:

import 'package:http/http.dart' as http;

main(List<String> args) async{
  var res = await http.get('https://example.com');
  print(res.headers);
}
Run Code Online (Sandbox Code Playgroud)

这是我收到的错误:

Error: Could not resolve the package 'http' in 'package:http/http.dart'.
test2.dart:1:8: Error: Not found: 'package:http/http.dart'
import 'package:http/http.dart' as http;
       ^
test2.dart:4:19: Error: Method not found: 'get'.
  var res = await http.get('https://example.com');
Run Code Online (Sandbox Code Playgroud)

dart

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

标签 统计

dart ×3

flutter ×2

python ×2

app-store ×1

flutter-layout ×1

ios ×1

random ×1

redis ×1