我在我的一个 flutter 应用程序中遇到了问题。我正在使用 MapBox-SDK 插件,但是当我在 IOS 上测试该应用程序时,它要求我将 Mapbox-sdk 更新到某个版本(我使用 pop install 命令执行此操作)。现在,在一切之后,我在 info.plist 文件中面临新的错误。我忘记备份旧的 info.plist 文件。\n无论如何,新的 info.plist 是:
\n\n<plist version="1.0">\n<dict>\n<string>YES</string>\n<key>io.flutter.embedded_views_preview</key>\n<true/>\n<key>MGLMapboxAccessToken</key>\n<string>Mapbox-key-not-visible</string>\n<true/>\n<key>NSLocationWhenInUseUsageDescription</key>\n<key>NSLocationAlwaysUsageDescription</key>\n<key>NSPhotoLibraryUsageDescription</key>\n<key>NSCameraUsageDescription</key>\n<key>NSMicrophoneUsageDescription</key>\n<string>This app needs access to location when open.</string>\n<key>CFBundleDevelopmentRegion</key>\n<string>$(DEVELOPMENT_LANGUAGE)</string>\n<key>CFBundleExecutable</key>\n<string>$(EXECUTABLE_NAME)</string>\n<key>CFBundleIdentifier</key>\n<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n<key>CFBundleInfoDictionaryVersion</key>\n<string>6.0</string>\n<key>CFBundleName</key>\n<string>project1</string>\n<key>CFBundlePackageType</key> \n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n<string>$(FLUTTER_BUILD_NAME)</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n<string>$(FLUTTER_BUILD_NUMBER)</string>\n<key>LSRequiresIPhoneOS</key>\n<true/>\n<key>UILaunchStoryboardName</key>\n<string>LaunchScreen</string>\n<key>UIMainStoryboardFile</key>\n<string>Main</string>\n<key>UISupportedInterfaceOrientations</key>\n<array>\n <string>UIInterfaceOrientationPortrait</string>\n <string>UIInterfaceOrientationLandscapeLeft</string>\n <string>UIInterfaceOrientationLandscapeRight</string>\n</array>\n<key>UISupportedInterfaceOrientations~ipad</key>\n<array>\n <string>UIInterfaceOrientationPortrait</string>\n <string>UIInterfaceOrientationPortraitUpsideDown</string>\n <string>UIInterfaceOrientationLandscapeLeft</string>\n <string>UIInterfaceOrientationLandscapeRight</string>\n</array>\n<key>UIViewControllerBasedStatusBarAppearance</key>\n<false/>\n</dict>\n</plist\nRun Code Online (Sandbox Code Playgroud)\n\n我在构建应用程序时面临的错误是:
\n\n错误:
\n\nUsers/apple/flutter-practice/Project-Casky/casky/ios/Runner/Info.plist: Property List error: Found non-key inside <dict> at line 10 / JSON error: JSON text did not start with array or object and option to allow fragments not set.\nXcode build done. 24.2s\nFailed to build iOS app\nError output from …Run Code Online (Sandbox Code Playgroud) 我是新来的。我被困在一个地方,找不到确切的解决方案。
我有一个 BottomNavigationBar,其中有一个需要用户输入的文本字段。当我单击文本字段时,键盘会覆盖整个半屏,文本字段隐藏在键盘后面,看不到。我想将文本字段移动到键盘上方,以便为用户提供更好的用户界面。
这是底部导航栏代码:
Widget build(BuildContext context) {
return Container(
color: Colors.grey[200],
height: 70,
child: Row(
children: <Widget>[
SizedBox(
height: MediaQuery.of(context).viewInsets.bottom,
),
Container(
width: MediaQuery.of(context).size.width * 0.6,
color: Colors.transparent,
margin: EdgeInsets.fromLTRB(40, 0, 0, 0),
child: TextField( //this is the TextField
style: TextStyle(
fontSize: 30,
fontFamily: 'Karla',
),
decoration: InputDecoration.collapsed(
hintText: 'Experimez-vous...',
hintStyle: TextStyle(color: Colors.black),
),
),
),
],
),
);
Run Code Online (Sandbox Code Playgroud)
这是主体(脚手架),我从以下位置调用它:
return Scaffold(
body: Column(
children: <Widget>[
CloseButtonScreen(),
Container(
color: Colors.transparent,
child: HeaderContent(),
),
ContainerListItems(),
],
),
bottomNavigationBar: BottomNavBar(), //this …Run Code Online (Sandbox Code Playgroud)