Skip to content

Commit

Permalink
search id
Browse files Browse the repository at this point in the history
  • Loading branch information
Notsfsssf committed Oct 6, 2020
1 parent 2709714 commit c88fd9e
Show file tree
Hide file tree
Showing 13 changed files with 266 additions and 226 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ android {
applicationId packageName
minSdkVersion 21
targetSdkVersion 30
versionCode 33
versionName "0.2.2 X"
versionCode 34
versionName "0.2.2 theocracy"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class MainActivity : FlutterActivity() {
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, ENCODE_CHANNEL).setMethodCallHandler { call, result ->
if (call.method == "getBatteryLevel") {
val name = call.argument<String>("name")!!
val path = call.argument<String>("flutter.store_path")!!
val path = call.argument<String>("path")!!
val delay = call.argument<Int>("delay")!!
GlobalScope.launch(Dispatchers.Main) {
withContext(Dispatchers.IO) {
Expand Down
2 changes: 1 addition & 1 deletion lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ class Constants {
static String tagName = "0.2.2";
// static bool isGooglePlay =
// bool.fromEnvironment("IS_GOOGLEPLAY", defaultValue: false);//为何没用啊咕鸽?
static bool isGooglePlay = false;
static bool isGooglePlay =true;
}
4 changes: 2 additions & 2 deletions lib/generated/intl/messages_zh-CN.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class MessageLookup extends MessageLookupByLibrary {
"create_folder" : MessageLookupByLibrary.simpleMessage("创建文件夹"),
"crosscount" : MessageLookupByLibrary.simpleMessage("列数"),
"current_password" : MessageLookupByLibrary.simpleMessage("当前密码"),
"dark" : MessageLookupByLibrary.simpleMessage("dark"),
"dark" : MessageLookupByLibrary.simpleMessage("深色"),
"date_asc" : MessageLookupByLibrary.simpleMessage("日期升序"),
"date_desc" : MessageLookupByLibrary.simpleMessage("日期降序"),
"date_duration" : MessageLookupByLibrary.simpleMessage("日期间隔"),
Expand Down Expand Up @@ -102,7 +102,7 @@ class MessageLookup extends MessageLookupByLibrary {
"large_preview_zoom_quality" : MessageLookupByLibrary.simpleMessage("大图预览缩放"),
"latest_version" : MessageLookupByLibrary.simpleMessage("最新版本"),
"let_go_and_load_more" : MessageLookupByLibrary.simpleMessage("松手加载更多"),
"light" : MessageLookupByLibrary.simpleMessage("light"),
"light" : MessageLookupByLibrary.simpleMessage("浅色"),
"link" : MessageLookupByLibrary.simpleMessage("链接"),
"load_image_failed_click_to_reload" : MessageLookupByLibrary.simpleMessage("图片加载失败,点击重试"),
"loading_failed_retry_message" : MessageLookupByLibrary.simpleMessage("加载失败,点击重试"),
Expand Down
4 changes: 2 additions & 2 deletions lib/l10n/intl_zh_CN.arb
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@
"special_shaped_screen": "异形屏",
"platform_special_setting": "平台特殊设置",
"system": "跟随系统",
"light": "light",
"dark": "dark",
"light": "浅色",
"dark": "深色",
"theme_mode": "深色模式",
"create_folder": "创建文件夹",
"old_way": "传统方式",
Expand Down
1 change: 0 additions & 1 deletion lib/page/about/about_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ class _AboutPageState extends State<AboutPage> {
builder: (BuildContext context) {
return Container(
height: 200.0,
color: Color(0xfff1f1f1),
child: Center(
child: Text("这里空空的,这个设计师显然没有什么话要说"),
),
Expand Down
57 changes: 33 additions & 24 deletions lib/page/comment/comment_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class _CommentPageState extends State<CommentPage> {
RefreshController easyRefreshController;
CommentStore _store;


@override
void initState() {
_editController = TextEditingController();
Expand Down Expand Up @@ -141,7 +140,9 @@ class _CommentPageState extends State<CommentPage> {
Padding(
padding:
const EdgeInsets.only(top: 8.0),
child: Text(comment.date.toString().toShortTime()),
child: Text(comment.date
.toString()
.toShortTime()),
)
],
),
Expand Down Expand Up @@ -179,28 +180,36 @@ class _CommentPageState extends State<CommentPage> {
child: Padding(
padding:
const EdgeInsets.only(bottom: 2.0, right: 8.0),
child: TextField(
controller: _editController,
decoration: InputDecoration(
labelText:
"Reply to ${parentCommentName == null ? "illust" : parentCommentName}",
suffixIcon: IconButton(
icon: Icon(Icons.reply),
onPressed: () async {
final client = apiClient;
String txt = _editController.text.trim();
try {
if (txt.isNotEmpty)
Response reponse = await client
.postIllustComment(widget.id, txt,
parent_comment_id:
parentCommentId);
_editController.clear();
_store.fetch();
} catch (e) {
print(e);
}
})),
child: Theme(
data: Theme.of(context).copyWith(
primaryColor: Theme.of(context).accentColor),
child: TextField(
controller: _editController,
decoration: InputDecoration(
labelText:
"Reply to ${parentCommentName == null ? "illust" : parentCommentName}",
suffixIcon: IconButton(
icon: Icon(
Icons.reply,
),
onPressed: () async {
final client = apiClient;
String txt =
_editController.text.trim();
try {
if (txt.isNotEmpty)
Response reponse =
await client.postIllustComment(
widget.id, txt,
parent_comment_id:
parentCommentId);
_editController.clear();
_store.fetch();
} catch (e) {
print(e);
}
})),
),
),
),
),
Expand Down
4 changes: 4 additions & 0 deletions lib/page/hello/recom/recom_spotlight_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import 'package:pixez/models/illust.dart';
import 'package:pixez/network/api_client.dart';
import 'package:pixez/page/hello/ranking/rank_page.dart';
import 'package:pixez/page/hello/recom/recom_user_road.dart';
import 'package:pixez/page/hello/recom/recom_user_store.dart';
import 'package:pixez/page/hello/recom/spotlight_store.dart';
import 'package:pixez/page/spotlight/spotlight_page.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
Expand All @@ -46,10 +47,12 @@ class _RecomSpolightPageState extends State<RecomSpolightPage>
with AutomaticKeepAliveClientMixin {
SpotlightStore spotlightStore;
LightingStore _lightingStore;
RecomUserStore _recomUserStore;

@override
void initState() {
_easyRefreshController = RefreshController(initialRefresh: true);
_recomUserStore = RecomUserStore();
spotlightStore = SpotlightStore(null);
_lightingStore =
LightingStore(() => apiClient.getRecommend(), _easyRefreshController);
Expand All @@ -61,6 +64,7 @@ class _RecomSpolightPageState extends State<RecomSpolightPage>
Future<void> fetchT() async {
await spotlightStore.fetch();
await _lightingStore.fetch();
await _recomUserStore.fetch();
}

@override
Expand Down
49 changes: 32 additions & 17 deletions lib/page/hello/recom/recom_user_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ class _RecomUserPageState extends State<RecomUserPage> {
void initState() {
_refreshController =
RefreshController(initialRefresh: widget.recomUserStore == null);
_recomUserStore = RecomUserStore(controller: _refreshController);
_recomUserStore =
widget.recomUserStore ?? RecomUserStore(controller: _refreshController);
if (widget.recomUserStore != null) {
_recomUserStore.users = widget.recomUserStore.users;
_recomUserStore.controller = _refreshController;
}
super.initState();
}

@override
void dispose() {
_recomUserStore?.controller = null;
_refreshController?.dispose();
super.dispose();
}
Expand All @@ -69,22 +71,35 @@ class _RecomUserPageState extends State<RecomUserPage> {
enablePullUp: true,
onRefresh: () => _recomUserStore.fetch(),
onLoading: () => _recomUserStore.next(),
footer: CustomFooter(
builder: (BuildContext context, LoadStatus mode) {
Widget body;
if (mode == LoadStatus.idle) {
body = Text(I18n.of(context).pull_up_to_load_more);
} else if (mode == LoadStatus.loading) {
body = CircularProgressIndicator();
} else if (mode == LoadStatus.failed) {
body = Text(I18n.of(context).loading_failed_retry_message);
} else if (mode == LoadStatus.canLoading) {
body = Text(I18n.of(context).let_go_and_load_more);
} else {
body = Text(I18n.of(context).no_more_data);
}
return Container(
height: 55.0,
child: Center(child: body),
);
},
),
child: _recomUserStore.users.isNotEmpty
? AnimationLimiter(
child: ListView.builder(
itemCount: _recomUserStore.users.length,
itemBuilder: (context, index) {
final data = _recomUserStore.users[index];
return AnimationConfiguration.staggeredList(
position: index,
child: SlideAnimation(
child: PainterCard(
user: data,
),
),
);
}),
)
? ListView.builder(
itemCount: _recomUserStore.users.length,
itemBuilder: (context, index) {
final data = _recomUserStore.users[index];
return PainterCard(
user: data,
);
})
: Container(),
),
);
Expand Down
39 changes: 22 additions & 17 deletions lib/page/hello/recom/recom_user_road.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:pixez/component/pixiv_image.dart';
import 'package:pixez/generated/l10n.dart';
import 'package:pixez/page/hello/recom/recom_user_page.dart';
import 'package:pixez/page/hello/recom/recom_user_store.dart';

class RecomUserRoad extends StatefulWidget {
final RecomUserStore recomUserStore;

const RecomUserRoad({Key key, @required this.recomUserStore})
: super(key: key);
@override
_RecomUserRoadState createState() => _RecomUserRoadState();
}
Expand All @@ -13,7 +18,8 @@ class _RecomUserRoadState extends State<RecomUserRoad> {
RecomUserStore _recomUserStore;
@override
void initState() {
_recomUserStore = RecomUserStore()..fetch();
_recomUserStore = widget.recomUserStore ?? RecomUserStore()
..fetch();
super.initState();
}

Expand All @@ -22,7 +28,9 @@ class _RecomUserRoadState extends State<RecomUserRoad> {
return InkWell(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context) {
return RecomUserPage();
return RecomUserPage(
recomUserStore: _recomUserStore,
);
}));
},
child: Container(
Expand All @@ -40,21 +48,18 @@ class _RecomUserRoadState extends State<RecomUserRoad> {
topLeft: Radius.circular(16.0)),
color: Colors.transparent),
child: _recomUserStore.users.isNotEmpty
? ListView.builder(
itemCount: _recomUserStore.users.length + 1,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
if (index == 0) {
return Center(
child: Padding(
padding: EdgeInsets.only(right: 10.0),
child: Visibility(
visible: false,
child:
Text(I18n.of(context).painter))));
}
return _buildUserList(index - 1);
},
? AnimationLimiter(
child: ListView.builder(
itemCount: _recomUserStore.users.length,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return AnimationConfiguration.staggeredList(
position: index,
child: SlideAnimation(
horizontalOffset: 50.0,
child: _buildUserList(index)));
},
),
)
: Container(),
),
Expand Down
25 changes: 8 additions & 17 deletions lib/page/hello/setting/setting_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class SettingPage extends StatefulWidget {
}

class _SettingPageState extends State<SettingPage> {

@override
void initState() {
super.initState();
Expand Down Expand Up @@ -242,22 +241,14 @@ class _SettingPageState extends State<SettingPage> {
Divider(),
Column(
children: <Widget>[
OpenContainer<bool>(
transitionType: ContainerTransitionType.fade,
closedColor: Colors.transparent,
closedElevation: 0.0,
openElevation: 0.0,
openBuilder:
(BuildContext context, VoidCallback _) {
return AboutPage();
},
closedShape: const RoundedRectangleBorder(),
closedBuilder:
(BuildContext _, VoidCallback openContainer) {
return ListTile(
leading: Icon(Icons.message),
title: Text(I18n.of(context).about),
);
ListTile(
leading: Icon(Icons.message),
title: Text(I18n.of(context).about),
onTap: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return AboutPage();
}));
},
),
Observer(builder: (context) {
Expand Down
Loading

0 comments on commit c88fd9e

Please sign in to comment.