Skip to content

Commit

Permalink
add main part
Browse files Browse the repository at this point in the history
  • Loading branch information
kidozh committed Dec 2, 2024
1 parent f2d60ee commit 28bef42
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 11 deletions.
1 change: 1 addition & 0 deletions lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,7 @@ class MessageLookup extends MessageLookupByLibrary {
"The final product will be changed according to latest development."),
"testVersionNotificationTitle":
MessageLookupByLibrary.simpleMessage("Take a bite on beta test"),
"thread": MessageLookupByLibrary.simpleMessage("Thread"),
"threadIsClosed":
MessageLookupByLibrary.simpleMessage("Thread is closed."),
"threadReadAccess": m47,
Expand Down
1 change: 1 addition & 0 deletions lib/generated/intl/messages_zh_CN.dart
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ class MessageLookup extends MessageLookupByLibrary {
"此版本具有最新的开发进展,同时也伴有一定的错误。当您使用时,请做好数据备份,以防数据丢失。"),
"testVersionNotificationTitle":
MessageLookupByLibrary.simpleMessage("欢迎参与测试版本"),
"thread": MessageLookupByLibrary.simpleMessage("帖子"),
"threadIsClosed": MessageLookupByLibrary.simpleMessage("此贴已关闭发帖。"),
"threadReadAccess": m47,
"threadReply": m48,
Expand Down
10 changes: 10 additions & 0 deletions lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -877,5 +877,6 @@
"menuDrawerTitle": "Menu",
"postThread": "Post thread",
"viewPicture": "Preview",
"history": "History"
"history": "History",
"thread": "Thread"
}
3 changes: 2 additions & 1 deletion lib/l10n/intl_zh_CN.arb
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@
"menuDrawerTitle": "菜单",
"postThread": "发帖",
"viewPicture": "预览图片",
"history": "历史"
"history": "历史",
"thread": "帖子"

}
7 changes: 7 additions & 0 deletions lib/page/AddDiscuzPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:discuz_flutter/utility/UserPreferencesUtils.dart';
import 'package:discuz_flutter/utility/VibrationUtils.dart';
import 'package:discuz_flutter/widget/ErrorCard.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
Expand All @@ -31,11 +32,17 @@ import '../utility/URLUtils.dart';
class AddDiscuzPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ModalRoute<Object?>? route = ModalRoute.of(context);
return PlatformScaffold(
iosContentBottomPadding: true,
iosContentPadding: true,
appBar: PlatformAppBar(
title: Text(S.of(context).addDiscuzTitle),
cupertino: (context, platform) => CupertinoNavigationBarData(
previousPageTitle: (route != null && route is CupertinoPageRoute<dynamic> && route.previousTitle.value!=null)?
route.previousTitle.value
: S.of(context).appName
),
),
body: AddDiscuzForumFieldStatefulWidget());
}
Expand Down
8 changes: 8 additions & 0 deletions lib/page/DisplayForumSliverPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import 'package:discuz_flutter/widget/ForumThreadWidget.dart';
import 'package:discuz_flutter/widget/LoadingStateWidget.dart';
import 'package:dual_screen/dual_screen.dart';
import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
Expand Down Expand Up @@ -375,6 +376,8 @@ class _DisplayForumSliverState extends State<DisplayForumSliverStatefulWidget> {
@override
Widget build(BuildContext context) {

ModalRoute<Object?>? route = ModalRoute.of(context);

return PlatformScaffold(
appBar: PlatformAppBar(
//middle: Text(S.of(context).forumDisplayTitle),
Expand Down Expand Up @@ -483,6 +486,11 @@ class _DisplayForumSliverState extends State<DisplayForumSliverStatefulWidget> {
? Text(S.of(context).forumDisplayTitle,overflow: TextOverflow.ellipsis)
: Text(_displayForumResult.discuzIndexVariables.forum.name,overflow: TextOverflow.ellipsis),
backgroundColor: Theme.of(context).navigationBarTheme.backgroundColor?.withOpacity(0.5),
cupertino: (context, platform) => CupertinoNavigationBarData(
previousPageTitle: (route != null && route is CupertinoPageRoute<dynamic> && route.previousTitle.value!=null)?
route.previousTitle.value
: Provider.of<DiscuzAndUserNotifier>(context, listen: false).discuz?.siteName
),
),
body: EasyRefresh(
controller: _controller,
Expand Down
2 changes: 1 addition & 1 deletion lib/page/FavoriteThreadPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class FavoriteThreadCardWidget extends StatelessWidget{
await Navigator.push(
context,
platformPageRoute(context:context,
iosTitle: S.of(context).viewThreadTitle,
iosTitle: favoriteThreadInDatabase.title.length > 12? S.of(context).viewThreadTitle: favoriteThreadInDatabase.title,
builder: (context) => ViewThreadSliverPage( discuz, user, favoriteThreadInDatabase.idInServer,
passedSubject: favoriteThreadInDatabase.title,
))
Expand Down
6 changes: 6 additions & 0 deletions lib/page/LoginPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,17 @@ class LoginPage extends StatelessWidget {

@override
Widget build(BuildContext context) {
ModalRoute<Object?>? route = ModalRoute.of(context);
return PlatformScaffold(
iosContentPadding: true,
iosContentBottomPadding: true,
appBar: PlatformAppBar(
title: Text(discuz.siteName),
cupertino: (context, platform) => CupertinoNavigationBarData(
previousPageTitle: (route != null && route is CupertinoPageRoute<dynamic> && route.previousTitle.value!=null)?
route.previousTitle.value
: Provider.of<DiscuzAndUserNotifier>(context, listen: false).discuz?.siteName
),
),
body: LoginForumFieldStatefulWidget(discuz, accountName));
}
Expand Down
11 changes: 8 additions & 3 deletions lib/page/PostThreadPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,18 @@ class PostThreadState extends State<PostThreadStatefulWidget> {
Widget build(BuildContext context) {
if (_displayForumResult == null) {
return Container(
width: 128,
width: 64,
padding: EdgeInsets.all(32),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
PlatformCircularProgressIndicator(),
SizedBox(height: 16,),
SizedBox(
width: 32,
height: 32,
child: PlatformCircularProgressIndicator(),
),
SizedBox(height: 32,),
Text(S.of(context).loadingForumInformation)
],
),
Expand Down
9 changes: 8 additions & 1 deletion lib/page/PrivateMessageDetailPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:discuz_flutter/utility/VibrationUtils.dart';
import 'package:discuz_flutter/widget/ErrorCard.dart';
import 'package:discuz_flutter/widget/PrivateMessageDetailWidget.dart';
import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
Expand Down Expand Up @@ -213,11 +214,17 @@ class _PrivateMessageDetailState
body: NullUserScreen(),
);
}
ModalRoute<Object?>? route = ModalRoute.of(context);
return PlatformScaffold(
iosContentBottomPadding: true,
iosContentPadding: true,
appBar: PlatformAppBar(
title: Text(toUsername),
cupertino: (context, platform) => CupertinoNavigationBarData(
previousPageTitle: (route != null && route is CupertinoPageRoute<dynamic> && route.previousTitle.value!=null)?
route.previousTitle.value
: Provider.of<DiscuzAndUserNotifier>(context, listen: false).discuz?.siteName
),
trailingActions: [
IconButton(
icon: Icon(AppPlatformIcons(context).userProfileSolid, size: 28,),
Expand All @@ -226,7 +233,7 @@ class _PrivateMessageDetailState
context,
platformPageRoute(
context: context,
iosTitle: toUsername,
iosTitle: S.of(context).userProfile,
builder: (context) => UserProfilePage(
discuzAndUser.discuz!, discuzAndUser.user, toUid)));
},
Expand Down
8 changes: 7 additions & 1 deletion lib/page/ViewThreadSliverPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -740,12 +740,18 @@ class _ViewThreadSliverState extends State<ViewThreadStatefulSliverWidget> {
@override
Widget build(BuildContext context) {
CustomizeColor.updateAndroidNavigationbar(context);
ModalRoute<Object?>? route = ModalRoute.of(context);

return PlatformScaffold(
appBar: PlatformAppBar(
automaticallyImplyLeading: this.onClosed == null ? true : false,
cupertino: (_, __) => CupertinoNavigationBarData(
heroTag: this.onClosed == null ? null : "viewthread_${tid}",
transitionBetweenRoutes: false),
transitionBetweenRoutes: false,
previousPageTitle: (route != null && route is CupertinoPageRoute<dynamic> && route.previousTitle.value!=null)?
route.previousTitle.value
: Provider.of<DiscuzAndUserNotifier>(context, listen: false).discuz?.siteName
),
leading: this.onClosed == null
? null
: PlatformIconButton(
Expand Down
2 changes: 1 addition & 1 deletion lib/widget/ForumThreadWidget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ class ForumThreadState extends State<ForumThreadStatefulWidget>{
context,
platformPageRoute(
context:context,
iosTitle: S.of(context).forumDisplayTitle,
iosTitle: S.of(context).viewThreadTitle,
builder: (context) => ViewThreadSliverPage(_discuz,_user, _forumThread.getTid(),
passedSubject: _forumThread.subject,))
);
Expand Down
2 changes: 1 addition & 1 deletion lib/widget/PostWidget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ class PostState extends State<PostStatefulWidget> {
context,
platformPageRoute(
context: context,
iosTitle: _post.author,
iosTitle: S.of(context).userProfile,
builder: (context) =>
UserProfilePage(_discuz, user, _post.authorId, username: _post.author,)));
}
Expand Down
2 changes: 1 addition & 1 deletion lib/widget/UserAvatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class UserAvatar extends StatelessWidget{
await Navigator.push(
context,
platformPageRoute(context:context,
iosTitle: username,
iosTitle: S.of(context).userProfile,
builder: (context) => UserProfilePage(discuz,user, uid, username: username,)));
}

Expand Down

0 comments on commit 28bef42

Please sign in to comment.