Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fancy Posts #39

Merged
merged 53 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
90270b3
chore: extract out post widget
lishaduck Oct 17, 2024
cfdb5ad
wip
lishaduck Oct 18, 2024
489f518
refactor: clean
lishaduck Oct 18, 2024
a2ca95b
wip
MattsAttack Oct 18, 2024
1d77d24
wip still
MattsAttack Oct 18, 2024
3127e48
local and world feed navigation bar
MattsAttack Oct 20, 2024
5c555df
wip. updated time value in posts (need to fix difference)
MattsAttack Oct 20, 2024
f7fcd67
rewrote to make difference return a positive value
MattsAttack Oct 20, 2024
6f36ac6
Added query to sort posts by newest first
MattsAttack Oct 20, 2024
a04f0c8
fixed createPost creating posts in local instead of UTC
MattsAttack Oct 20, 2024
bfb4939
Fixed issues with posts date time.
MattsAttack Oct 20, 2024
1128983
less redundant queries
MattsAttack Oct 20, 2024
2ab7066
added authorName attribute to Appwrite that gets passed when creating…
MattsAttack Oct 20, 2024
b8a6428
user name attribute added to posts
MattsAttack Oct 20, 2024
4a56ca2
Avatars!
MattsAttack Oct 21, 2024
6bb6e4b
responsive design :(
MattsAttack Oct 21, 2024
216a679
change to town talk
MattsAttack Oct 21, 2024
c26f427
wip
MattsAttack Oct 21, 2024
75d585a
awesome ui changes
MattsAttack Oct 21, 2024
7172f99
fixed map
MattsAttack Oct 22, 2024
f8eba9e
chore(deps): update podfile
lishaduck Oct 23, 2024
727ff37
feat: about page
lishaduck Oct 23, 2024
b1a4dc9
fix: routing coloring
lishaduck Oct 23, 2024
b84e2f6
feat: rebrand
lishaduck Oct 23, 2024
9095561
Attempted to debug windows build
MattsAttack Nov 20, 2024
0df5c08
Update melos.yaml
MattsAttack Nov 20, 2024
a847290
Update packages/app/linux/CMakeLists.txt
MattsAttack Nov 20, 2024
54c3a28
Update packages/app/windows/CMakeLists.txt
MattsAttack Nov 20, 2024
61bd8bc
revert CMake executable
MattsAttack Nov 21, 2024
31b51fa
Changed avatar implementation.
MattsAttack Nov 21, 2024
dd46b1c
fix avatar not being saved in local memory
MattsAttack Nov 21, 2024
6756028
wip
MattsAttack Nov 21, 2024
bf50fe0
Revert "wip"
MattsAttack Nov 22, 2024
bb11bbd
fix: post scaling
MattsAttack Nov 22, 2024
d2000eb
Test Fixes :)
MattsAttack Nov 22, 2024
6d38365
WIP: Like button
MattsAttack Nov 25, 2024
53f92ed
implement likes string list
MattsAttack Nov 25, 2024
f387e9b
WIP: Likes. Need to fix getting post id in PostEntity
MattsAttack Nov 26, 2024
eba9152
fix: getting ids in post entity
MattsAttack Nov 26, 2024
9c62d37
comments :)
MattsAttack Nov 27, 2024
e45e2e3
WIP: post likes( forgot to commit last week)
MattsAttack Dec 2, 2024
ab2a9df
fixed typo
MattsAttack Dec 27, 2024
42351bf
working local likes logic. need to connect to db
MattsAttack Dec 27, 2024
99f9067
mostly working like buttons
MattsAttack Dec 27, 2024
e421821
eli fixes
MattsAttack Dec 27, 2024
e4fdf37
basic post view
MattsAttack Dec 30, 2024
b082aa7
added conditional to prevent user from clicking on post in post view
MattsAttack Dec 30, 2024
e4a58cc
feat: improved post view ui
MattsAttack Dec 31, 2024
c3f261d
fix: lints, etc
lishaduck Jan 6, 2025
1a4f57f
feat: docs
MattsAttack Jan 7, 2025
2b485f7
feat: docs (missed one)
MattsAttack Jan 7, 2025
7c8db9e
chore: cleanup
lishaduck Jan 7, 2025
bda8374
fix: likes
lishaduck Jan 8, 2025
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
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "dart",
"program": "packages/app/lib/main.dart",
"flutterMode": "debug",
"toolArgs": ["--dart-define=FLUTTER_WEB_DEBUG_SHOW_SEMANTICS=true"]
"toolArgs": ["--dart-define=FLUTTER_WEB_DEBUG_SHOW_SEMANTICS=true", ]
}
]
}
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,8 @@
},

// Pin CI for the current branch to the status bar.
"github-actions.workflows.pinned.workflows": [".github/workflows/ci.yaml"]
"github-actions.workflows.pinned.workflows": [
".github/workflows/ci.yaml"
],
"C_Cpp.errorSquiggles": "enabled"
MattsAttack marked this conversation as resolved.
Show resolved Hide resolved
}
2 changes: 1 addition & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "nexus"
name: "town_talk"

packages:
- packages/**
Expand Down
2 changes: 1 addition & 1 deletion packages/app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="Nexus"
android:label="Town Talk"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon">
<activity
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/app/android/app/src/main/res/drawable/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<item name="android:windowFullscreen">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowSplashScreenBackground">#134011</item>
<item name="android:windowSplashScreenBackground">#2e2e2e</item>
<item name="android:windowSplashScreenIconBackgroundColor">#111111</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<item name="android:windowFullscreen">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowSplashScreenBackground">#0a9f06</item>
<item name="android:windowSplashScreenBackground">#2e2e2e</item>
<item name="android:windowSplashScreenIconBackgroundColor">#111111</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
Expand Down
Binary file modified packages/app/assets/icons/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/app/assets/pictures/login_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/app/assets/pictures/old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion packages/app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ PODS:
- Flutter
- flutter_web_auth_2 (3.0.0):
- Flutter
- geolocator_apple (1.2.0):
- Flutter
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
Expand All @@ -22,6 +24,7 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
- flutter_web_auth_2 (from `.symlinks/plugins/flutter_web_auth_2/ios`)
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
Expand All @@ -36,6 +39,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_native_splash/ios"
flutter_web_auth_2:
:path: ".symlinks/plugins/flutter_web_auth_2/ios"
geolocator_apple:
:path: ".symlinks/plugins/geolocator_apple/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
Expand All @@ -50,7 +55,8 @@ SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_native_splash: edf599c81f74d093a4daf8e17bd7a018854bc778
flutter_web_auth_2: 051cf9f5dc366f31b5dcc4e2952c2b954767be8a
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
geolocator_apple: 6cbaf322953988e009e5ecb481f07efece75c450
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/app/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Nexus</string>
<string>Town Talk</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>nexus</string>
<string>Town Talk</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
Expand Down
3 changes: 3 additions & 0 deletions packages/app/lib/env/env.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/// This file lists environment variables expected to be available at compile time.
library;

import 'package:envied/envied.dart';

part 'env.g.dart';
Expand Down
8 changes: 6 additions & 2 deletions packages/app/lib/src/app/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import '../utils/design.dart';
import '../utils/router.dart';
import 'bootstrap.dart';

/// {@template our_democracy.app}
/// {@template nexus.app}
/// The widget that configures your application.
/// {@endtemplate}
class App extends ConsumerStatefulWidget with Bootstrap {
/// {@macro our_democracy.app}
/// {@macro nexus.app}
///
/// Construct a new [App] widget.
const App({
Expand All @@ -39,6 +39,8 @@ class _AppState extends ConsumerState<App> with RestorationMixin {
Widget build(BuildContext context) {
return _EagerInitialization(
child: MaterialApp.router(
debugShowCheckedModeBanner: false,

// Providing a `restorationScopeId` allows the Navigator built by the
// `MaterialApp` to restore the navigation stack when a user leaves and
// returns to the app after it has been killed while running in the
Expand Down Expand Up @@ -100,6 +102,8 @@ class _EagerInitialization extends ConsumerWidget {
textDirection: TextDirection.ltr,
child: Text('Error: $error'),
),

// TODO(lishaduck): Hook into `FlutterNativeSplash` here.
_ => const CircularProgressIndicator(),
},
),
Expand Down
33 changes: 19 additions & 14 deletions packages/app/lib/src/app/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'router.gr.dart';
@AutoRouterConfig(replaceInRouteName: 'Page,Route', deferredLoading: true)
class AppRouter extends RootStackRouter {
/// Instantiate a new instance of [AppRouter].
AppRouter(this.ref); //creates a ref so we can use riverpod
AppRouter(this.ref); // A [Ref] so that we can use Riverpod.

/// Used in the guard to get the [authServiceProvider].
Ref ref;
Expand Down Expand Up @@ -42,8 +42,9 @@ class AppRouter extends RootStackRouter {
title: (context, data) => 'Settings',
),
AutoRoute(
page: const EmptyShellRoute('Feeds'),
page: FeedRoutingRoute.page,
path: '',
title: (context, data) => 'Feeds',
children: [
AutoRoute(
page: LocalFeedRoute.page,
Expand All @@ -60,16 +61,21 @@ class AppRouter extends RootStackRouter {
),
],
),
AutoRoute(
page: PostViewRoute.page,
path: '/post',
title: (context, data) => 'Post',
),
AutoRoute(
// TODO(lishaduck): Add a guard to prevent logged in users from accessing this page.
page: LoginRoute.page,
page: LogInRoute.page,
path: '/log-in',
title: (context, data) => 'Login',
title: (context, data) => 'Log In',
keepHistory: false,
),
AutoRoute(
// TODO(lishaduck): Add a guard to prevent logged in users from accessing this page.
page: SignupRoute.page,
page: SignUpRoute.page,
path: '/sign-up',
title: (context, data) => 'Sign Up',
),
Expand All @@ -79,25 +85,24 @@ class AppRouter extends RootStackRouter {
@override
List<AutoRouteGuard> get guards => [
/*
How this guard works:
1. The guard contacts the `authRepositoryProvider` to check if the user is logged in. If they it allows them to go to the requested page
2. Else send user to login page with and save the page the user wanted to go to in the onResult function.
3. Once the user successfully logs in in the login_page the didLogIn value is set to true and onResult function is ran sending them to their requested page
*/
* How this guard works:
* 1. The guard contacts the `authRepositoryProvider` to check if the user is logged in. If they are, it allows them to go to the requested page.
* 2. Otherwise, we’ll send the user to the “log in” page and save the original page the user wanted to go to in the `onResult` closure.
* 3. Once the user successfully logs in, `didLogIn` is set to `true` and `onResult` is run, sending them to their originally requested page.
*/
AutoRouteGuard.simple((resolver, router) async {
final authenticated = ref.read(authServiceProvider).requireValue;

if (
// TODO(MattsAttack): check implementation, is this right?
authenticated != null ||
// If the user is trying to log in or sign up, let them through.
resolver.routeName == LoginRoute.name ||
resolver.routeName == SignupRoute.name) {
// TODO(MattsAttack): Add in support for... something.
resolver.routeName == LogInRoute.name ||
resolver.routeName == SignUpRoute.name) {
resolver.next();
} else {
await resolver.redirect(
LoginRoute(
LogInRoute(
// The parameter brings them back to the page they were trying to access.
onResult: ({
// AutoRoute is buggy here, this is actually required.
Expand Down
Loading
Loading