Skip to content

Commit dead370

Browse files
committed
Merge branch 'dev'
2 parents ea103ac + f376fe9 commit dead370

37 files changed

+2093
-343
lines changed

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545
15BE2897D1518D9BDD5AF970 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
4646
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
4747
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
48-
3DB87B9B20AEA710C58FBCC8 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
49-
6F6754CA16FD7E3C9E4FCEB3 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
5048
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
5149
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
5250
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -60,7 +58,6 @@
6058
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6159
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6260
BEBBA521223FEA6600583D52 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
63-
C1D6F379F6B3C85C2CC34999 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
6461
D7BE9010C4F7FF033BA299B7 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
6562
FDCB5E5FC17434D1FF8247D2 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
6663
/* End PBXFileReference section */
@@ -192,6 +189,7 @@
192189
97C146ED1CF9000F007C117D = {
193190
CreatedOnToolsVersion = 7.3.1;
194191
DevelopmentTeam = 5K9P57YFSL;
192+
ProvisioningStyle = Automatic;
195193
};
196194
};
197195
};
@@ -200,6 +198,7 @@
200198
developmentRegion = English;
201199
hasScannedForEncodings = 0;
202200
knownRegions = (
201+
English,
203202
en,
204203
Base,
205204
);
@@ -281,15 +280,11 @@
281280
buildActionMask = 2147483647;
282281
files = (
283282
);
284-
inputFileListPaths = (
285-
);
286283
inputPaths = (
287284
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
288285
"${PODS_CONFIGURATION_BUILD_DIR}/flutter_downloader/FlutterDownloaderDatabase.bundle",
289286
);
290287
name = "[CP] Copy Pods Resources";
291-
outputFileListPaths = (
292-
);
293288
outputPaths = (
294289
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FlutterDownloaderDatabase.bundle",
295290
);
@@ -404,6 +399,8 @@
404399
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
405400
buildSettings = {
406401
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
402+
CODE_SIGN_IDENTITY = "iPhone Developer";
403+
CODE_SIGN_STYLE = Automatic;
407404
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
408405
DEVELOPMENT_TEAM = 5K9P57YFSL;
409406
ENABLE_BITCODE = NO;
@@ -417,8 +414,9 @@
417414
"$(inherited)",
418415
"$(PROJECT_DIR)/Flutter",
419416
);
420-
PRODUCT_BUNDLE_IDENTIFIER = com.flutter.beer;
417+
PRODUCT_BUNDLE_IDENTIFIER = com.flutterken.ui;
421418
PRODUCT_NAME = "$(TARGET_NAME)";
419+
PROVISIONING_PROFILE_SPECIFIER = "";
422420
VERSIONING_SYSTEM = "apple-generic";
423421
};
424422
name = Profile;
@@ -530,6 +528,8 @@
530528
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
531529
buildSettings = {
532530
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
531+
CODE_SIGN_IDENTITY = "iPhone Developer";
532+
CODE_SIGN_STYLE = Automatic;
533533
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
534534
DEVELOPMENT_TEAM = 5K9P57YFSL;
535535
ENABLE_BITCODE = NO;
@@ -543,8 +543,9 @@
543543
"$(inherited)",
544544
"$(PROJECT_DIR)/Flutter",
545545
);
546-
PRODUCT_BUNDLE_IDENTIFIER = com.flutter.beer;
546+
PRODUCT_BUNDLE_IDENTIFIER = com.flutterken.ui;
547547
PRODUCT_NAME = "$(TARGET_NAME)";
548+
PROVISIONING_PROFILE_SPECIFIER = "";
548549
VERSIONING_SYSTEM = "apple-generic";
549550
};
550551
name = Debug;
@@ -554,6 +555,8 @@
554555
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
555556
buildSettings = {
556557
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
558+
CODE_SIGN_IDENTITY = "iPhone Developer";
559+
CODE_SIGN_STYLE = Automatic;
557560
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
558561
DEVELOPMENT_TEAM = 5K9P57YFSL;
559562
ENABLE_BITCODE = NO;
@@ -567,8 +570,9 @@
567570
"$(inherited)",
568571
"$(PROJECT_DIR)/Flutter",
569572
);
570-
PRODUCT_BUNDLE_IDENTIFIER = com.flutter.beer;
573+
PRODUCT_BUNDLE_IDENTIFIER = com.flutterken.ui;
571574
PRODUCT_NAME = "$(TARGET_NAME)";
575+
PROVISIONING_PROFILE_SPECIFIER = "";
572576
VERSIONING_SYSTEM = "apple-generic";
573577
};
574578
name = Release;

lib/components/widget_comp.dart

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class IndexState extends State<Index> {
5050
backgroundImage: NetworkImage(
5151
info.avatarUrl,
5252
),
53-
radius: 35,
53+
radius: 30,
5454
),
5555
title: Text(
5656
info.name,
@@ -75,10 +75,10 @@ class IndexState extends State<Index> {
7575
this._bodyList.length = 0;
7676
String mdText = await this.getMdFile(widget.mdUrl);
7777
String nameKey = AuthorList.list[widget.title];
78-
if (nameKey != null) {
78+
/*if (nameKey != null) {
7979
this._bodyList.add(authorTile(nameKey));
8080
this._bodyList.add(Divider());
81-
}
81+
}*/
8282
print('文档完成长度:${mdText.length}');
8383
if (mdText.length > 30) {
8484
this._bodyList.add(await markdown_comp.Index(mdText));
@@ -117,6 +117,29 @@ class IndexState extends State<Index> {
117117
);
118118
}
119119

120+
showCode(context) async {
121+
/*if (Store.value<ConfigModel>(context).isPro) {
122+
// 线上文档
123+
FluroRouter.router.navigateTo(
124+
context,
125+
'webview?title=${widget.title}&url=${Uri.encodeComponent(Store.value<ConfigModel>(context).env.githubAssetOrigin+widget.mdUrl)}'
126+
);
127+
} else {*/
128+
// 加载本地
129+
String mdStr = await AssetUtils.readLocaleFile(widget.mdUrl);
130+
Navigator.of(context).push(
131+
MaterialPageRoute(builder: (BuildContext build) {
132+
return Scaffold(
133+
appBar: AppBar(title: Text(widget.title),),
134+
body: ListView(
135+
children: <Widget>[markdown_comp.Index(mdStr)],
136+
),
137+
);
138+
})
139+
);
140+
//}
141+
}
142+
120143
Future getMdFile(url) async {
121144
// bool productionEnv = Store.value<ConfigModel>(context).isPro;
122145
bool productionEnv = false;
@@ -129,6 +152,15 @@ class IndexState extends State<Index> {
129152

130153
getActions(context) {
131154
return [
155+
/*IconButton(
156+
color: Color(AppTheme.blackColor),
157+
icon: Icon(
158+
Icons.code
159+
),
160+
onPressed: () async {
161+
this.showCode(context);
162+
},
163+
),
132164
IconButton(
133165
color: Color(AppTheme.blackColor),
134166
icon: Icon(
@@ -140,7 +172,7 @@ class IndexState extends State<Index> {
140172
'/webview?title=${widget.title}&url=${Uri.encodeComponent(widget.originCodeUrl)}',
141173
);
142174
},
143-
),
175+
),*/
144176
IconButton(
145177
icon: Icon(Icons.share),
146178
color: Color(AppTheme.blackColor),

lib/config/index.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ import 'development.dart' as Development;
22
import 'production.dart' as Production;
33

44
const bool isPro = false;
5+
const String owner_repo = 'efoxTeam/flutter-ui';
56

67
Object env = isPro ? Production.Config() : Development.Config();

lib/config/theme.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AppTheme {
1515
static int blackColor = 0xFF000000;
1616
static int lineColor = 0xFFEEEEEE;
1717
static getThemeData(String theme) {
18-
//print('==================================getThemeData=$theme');
18+
print('==================================getThemeData=$theme');
1919
mainColor = materialColor[theme];
2020
ThemeData themData = ThemeData(
2121
textTheme: TextTheme(

lib/controller/index.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@ import 'package:efox_flutter/store/index.dart'
33

44
import 'package:efox_flutter/utils/appVersion.dart' show AppVersion;
55

6-
void initState() {
6+
void initState() async {
77
// 获取版本号
8-
Store.valueNotCtx<ConfigModel>().getAppVersion();
8+
Store.value<ConfigModel>().getAppVersion();
99
// 登录
10-
Store.valueNotCtx<UserModel>().getLocalUserInfo();
10+
/*Store.value<UserModel>().getLocalUserInfo().then((res) {
11+
if (res) {
12+
Store.value<UserModel>().getUserStar();
13+
}
14+
});*/
15+
// Store.value<UserModel>().getFlutterUIStar();
1116
Future.delayed(Duration(seconds: 3), () {
12-
AppVersion().check(Store.widgetCtx);
17+
AppVersion().check(Store.context);
1318
});
1419
}

lib/http/index.dart

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ Dio getDio({options, loading}) {
4747
print("返回值 ${response.data}");
4848
print('=========【请求成功】End============');
4949
await AppLoading.afterResponse(response.request.uri, loading);
50-
return response;
50+
return response;
5151
},
5252
onError: (DioError e) async {
53-
await AppLoading.afterResponse(e.request.uri, loading);
53+
print('e.request.uri=======================${e.request}');
54+
if (e.request != null && e.request.uri != null)
55+
await AppLoading.afterResponse(e.request.uri, loading);
5456
dynamic msg = e.message;
5557
dynamic code = 0; // 错误码
5658
dynamic status = e.type; // http请求状态
@@ -60,24 +62,28 @@ Dio getDio({options, loading}) {
6062
status = e.response.statusCode;
6163
}
6264
print('========【请求失败 Start】=============');
63-
print("请求地址 ${e.request.uri}");
65+
print("请求地址 ${e.request}");
6466
print("状态码 ${status}");
6567
print("返回msg ${msg}");
6668
print('=========【请求失败 End】============');
6769
return dio.reject({'msg': msg, 'code': code, 'status': status});
6870
},
6971
));
7072
dio.interceptors.add(LogInterceptor(responseBody: false)); //开启请求日志
71-
73+
7274
return dio;
7375
}
7476

7577
Future<dynamic> get({url, data = const {}, options, loading}) async {
76-
return getDio(options: options, loading: loading ?? Map())
77-
.get(url);
78+
return getDio(options: options, loading: loading ?? Map()).get(url);
7879
}
7980

8081
Future post({url, data = const {}, options, loading}) async {
8182
return getDio(options: options, loading: loading ?? Map())
8283
.post(url, data: data);
8384
}
85+
86+
Future put({url, data = const {}, options, loading}) async {
87+
return getDio(options: options, loading: loading ?? Map())
88+
.put(url, data: data);
89+
}

lib/http/loading.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void beforeRequest(uri, Map<dynamic, dynamic> options) {
1616
void afterResponse(uri, Map<dynamic, dynamic> options) {
1717
dict.remove(uri);
1818
if (dict.length == 0 && loading == true) {
19-
Navigator.of(Store.widgetCtx, rootNavigator: true).pop('close dialog');
19+
Navigator.of(Store.context, rootNavigator: true).pop('close dialog');
2020
loading = false;
2121
}
2222
}
@@ -31,7 +31,7 @@ void showAppLoading(Map<dynamic, dynamic> options) {
3131
'text': options['text'] ?? 'loading...'
3232
};
3333
showDialog(
34-
context: Store.widgetCtx,
34+
context: Store.context,
3535
builder: (context) {
3636
return LoadingDialog(text: options['text']);
3737
},

lib/main.dart

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import 'package:flutter_localizations/flutter_localizations.dart'; //语言包
33
import 'package:efox_flutter/lang/index.dart'
44
show AppLocalizationsDelegate, AppLocalizations;
55
import 'package:efox_flutter/lang/config.dart' show ConfigLanguage;
6-
import 'package:efox_flutter/store/index.dart'
7-
show Store, ConfigModel; //引用Store 层
6+
import 'package:efox_flutter/store/index.dart'; //引用Store 层
87
import 'package:efox_flutter/router/index.dart' show FluroRouter; //路由
98
import 'package:efox_flutter/config/theme.dart' show AppTheme; //主题
109
import 'package:efox_flutter/utils/analytics.dart' as Analytics; //统计
10+
import 'package:oktoast/oktoast.dart' show OKToast;
11+
import 'package:efox_flutter/page/home.dart' as HomePage;
12+
1113
// import './mock/index.dart' as TestCase;
1214
class MainApp extends StatefulWidget {
1315
MainApp() {
@@ -18,6 +20,7 @@ class MainApp extends StatefulWidget {
1820
@override
1921
MainAppState createState() => MainAppState();
2022
}
23+
2124
class MainAppState extends State<MainApp> {
2225
// 定义全局 语言代理
2326
AppLocalizationsDelegate _delegate;
@@ -26,19 +29,21 @@ class MainAppState extends State<MainApp> {
2629
//实例化多语言
2730
super.initState();
2831
_delegate = AppLocalizationsDelegate();
29-
Store.setStoreCtx(context); // 初始化数据层
32+
33+
Future.delayed(Duration.zero, () async {
34+
Store.value<ConfigModel>().getTheme();
35+
});
3036
}
3137

3238
@override
3339
Widget build(BuildContext context) {
34-
Store.value<ConfigModel>(context).getTheme();
35-
36-
return Store.connect<ConfigModel>(
37-
builder: (context, child, model) {
40+
Store.of(context);
41+
return Consumer<ConfigModel>(
42+
builder: (context, configModel, child) {
3843
return MaterialApp(
3944
localeResolutionCallback: (deviceLocale, supportedLocales) {
4045
print(
41-
'deviceLocale=$deviceLocale supportedLocales=$supportedLocales');
46+
'deviceLocale=$deviceLocale supportedLocales=$supportedLocales context=$context');
4247
Locale _locale = supportedLocales.contains(deviceLocale)
4348
? deviceLocale
4449
: Locale('zh');
@@ -55,13 +60,18 @@ class MainAppState extends State<MainApp> {
5560
_delegate,
5661
],
5762
supportedLocales: ConfigLanguage.supportedLocales,
58-
theme: AppTheme.getThemeData(model.theme),
63+
theme: AppTheme.getThemeData(configModel.theme),
5964
onGenerateRoute: FluroRouter.router.generator,
65+
// home: HomePage.Index(),
6066
navigatorObservers: <NavigatorObserver>[Analytics.observer],
6167
);
6268
},
6369
);
6470
}
6571
}
6672

67-
void main() => runApp(Store.init(child: MainApp()));
73+
void main() => runApp(
74+
Store.init(
75+
child: MainApp(),
76+
),
77+
);

lib/package/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Flutter Packages for FLUTTER UI APP
2+
> packages 为纯flutter 组件,沉淀通用组件,通用方法,通用模块

lib/package/router/router.dart

Whitespace-only changes.

0 commit comments

Comments
 (0)