Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2fc6bc9
Start switching navigation to use a router.
olorin99 Jan 21, 2026
6e3b96b
Add routes for modlog and post comments.
olorin99 Jan 21, 2026
3f52e5f
Add routes for domain, community mod and owner.
olorin99 Jan 21, 2026
65ff45c
Add routes for feed.
olorin99 Jan 21, 2026
cc80a74
Add routes for create.
olorin99 Jan 21, 2026
93570cc
Add routes for image, tags, tag-editor.
olorin99 Jan 21, 2026
11019f8
Add modlog routes as children of user and community routes.
olorin99 Jan 21, 2026
0f9ffbc
Add routes for bookmarks and profile edit.
olorin99 Jan 21, 2026
2babf56
dart format lib/src/screens
olorin99 Jan 21, 2026
c1d7675
Add routes for editing profiles, filters and feeds.
olorin99 Jan 22, 2026
9bedbd9
Add routes for settings.
olorin99 Jan 22, 2026
14496fb
Clear unused imports + some other recommends from dart analysis.
olorin99 Jan 22, 2026
53aad3c
Switch navigator pops to router.
olorin99 Jan 22, 2026
5a123cd
Clear unnecessary imports.
olorin99 Jan 22, 2026
0ab21b8
Bare minimum changes to support running on web
olorin99 Jan 22, 2026
7444689
Fix remaining platform checks.
olorin99 Jan 27, 2026
91e3655
Clean up some route paths and parameters.
olorin99 Jan 27, 2026
61ec5c4
Separate thread and microblog paths.
olorin99 Jan 27, 2026
189c21b
Fix markdown editor unbounded height.
olorin99 Jan 27, 2026
8727211
Update oauth redirect to work with web.
olorin99 Jan 28, 2026
012f6e3
Add hero tags to user and explore screen FABs to fix 'multiple heros …
olorin99 Jan 29, 2026
28b8134
dart format
olorin99 Jan 29, 2026
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
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ android {
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

coreLibraryDesugaringEnabled true
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = JavaVersion.VERSION_11
}

defaultConfig {
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-all.zip
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.6.0" apply false
id "com.android.application" version "8.9.1" apply false
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
}

Expand Down
8 changes: 4 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:io';
import 'dart:math';

import 'package:flutter/foundation.dart';
Expand All @@ -7,6 +6,7 @@ import 'package:interstellar/src/controller/controller.dart';
import 'package:interstellar/src/controller/database.dart';
import 'package:interstellar/src/utils/http_client.dart';
import 'package:interstellar/src/utils/globals.dart';
import 'package:interstellar/src/utils/utils.dart';
import 'package:interstellar/src/widgets/markdown/drafts_controller.dart';
import 'package:media_kit/media_kit.dart';
import 'package:package_info_plus/package_info_plus.dart';
Expand All @@ -25,15 +25,15 @@ void main() async {

await initDatabase();

if (Platform.isLinux || Platform.isMacOS || Platform.isWindows) {
if (PlatformUtils.isDesktop) {
await windowManager.ensureInitialized();

// Get smallest dimensions of available displays and set minimum window
// size to be a 16th of those dimensions.
final screenSize = PlatformDispatcher.instance.displays
.map((display) => display.size)
.reduce((a, b) => Size(min(a.width, b.width), min(a.height, b.height)));
final minWindowSize = screenSize / 4;
final minWindowSize = screenSize / 8;//4;

WindowOptions windowOptions = WindowOptions(minimumSize: minWindowSize);

Expand Down Expand Up @@ -75,7 +75,7 @@ void main() async {
return false;
};

if (Platform.isAndroid) {
if (PlatformUtils.isAndroid) {
await initPushNotifications(ac);
}

Expand Down
53 changes: 28 additions & 25 deletions lib/src/api/bookmark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,35 @@ class APIBookmark {

APIBookmark(this.client);

Future<(List<Object>, String?)> list({
String? list,
String? page,
}) async {
Future<(List<Object>, String?)> list({String? list, String? page}) async {
switch (client.software) {
case ServerSoftware.mbin:
const path = '/bookmark-lists/show';
final query = {
'list': list,
'sort': 'newest',
'p': page,
};
final query = {'list': list, 'sort': 'newest', 'p': page};

final response = await client.get(path, queryParams: query);

final json = response.bodyJson;
final itemList = json['items'] as List<dynamic>;
final items = itemList.map((item) {
var itemType = item['itemType'];
if (itemType == 'entry') {
return PostModel.fromMbinEntry(item as JsonMap);
} else if (itemType == 'post') {
return PostModel.fromMbinPost(item as JsonMap);
} else if (itemType == 'entry_comment' || itemType == 'post_comment') {
return CommentModel.fromMbin(item as JsonMap);
}
}).nonNulls.toList();

return (items, mbinCalcNextPaginationPage(json['pagination'] as JsonMap));
final items = itemList
.map((item) {
var itemType = item['itemType'];
if (itemType == 'entry') {
return PostModel.fromMbinEntry(item as JsonMap);
} else if (itemType == 'post') {
return PostModel.fromMbinPost(item as JsonMap);
} else if (itemType == 'entry_comment' ||
itemType == 'post_comment') {
return CommentModel.fromMbin(item as JsonMap);
}
})
.nonNulls
.toList();

return (
items,
mbinCalcNextPaginationPage(json['pagination'] as JsonMap),
);

case ServerSoftware.lemmy:
const postsPath = '/post/list';
Expand All @@ -81,7 +81,7 @@ class APIBookmark {

final [postResponse, commentResponse] = await Future.wait([
client.get(postsPath, queryParams: query),
client.get(commentsPath, queryParams: query)
client.get(commentsPath, queryParams: query),
]);

final postJson = postResponse.bodyJson;
Expand All @@ -98,15 +98,18 @@ class APIBookmark {

final postLists = PostListModel.fromLemmy(
postJson,
langCodeIdPairs: await client.languageCodeIdPairs()
langCodeIdPairs: await client.languageCodeIdPairs(),
);

final commentLists = CommentListModel.fromLemmyToFlat(
commentJson,
langCodeIdPairs: await client.languageCodeIdPairs()
langCodeIdPairs: await client.languageCodeIdPairs(),
);

return ([...postLists.items, ...commentLists.items], postLists.nextPage);
return (
[...postLists.items, ...commentLists.items],
postLists.nextPage,
);

case ServerSoftware.piefed:
throw UnimplementedError('Unimplemented');
Expand Down
3 changes: 1 addition & 2 deletions lib/src/api/community_moderation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ class APICommunityModeration {
'community_id': communityId,
'user_id': userId,
'reason': reason,
if (expiredAt != null)
'expires_at': expiredAt.toIso8601String(),
if (expiredAt != null) 'expires_at': expiredAt.toIso8601String(),
};

final response = await client.post(path, body: body);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/api/feed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class APIFeed {
final path = '/${topics ? 'topic' : 'feed'}/list';
final query = {
if (!topics) 'mine_only': mineOnly.toString(),
'include_communities': includeCommunities.toString()
'include_communities': includeCommunities.toString(),
};

final response = await client.get(path, queryParams: query);
Expand Down
178 changes: 148 additions & 30 deletions lib/src/api/feed_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@ import 'package:interstellar/src/controller/server.dart';
enum FeedView {
threads(icon: Symbols.feed_rounded),
microblog(software: ServerSoftware.mbinFlag, icon: Symbols.chat_rounded),
combined(software: ServerSoftware.mbinFlag, icon: Symbols.view_timeline_rounded);
combined(
software: ServerSoftware.mbinFlag,
icon: Symbols.view_timeline_rounded,
);

const FeedView({this.software = ServerSoftware.mbinFlag | ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag, this.icon});
const FeedView({
this.software =
ServerSoftware.mbinFlag |
ServerSoftware.piefedFlag |
ServerSoftware.lemmyFlag,
this.icon,
});

final int software;
final IconData? icon;
Expand All @@ -24,8 +33,9 @@ enum FeedView {
List<FeedView> values = FeedView.values,
required int software,
}) {
return values.where(
(item) => (item.software & software) == software,).toList();
return values
.where((item) => (item.software & software) == software)
.toList();
}
}

Expand Down Expand Up @@ -64,34 +74,142 @@ enum FeedSort {
top(icon: Symbols.trending_up_rounded),
newest(icon: Symbols.nest_eco_leaf_rounded),
active(icon: Symbols.rocket_launch_rounded),
commented(software: ServerSoftware.mbinFlag | ServerSoftware.lemmyFlag, icon: Symbols.chat_rounded),
oldest(software: ServerSoftware.mbinFlag | ServerSoftware.lemmyFlag, icon: Symbols.access_time_rounded),
scaled(software: ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag, icon: Symbols.scale_rounded),
newComments(software: ServerSoftware.lemmyFlag, icon: Symbols.mark_chat_unread_rounded),
controversial(software: ServerSoftware.lemmyFlag, icon: Symbols.thumbs_up_down_rounded),

topHour(software: ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag, parent: FeedSort.top, icon: Symbols.trending_up_rounded),
topThreeHour(software: ServerSoftware.mbinFlag, parent: FeedSort.top, icon: Symbols.trending_up_rounded),
topSixHour(software: ServerSoftware.mbinFlag | ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag, parent: FeedSort.top, icon: Symbols.trending_up_rounded),
topTwelveHour(software: ServerSoftware.mbinFlag | ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag, parent: FeedSort.top, icon: Symbols.trending_up_rounded),
topDay(software: ServerSoftware.mbinFlag | ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag, parent: FeedSort.top, icon: Symbols.trending_up_rounded),
topWeek(software: ServerSoftware.mbinFlag | ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag, parent: FeedSort.top, icon: Symbols.trending_up_rounded),
topMonth(software: ServerSoftware.mbinFlag | ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag, parent: FeedSort.top, icon: Symbols.trending_up_rounded),
topThreeMonths(software: ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag, parent: FeedSort.top, icon: Symbols.trending_up_rounded),
topSixMonths(software: ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag, parent: FeedSort.top, icon: Symbols.trending_up_rounded),
topNineMonths(software: ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag, parent: FeedSort.top, icon: Symbols.trending_up_rounded),
topYear(software: ServerSoftware.mbinFlag | ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag, parent: FeedSort.top, icon: Symbols.trending_up_rounded),

commentedThreeHour(software: ServerSoftware.mbinFlag, parent: FeedSort.commented, icon: Symbols.chat_rounded),
commentedSixHour(software: ServerSoftware.mbinFlag, parent: FeedSort.commented, icon: Symbols.chat_rounded),
commentedTwelveHour(software: ServerSoftware.mbinFlag, parent: FeedSort.commented, icon: Symbols.chat_rounded),
commentedDay(software: ServerSoftware.mbinFlag, parent: FeedSort.commented, icon: Symbols.chat_rounded),
commentedWeek(software: ServerSoftware.mbinFlag, parent: FeedSort.commented, icon: Symbols.chat_rounded),
commentedMonth(software: ServerSoftware.mbinFlag, parent: FeedSort.commented, icon: Symbols.chat_rounded),
commentedYear(software: ServerSoftware.mbinFlag, parent: FeedSort.commented, icon: Symbols.chat_rounded);
commented(
software: ServerSoftware.mbinFlag | ServerSoftware.lemmyFlag,
icon: Symbols.chat_rounded,
),
oldest(
software: ServerSoftware.mbinFlag | ServerSoftware.lemmyFlag,
icon: Symbols.access_time_rounded,
),
scaled(
software: ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag,
icon: Symbols.scale_rounded,
),
newComments(
software: ServerSoftware.lemmyFlag,
icon: Symbols.mark_chat_unread_rounded,
),
controversial(
software: ServerSoftware.lemmyFlag,
icon: Symbols.thumbs_up_down_rounded,
),

topHour(
software: ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag,
parent: FeedSort.top,
icon: Symbols.trending_up_rounded,
),
topThreeHour(
software: ServerSoftware.mbinFlag,
parent: FeedSort.top,
icon: Symbols.trending_up_rounded,
),
topSixHour(
software:
ServerSoftware.mbinFlag |
ServerSoftware.piefedFlag |
ServerSoftware.lemmyFlag,
parent: FeedSort.top,
icon: Symbols.trending_up_rounded,
),
topTwelveHour(
software:
ServerSoftware.mbinFlag |
ServerSoftware.piefedFlag |
ServerSoftware.lemmyFlag,
parent: FeedSort.top,
icon: Symbols.trending_up_rounded,
),
topDay(
software:
ServerSoftware.mbinFlag |
ServerSoftware.piefedFlag |
ServerSoftware.lemmyFlag,
parent: FeedSort.top,
icon: Symbols.trending_up_rounded,
),
topWeek(
software:
ServerSoftware.mbinFlag |
ServerSoftware.piefedFlag |
ServerSoftware.lemmyFlag,
parent: FeedSort.top,
icon: Symbols.trending_up_rounded,
),
topMonth(
software:
ServerSoftware.mbinFlag |
ServerSoftware.piefedFlag |
ServerSoftware.lemmyFlag,
parent: FeedSort.top,
icon: Symbols.trending_up_rounded,
),
topThreeMonths(
software: ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag,
parent: FeedSort.top,
icon: Symbols.trending_up_rounded,
),
topSixMonths(
software: ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag,
parent: FeedSort.top,
icon: Symbols.trending_up_rounded,
),
topNineMonths(
software: ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag,
parent: FeedSort.top,
icon: Symbols.trending_up_rounded,
),
topYear(
software:
ServerSoftware.mbinFlag |
ServerSoftware.piefedFlag |
ServerSoftware.lemmyFlag,
parent: FeedSort.top,
icon: Symbols.trending_up_rounded,
),

commentedThreeHour(
software: ServerSoftware.mbinFlag,
parent: FeedSort.commented,
icon: Symbols.chat_rounded,
),
commentedSixHour(
software: ServerSoftware.mbinFlag,
parent: FeedSort.commented,
icon: Symbols.chat_rounded,
),
commentedTwelveHour(
software: ServerSoftware.mbinFlag,
parent: FeedSort.commented,
icon: Symbols.chat_rounded,
),
commentedDay(
software: ServerSoftware.mbinFlag,
parent: FeedSort.commented,
icon: Symbols.chat_rounded,
),
commentedWeek(
software: ServerSoftware.mbinFlag,
parent: FeedSort.commented,
icon: Symbols.chat_rounded,
),
commentedMonth(
software: ServerSoftware.mbinFlag,
parent: FeedSort.commented,
icon: Symbols.chat_rounded,
),
commentedYear(
software: ServerSoftware.mbinFlag,
parent: FeedSort.commented,
icon: Symbols.chat_rounded,
);

const FeedSort({
this.software = ServerSoftware.mbinFlag | ServerSoftware.piefedFlag | ServerSoftware.lemmyFlag,
this.software =
ServerSoftware.mbinFlag |
ServerSoftware.piefedFlag |
ServerSoftware.lemmyFlag,
this.parent,
this.icon,
});
Expand Down
Loading
Loading