mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-07-03 06:00:54 +08:00
targ
This commit is contained in:
@ -528,6 +528,7 @@
|
|||||||
PRODUCT_BUNDLE_IDENTIFIER = com.alibaba.fluttergo;
|
PRODUCT_BUNDLE_IDENTIFIER = com.alibaba.fluttergo;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "FlutterGO-alibaba-develop";
|
PROVISIONING_PROFILE_SPECIFIER = "FlutterGO-alibaba-develop";
|
||||||
|
TARGETED_DEVICE_FAMILY = 1;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@ -556,6 +557,7 @@
|
|||||||
PRODUCT_BUNDLE_IDENTIFIER = com.alibaba.fluttergo;
|
PRODUCT_BUNDLE_IDENTIFIER = com.alibaba.fluttergo;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = FlutterGO_alibaba_distribution_ad_hoc;
|
PROVISIONING_PROFILE_SPECIFIER = FlutterGO_alibaba_distribution_ad_hoc;
|
||||||
|
TARGETED_DEVICE_FAMILY = 1;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>IDEDidComputeMac32BitWarning</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>BuildSystemType</key>
|
|
||||||
<string>Original</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
Binary file not shown.
Before Width: | Height: | Size: 68 B |
Binary file not shown.
Before Width: | Height: | Size: 68 B |
Binary file not shown.
Before Width: | Height: | Size: 68 B |
@ -5,7 +5,7 @@
|
|||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>Flutter Go</string>
|
<string>Flutter·Go</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
@ -17,11 +17,11 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0.7</string>
|
<string>1.0.8</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>107</string>
|
<string>108</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>NSCameraUsageDescription</key>
|
<key>NSCameraUsageDescription</key>
|
||||||
|
@ -1,138 +0,0 @@
|
|||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
|
||||||
|
|
||||||
import 'package:flutter_go/components/list_view_item.dart';
|
|
||||||
import 'package:flutter_go/components/list_refresh.dart' as listComp;
|
|
||||||
import 'package:flutter_go/components/pagination.dart';
|
|
||||||
import 'package:flutter_go/views/first_page/first_page_item.dart';
|
|
||||||
import 'package:flutter_go/components/disclaimer_msg.dart';
|
|
||||||
import 'package:flutter_go/utils/net_utils.dart';
|
|
||||||
|
|
||||||
// ValueKey<String> key;
|
|
||||||
|
|
||||||
class FirstPage extends StatefulWidget {
|
|
||||||
@override
|
|
||||||
FirstPageState createState() => new FirstPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class FirstPageState extends State<FirstPage> with AutomaticKeepAliveClientMixin{
|
|
||||||
Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
|
|
||||||
Future<bool> _unKnow;
|
|
||||||
GlobalKey<DisclaimerMsgState> key;
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool get wantKeepAlive => true;
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
if (key == null) {
|
|
||||||
key = GlobalKey<DisclaimerMsgState>();
|
|
||||||
// key = const Key('__RIKEY1__');
|
|
||||||
//获取sharePre
|
|
||||||
_unKnow = _prefs.then((SharedPreferences prefs) {
|
|
||||||
return (prefs.getBool('disclaimer::Boolean') ?? false);
|
|
||||||
});
|
|
||||||
|
|
||||||
/// 判断是否需要弹出免责声明,已经勾选过不在显示,就不会主动弹
|
|
||||||
_unKnow.then((bool value) {
|
|
||||||
new Future.delayed(const Duration(seconds: 1),(){
|
|
||||||
if (!value && key.currentState is DisclaimerMsgState && key.currentState.showAlertDialog is Function) {
|
|
||||||
key.currentState.showAlertDialog(context);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Future<Map> getIndexListData([Map<String, dynamic> params]) async {
|
|
||||||
const juejin_flutter = 'https://timeline-merger-ms.juejin.im/v1/get_tag_entry?src=web&tagId=5a96291f6fb9a0535b535438';
|
|
||||||
var pageIndex = (params is Map) ? params['pageIndex'] : 0;
|
|
||||||
final _param = {'page':pageIndex,'pageSize':20,'sort':'rankIndex'};
|
|
||||||
var responseList = [];
|
|
||||||
var pageTotal = 0;
|
|
||||||
|
|
||||||
try{
|
|
||||||
var response = await NetUtils.get(juejin_flutter, params: _param);
|
|
||||||
responseList = response['d']['entrylist'];
|
|
||||||
pageTotal = response['d']['total'];
|
|
||||||
if (!(pageTotal is int) || pageTotal <= 0) {
|
|
||||||
pageTotal = 0;
|
|
||||||
}
|
|
||||||
}catch(e){
|
|
||||||
|
|
||||||
}
|
|
||||||
pageIndex += 1;
|
|
||||||
List resultList = new List();
|
|
||||||
for (int i = 0; i < responseList.length; i++) {
|
|
||||||
try {
|
|
||||||
FirstPageItem cellData = new FirstPageItem.fromJson(responseList[i]);
|
|
||||||
resultList.add(cellData);
|
|
||||||
} catch (e) {
|
|
||||||
// No specified type, handles all
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Map<String, dynamic> result = {"list":resultList, 'total':pageTotal, 'pageIndex':pageIndex};
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget makeCard(index,item){
|
|
||||||
|
|
||||||
var myTitle = '${item.title}';
|
|
||||||
var myUsername = '${'👲'}: ${item.username} ';
|
|
||||||
var codeUrl = '${item.detailUrl}';
|
|
||||||
return new ListViewItem(itemUrl:codeUrl,itemTitle: myTitle,data: myUsername,);
|
|
||||||
}
|
|
||||||
|
|
||||||
headerView(){
|
|
||||||
return
|
|
||||||
Column(
|
|
||||||
children: <Widget>[
|
|
||||||
Stack(
|
|
||||||
//alignment: const FractionalOffset(0.9, 0.1),//方法一
|
|
||||||
children: <Widget>[
|
|
||||||
Pagination(),
|
|
||||||
Positioned(//方法二
|
|
||||||
top: 10.0,
|
|
||||||
left: 0.0,
|
|
||||||
child: DisclaimerMsg(key:key,pWidget:this)
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
SizedBox(height: 1, child:Container(color: Theme.of(context).primaryColor)),
|
|
||||||
SizedBox(height: 10),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
super.build(context);
|
|
||||||
return new Column(
|
|
||||||
children: <Widget>[
|
|
||||||
// new Stack(
|
|
||||||
// //alignment: const FractionalOffset(0.9, 0.1),//方法一
|
|
||||||
// children: <Widget>[
|
|
||||||
// Pagination(),
|
|
||||||
// Positioned(//方法二
|
|
||||||
// top: 10.0,
|
|
||||||
// left: 0.0,
|
|
||||||
// child: DisclaimerMsg(key:key,pWidget:this)
|
|
||||||
// ),
|
|
||||||
// ]),
|
|
||||||
// SizedBox(height: 2, child:Container(color: Theme.of(context).primaryColor)),
|
|
||||||
new Expanded(
|
|
||||||
//child: new List(),
|
|
||||||
child: listComp.ListRefresh(getIndexListData,makeCard,headerView)
|
|
||||||
)
|
|
||||||
]
|
|
||||||
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
|||||||
/// Created with Android Studio.
|
|
||||||
/// User: 一晟
|
|
||||||
/// Date: 2019/1/5
|
|
||||||
/// Time: 下午10:20
|
|
||||||
/// email: zhu.yan@alibaba-inc.com
|
|
||||||
/// target: FirstPageItem
|
|
||||||
|
|
||||||
import 'package:flutter_go/utils/util.dart';
|
|
||||||
|
|
||||||
class FirstPageItem {
|
|
||||||
bool hot;
|
|
||||||
String isCollection;
|
|
||||||
String tag;
|
|
||||||
String username;
|
|
||||||
int collectionCount;
|
|
||||||
int commentCount;
|
|
||||||
String title;
|
|
||||||
String createdTime;
|
|
||||||
String detailUrl;
|
|
||||||
|
|
||||||
FirstPageItem(
|
|
||||||
{this.hot,
|
|
||||||
this.tag,
|
|
||||||
this.username,
|
|
||||||
this.collectionCount,
|
|
||||||
this.createdTime,
|
|
||||||
this.commentCount,
|
|
||||||
this.title,
|
|
||||||
this.detailUrl,
|
|
||||||
this.isCollection});
|
|
||||||
|
|
||||||
factory FirstPageItem.fromJson(Map<String, dynamic> json) {
|
|
||||||
String _tag = '';
|
|
||||||
if(json['tags'].length>0){
|
|
||||||
_tag = '${json['tags'][0]['title']}/';
|
|
||||||
}
|
|
||||||
return FirstPageItem(
|
|
||||||
hot: json['hot'],
|
|
||||||
collectionCount: json['collectionCount'],
|
|
||||||
commentCount: json['commentsCount'],
|
|
||||||
tag: '$_tag${json['category']['name']}',
|
|
||||||
username: json['user']['username'],
|
|
||||||
createdTime: Util.getTimeDuration(json['createdAt']),
|
|
||||||
title: json['title'],
|
|
||||||
detailUrl: json['originalUrl'],
|
|
||||||
isCollection: json['type'] ,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user