使用向导从 Android Studio 创建了一个新的 Flutter 项目。
新创建的项目文件夹在 ios 目录中没有任何 Pods 文件夹或 podfile。
这个 Flutter.io页面指出(强调我的):
虽然 Flutter 项目的 iOS 文件夹中有一个 Podfile,但只有在添加每个平台集成所需的本机依赖项时才使用它。
我的 ios 目录中根本没有 podfile。
我在一个不同的问题中发现了这条评论,建议在 ios 模拟器上运行项目会生成文件,但在 sim 和设备上运行项目都不会为我创建任何 podfile。
我错过了新的 flutter 项目创建的 ios 方面的某些步骤吗?如果没有 podfile,我就无法添加特定于 ios 的依赖项。
的输出flutter doctor:
[?] Flutter (Channel beta, v0.5.1, on Mac OS X 10.12.6 16G1408, locale en-US)
[?] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[?] iOS toolchain - develop for iOS devices (Xcode 9.2) …Run Code Online (Sandbox Code Playgroud) 我的 Scaffold 有深色背景色。
我正在使用showCupertinoModalPopup,CupertinoActionSheet和CupertinoActionSheetAction用作孩子。
在模拟器中,操作表如下所示:
.
当我在我的实际 iphone 上运行该应用程序时,它看起来像这样:

模拟中的操作表项目看起来是正确的。外观非常白。
但是,在设备上,在设备上更加透明,因此更难看到。
两个都 CupertinoActionSheet并CupertinoActionSheetAction没有颜色或透明度级属性
关于这里发生了什么的任何想法?
颤振医生:
Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel beta, v0.11.7, on Mac OS X 10.13.6 17G65, locale en-US)
[?] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[?] iOS toolchain - develop for iOS devices (Xcode 10.1)
[?] Android Studio (version 3.2)
[?] VS Code (version 1.29.0)
[?] Connected …Run Code Online (Sandbox Code Playgroud) 尝试使用 RTK 查询进行简单的基本查询,并在使用 定义我的 api 后createApi(),当我尝试解构 api 以获得我的钩子时,Typescript 给出了错误。
然后,我从文档中复制粘贴了口袋妖怪示例代码,即使这样,它也说该钩子不存在。
显然我错过了一些东西。
这是直接从文档中提取的代码,但具有字符串返回类型:
export const pokemonApi = createApi({
reducerPath: 'pokemonApi',
baseQuery: fetchBaseQuery({ baseUrl: 'https://pokeapi.co/api/v2/' }),
endpoints: (builder) => ({
getPokemonByName: builder.query<string, string>({
query: (name) => `pokemon/${name}`,
}),
}),
})
export const { useGetPokemonByNameQuery } = pokemonApi;
Run Code Online (Sandbox Code Playgroud)
这useGetPokemonByNameQuery就是显示错误的原因:
Property 'useGetPokemonByNameQuery' does not exist on type 'Api<BaseQueryFn<string | FetchArgs, unknown, FetchBaseQueryError, {}, FetchBaseQueryMeta>, { getPokemonByName: QueryDefinition<...>; }, "pokemonApi", never, unique symbol>'.
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?