Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 2c134b4e
authored
2025-10-02 10:12:52 +0800
by
Administrator
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
为了ios的编译发布添加的配置
1 parent
40c4873d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
0 deletions
ios/Runner/Info.plist
lib/app.dart
pubspec.yaml
ios/Runner/Info.plist
View file @
2c134b4
...
...
@@ -45,5 +45,28 @@
<true/>
<key>
UIApplicationSupportsIndirectInputEvents
</key>
<true/>
<key>
NSAppTransportSecurity
</key>
<dict>
<key>
NSAllowsArbitraryLoads
</key>
<true/>
<key>
NSExceptionDomains
</key>
<dict>
<key>
dev.banxiaoer.net
</key>
<dict>
<key>
NSExceptionAllowsInsecureHTTPLoads
</key>
<true/>
<key>
NSIncludesSubdomains
</key>
<true/>
</dict>
</dict>
</dict>
<key>
io.flutter.embedded_views_preview
</key>
<true/>
<key>
NSPhotoLibraryUsageDescription
</key>
<string>
需要访问相册选择图片或视频
</string>
<key>
NSCameraUsageDescription
</key>
<string>
需要访问相机
</string>
<key>
NSMicrophoneUsageDescription
</key>
<string>
需要麦克风权限用于录音
</string>
</dict>
</plist>
lib/app.dart
View file @
2c134b4
...
...
@@ -2,6 +2,7 @@ import 'dart:io';
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_localizations/flutter_localizations.dart'
;
// 添加这行
import
'config/routes.dart'
;
...
...
@@ -14,10 +15,30 @@ class App extends StatelessWidget {
routerConfig:
router
,
title:
'班小二'
,
theme:
const
CupertinoThemeData
(
primaryColor:
CupertinoColors
.
systemBlue
),
// === 为 iOS 添加本地化配置 ===
localizationsDelegates:
const
[
GlobalMaterialLocalizations
.
delegate
,
// 为Material组件提供本地化
GlobalCupertinoLocalizations
.
delegate
,
// 为Cupertino组件提供本地化
GlobalWidgetsLocalizations
.
delegate
,
// 定义文本方向等
],
supportedLocales:
const
[
Locale
(
'zh'
,
'CN'
),
// 中文(中国)
Locale
(
'en'
,
'US'
),
// 英语(美国)
],
)
:
MaterialApp
.
router
(
routerConfig:
router
,
title:
'班小二'
,
theme:
ThemeData
(
primarySwatch:
Colors
.
blue
),
// === 为 iOS 添加本地化配置 ===
localizationsDelegates:
const
[
GlobalMaterialLocalizations
.
delegate
,
// 为Material组件提供本地化
GlobalCupertinoLocalizations
.
delegate
,
// 为Cupertino组件提供本地化
GlobalWidgetsLocalizations
.
delegate
,
// 定义文本方向等
],
supportedLocales:
const
[
Locale
(
'zh'
,
'CN'
),
// 中文(中国)
Locale
(
'en'
,
'US'
),
// 英语(美国)
],
);
}
pubspec.yaml
View file @
2c134b4
...
...
@@ -30,6 +30,8 @@ environment:
dependencies
:
flutter
:
sdk
:
flutter
flutter_localizations
:
# 确保存在这一行
sdk
:
flutter
fluwx
:
^5.7.2
go_router
:
^16.2.1
flutter_bloc
:
^9.1.1
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment