Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/utils/comment.dart → lib/comment/utils/comment.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import 'package:lemmy_api_client/v3.dart';
import 'package:thunder/account/models/account.dart';
import 'package:thunder/core/auth/helpers/fetch_account.dart';

import 'package:thunder/core/models/comment_view_tree.dart';
import 'package:thunder/utils/date_time.dart';
import 'package:thunder/account/models/account.dart';
import 'package:thunder/core/singletons/lemmy_client.dart';

import 'date_time.dart';
import 'package:thunder/core/models/comment_view_tree.dart';
import 'package:thunder/core/auth/helpers/fetch_account.dart';

// Optimistically updates a comment
CommentView optimisticallyVoteComment(CommentViewTree commentViewTree, int voteType) {
Expand Down
2 changes: 1 addition & 1 deletion lib/community/pages/create_post_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import 'package:thunder/shared/snackbar.dart';
import 'package:thunder/utils/debounce.dart';
import 'package:thunder/utils/image.dart';
import 'package:thunder/utils/instance.dart';
import 'package:thunder/utils/navigate_post.dart';
import 'package:thunder/post/utils/navigate_post.dart';

class CreatePostPage extends StatefulWidget {
final int? communityId;
Expand Down
4 changes: 2 additions & 2 deletions lib/community/utils/post_card_action_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import 'package:thunder/shared/snackbar.dart';
import 'package:thunder/thunder/bloc/thunder_bloc.dart';
import 'package:thunder/user/bloc/user_bloc.dart';
import 'package:thunder/utils/instance.dart';
import 'package:thunder/utils/navigate_instance.dart';
import 'package:thunder/utils/navigate_user.dart';
import 'package:thunder/instance/utils/navigate_instance.dart';
import 'package:thunder/user/utils/navigate_user.dart';
import 'package:lemmy_api_client/v3.dart';

import 'package:thunder/core/auth/bloc/auth_bloc.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/community/widgets/community_sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import 'package:thunder/shared/avatars/user_avatar.dart';
import 'package:thunder/thunder/bloc/thunder_bloc.dart';
import 'package:thunder/utils/date_time.dart';
import 'package:thunder/utils/instance.dart';
import 'package:thunder/utils/navigate_user.dart';
import 'package:thunder/user/utils/navigate_user.dart';

const kSidebarWidthFactor = 0.8;

Expand Down
2 changes: 1 addition & 1 deletion lib/community/widgets/post_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'package:thunder/core/models/post_view_media.dart';
import 'package:thunder/feed/bloc/feed_bloc.dart';
import 'package:thunder/post/enums/post_action.dart';
import 'package:thunder/thunder/bloc/thunder_bloc.dart';
import 'package:thunder/utils/navigate_post.dart';
import 'package:thunder/post/utils/navigate_post.dart';

class PostCard extends StatefulWidget {
final PostViewMedia postViewMedia;
Expand Down
2 changes: 1 addition & 1 deletion lib/community/widgets/post_card_metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'package:thunder/shared/text/scalable_text.dart';
import 'package:thunder/thunder/bloc/thunder_bloc.dart';
import 'package:thunder/utils/date_time.dart';
import 'package:thunder/utils/instance.dart';
import 'package:thunder/utils/navigate_user.dart';
import 'package:thunder/user/utils/navigate_user.dart';
import 'package:thunder/utils/numbers.dart';

class PostCardMetaData extends StatelessWidget {
Expand Down
2 changes: 1 addition & 1 deletion lib/inbox/bloc/inbox_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:stream_transform/stream_transform.dart';
import 'package:thunder/account/models/account.dart';
import 'package:thunder/core/auth/helpers/fetch_account.dart';
import 'package:thunder/core/singletons/lemmy_client.dart';
import 'package:thunder/utils/comment.dart';
import 'package:thunder/comment/utils/comment.dart';

part 'inbox_event.dart';
part 'inbox_state.dart';
Expand Down
7 changes: 5 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ void main() async {

runApp(ThunderApp(notificationsStream: notificationsStreamController.stream));

// Set high refresh rate after app initialization
FlutterDisplayMode.setHighRefreshRate();
if (!kIsWeb && Platform.isAndroid) {
// Set high refresh rate after app initialization
FlutterDisplayMode.setHighRefreshRate();
}

// Register to receive BackgroundFetch events after app is terminated.
if (!kIsWeb && Platform.isAndroid && (prefs.getBool(LocalSettings.enableInboxNotifications.name) ?? false)) {
Expand Down Expand Up @@ -146,6 +148,7 @@ class ThunderApp extends StatelessWidget {
if (state.status == ThemeStatus.initial) {
context.read<ThemeBloc>().add(ThemeChangeEvent());
}

return DynamicColorBuilder(
builder: (lightColorScheme, darkColorScheme) {
ThemeData theme = FlexThemeData.light(useMaterial3: true, scheme: FlexScheme.values.byName(state.selectedTheme.name));
Expand Down
2 changes: 1 addition & 1 deletion lib/post/bloc/post_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import 'package:thunder/account/models/account.dart';
import 'package:thunder/core/auth/helpers/fetch_account.dart';
import 'package:thunder/core/enums/local_settings.dart';
import 'package:thunder/core/models/post_view_media.dart';
import 'package:thunder/utils/comment.dart';
import 'package:thunder/comment/utils/comment.dart';
import 'package:thunder/core/models/comment_view_tree.dart';
import 'package:thunder/core/singletons/lemmy_client.dart';
import 'package:thunder/utils/constants.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/post/utils/comment_action_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:thunder/user/bloc/user_bloc.dart';
import 'package:thunder/utils/global_context.dart';
import 'package:thunder/utils/instance.dart';
import 'package:thunder/utils/navigate_instance.dart';
import 'package:thunder/utils/navigate_user.dart';
import 'package:thunder/instance/utils/navigate_instance.dart';
import 'package:thunder/user/utils/navigate_user.dart';

import '../../core/auth/bloc/auth_bloc.dart';

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/post/widgets/post_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import 'package:thunder/shared/media_view.dart';
import 'package:thunder/thunder/thunder_icons.dart';
import 'package:thunder/user/utils/special_user_checks.dart';
import 'package:thunder/utils/instance.dart';
import 'package:thunder/utils/navigate_user.dart';
import 'package:thunder/user/utils/navigate_user.dart';
import 'package:thunder/utils/numbers.dart';
import 'package:thunder/shared/snackbar.dart';

Expand Down
2 changes: 1 addition & 1 deletion lib/search/bloc/search_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'package:thunder/core/singletons/lemmy_client.dart';
import 'package:thunder/feed/utils/community.dart';
import 'package:thunder/post/utils/post.dart';
import 'package:thunder/search/utils/search_utils.dart';
import 'package:thunder/utils/comment.dart';
import 'package:thunder/comment/utils/comment.dart';
import 'package:thunder/utils/global_context.dart';
import 'package:thunder/utils/instance.dart';

Expand Down
2 changes: 1 addition & 1 deletion lib/search/pages/search_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import 'package:thunder/utils/debounce.dart';
import 'package:thunder/utils/global_context.dart';
import 'package:thunder/utils/instance.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:thunder/utils/navigate_user.dart';
import 'package:thunder/user/utils/navigate_user.dart';
import 'package:thunder/utils/numbers.dart';

class SearchPage extends StatefulWidget {
Expand Down
2 changes: 1 addition & 1 deletion lib/settings/pages/comment_appearance_settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'package:thunder/settings/widgets/toggle_option.dart';
import 'package:thunder/shared/dialogs.dart';
import 'package:thunder/thunder/bloc/thunder_bloc.dart';
import 'package:thunder/utils/bottom_sheet_list_picker.dart';
import 'package:thunder/utils/comment.dart';
import 'package:thunder/comment/utils/comment.dart';
import 'package:thunder/utils/constants.dart';

class CommentAppearanceSettingsPage extends StatefulWidget {
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/comment_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'package:thunder/thunder/bloc/thunder_bloc.dart';
import 'package:thunder/thunder/thunder_icons.dart';
import 'package:thunder/user/utils/special_user_checks.dart';
import 'package:thunder/utils/instance.dart';
import 'package:thunder/utils/navigate_user.dart';
import 'package:thunder/user/utils/navigate_user.dart';
import 'package:thunder/utils/numbers.dart';

import '../utils/date_time.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/comment_reference.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'package:thunder/shared/text/scalable_text.dart';
import 'package:thunder/thunder/bloc/thunder_bloc.dart';
import 'package:thunder/utils/date_time.dart';
import 'package:thunder/utils/instance.dart';
import 'package:thunder/utils/navigate_comment.dart';
import 'package:thunder/comment/utils/navigate_comment.dart';
import 'package:thunder/utils/numbers.dart';

class CommentReference extends StatefulWidget {
Expand Down
4 changes: 2 additions & 2 deletions lib/shared/cross_posts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';

import 'package:thunder/post/utils/post.dart';
import 'package:thunder/utils/instance.dart';
import 'package:thunder/utils/navigate_create_post.dart';
import 'package:thunder/utils/navigate_post.dart';
import 'package:thunder/post/utils/navigate_create_post.dart';
import 'package:thunder/post/utils/navigate_post.dart';

/// Widget which displays a post's cross-posts
class CrossPosts extends StatefulWidget {
Expand Down
91 changes: 0 additions & 91 deletions lib/shared/hero.dart

This file was deleted.

2 changes: 1 addition & 1 deletion lib/shared/link_preview_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'package:thunder/core/enums/view_mode.dart';
import 'package:thunder/thunder/bloc/thunder_bloc.dart';
import 'package:thunder/utils/instance.dart';
import 'package:thunder/shared/image_preview.dart';
import 'package:thunder/utils/navigate_user.dart';
import 'package:thunder/user/utils/navigate_user.dart';

class LinkPreviewCard extends StatelessWidget {
const LinkPreviewCard({
Expand Down
10 changes: 5 additions & 5 deletions lib/thunder/pages/thunder_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ import 'package:thunder/search/pages/search_page.dart';
import 'package:thunder/settings/pages/settings_page.dart';
import 'package:thunder/shared/error_message.dart';
import 'package:thunder/thunder/bloc/thunder_bloc.dart';
import 'package:thunder/utils/navigate_comment.dart';
import 'package:thunder/utils/navigate_create_post.dart';
import 'package:thunder/utils/navigate_instance.dart';
import 'package:thunder/utils/navigate_post.dart';
import 'package:thunder/utils/navigate_user.dart';
import 'package:thunder/comment/utils/navigate_comment.dart';
import 'package:thunder/post/utils/navigate_create_post.dart';
import 'package:thunder/instance/utils/navigate_instance.dart';
import 'package:thunder/post/utils/navigate_post.dart';
import 'package:thunder/user/utils/navigate_user.dart';
import 'package:thunder/utils/notifications_navigation.dart';

String? currentIntent;
Expand Down
2 changes: 1 addition & 1 deletion lib/user/bloc/user_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:thunder/core/auth/helpers/fetch_account.dart';
import 'package:thunder/core/models/comment_view_tree.dart';
import 'package:thunder/core/models/post_view_media.dart';
import 'package:thunder/core/singletons/lemmy_client.dart';
import 'package:thunder/utils/comment.dart';
import 'package:thunder/comment/utils/comment.dart';
import 'package:thunder/utils/error_messages.dart';
import 'package:thunder/utils/global_context.dart';
import 'package:thunder/post/utils/post.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/user/pages/user_settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import 'package:thunder/user/bloc/user_settings_bloc.dart';
import 'package:thunder/user/widgets/user_indicator.dart';
import 'package:thunder/utils/instance.dart';
import 'package:thunder/utils/links.dart';
import 'package:thunder/utils/navigate_instance.dart';
import 'package:thunder/utils/navigate_user.dart';
import 'package:thunder/instance/utils/navigate_instance.dart';
import 'package:thunder/user/utils/navigate_user.dart';

class UserSettingsPage extends StatefulWidget {
const UserSettingsPage({super.key});
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions lib/utils/links.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import 'package:thunder/feed/utils/utils.dart';
import 'package:thunder/feed/view/feed_page.dart';
import 'package:thunder/post/utils/post.dart';
import 'package:thunder/utils/instance.dart';
import 'package:thunder/utils/navigate_comment.dart';
import 'package:thunder/utils/navigate_post.dart';
import 'package:thunder/utils/navigate_user.dart';
import 'package:thunder/comment/utils/navigate_comment.dart';
import 'package:thunder/post/utils/navigate_post.dart';
import 'package:thunder/user/utils/navigate_user.dart';

class LinkInfo {
String? imageURL;
Expand Down