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

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a13c7fc
chore: extract out post widget
lishaduck Oct 17, 2024
f50f851
wip
lishaduck Oct 18, 2024
adec1de
refactor: clean
lishaduck Oct 18, 2024
8cb58cd
wip
MattsAttack Oct 18, 2024
d3200b9
wip still
MattsAttack Oct 18, 2024
3763453
local and world feed navigation bar
MattsAttack Oct 20, 2024
aa5c11b
wip. updated time value in posts (need to fix difference)
MattsAttack Oct 20, 2024
8c8dfda
rewrote to make difference return a positive value
MattsAttack Oct 20, 2024
49edc17
Added query to sort posts by newest first
MattsAttack Oct 20, 2024
658a023
fixed createPost creating posts in local instead of UTC
MattsAttack Oct 20, 2024
bbae75a
Fixed issues with posts date time.
MattsAttack Oct 20, 2024
3e70fb6
less redundant queries
MattsAttack Oct 20, 2024
85aa1d0
added authorName attribute to Appwrite that gets passed when creating…
MattsAttack Oct 20, 2024
0162fbe
user name attribute added to posts
MattsAttack Oct 20, 2024
b0b2fc4
Avatars!
MattsAttack Oct 21, 2024
af66913
responsive design :(
MattsAttack Oct 21, 2024
5fefa70
change to town talk
MattsAttack Oct 21, 2024
4b21269
wip
MattsAttack Oct 21, 2024
dd6681d
awesome ui changes
MattsAttack Oct 21, 2024
05a45d2
fixed map
MattsAttack Oct 22, 2024
0ee2597
chore(deps): update podfile
lishaduck Oct 23, 2024
f964266
feat: about page
lishaduck Oct 23, 2024
7c44d64
fix: routing coloring
lishaduck Oct 23, 2024
279dfb9
feat: rebrand
lishaduck Oct 23, 2024
b542f7a
Attempted to debug windows build
MattsAttack Nov 20, 2024
5d1fa80
Update melos.yaml
MattsAttack Nov 20, 2024
b3a9c41
Update packages/app/linux/CMakeLists.txt
MattsAttack Nov 20, 2024
078f905
Update packages/app/windows/CMakeLists.txt
MattsAttack Nov 20, 2024
5c74c51
revert CMake executable
MattsAttack Nov 21, 2024
dfbe43e
Changed avatar implementation.
MattsAttack Nov 21, 2024
a7ec715
fix avatar not being saved in local memory
MattsAttack Nov 21, 2024
de4d465
wip
MattsAttack Nov 21, 2024
f8b419a
Revert "wip"
MattsAttack Nov 22, 2024
872cdfd
fix: post scaling
MattsAttack Nov 22, 2024
75671e4
Test Fixes :)
MattsAttack Nov 22, 2024
df7062b
WIP: Like button
MattsAttack Nov 25, 2024
1207487
implement likes string list
MattsAttack Nov 25, 2024
f36979d
WIP: Likes. Need to fix getting post id in PostEntity
MattsAttack Nov 26, 2024
780a463
fix: getting ids in post entity
MattsAttack Nov 26, 2024
dce045b
comments :)
MattsAttack Nov 27, 2024
7152729
WIP: post likes( forgot to commit last week)
MattsAttack Dec 2, 2024
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"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I accidentally disabled errorSquiggles so i turned them back on. I thought it was a local setting

}
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: "TownTalk"

MattsAttack marked this conversation as resolved.
Show resolved Hide resolved
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/src/app/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ class _AppState extends ConsumerState<App> with RestorationMixin {

@override
Widget build(BuildContext context) {
// TODO(lishaduck): Hook into FlutterNativeSplash here.
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
3 changes: 2 additions & 1 deletion packages/app/lib/src/app/router.dart
Original file line number Diff line number Diff line change
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 Down
90 changes: 50 additions & 40 deletions packages/app/lib/src/app/wrapper_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import '../features/home/application/location_service.dart';
import '../features/home/data/post_repository.dart';
import '../features/home/domain/feed_entity.dart';
import '../utils/hooks.dart';
import 'router.gr.dart';

/// {@template our_democracy.app.wrapper_page}
Expand All @@ -32,9 +33,9 @@
Widget build(BuildContext context, WidgetRef ref) {
return AutoTabsScaffold(
routes: const [
LocalFeedRoute(),
FeedRoutingRoute(),
MapRoute(),
SettingsRoute(),
SettingsRoute(), // Make a new feed route page that has an app bar that routes between local and world
],
floatingActionButton: FloatingActionButton(
onPressed: () async => showDialog<void>(
Expand Down Expand Up @@ -96,7 +97,7 @@
label: 'Feeds',
),
NavigationDestination(
icon: Icon(Icons.location_on),
icon: Icon(Icons.map_outlined),
label: 'Discover',
),
NavigationDestination(
Expand All @@ -120,10 +121,11 @@

@override
Widget build(BuildContext context, WidgetRef ref) {
final formKey = useMemoized(GlobalKey<FormState>.new);
final formKey = useGlobalKey<FormState>();

Check warning on line 124 in packages/app/lib/src/app/wrapper_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper_page.dart#L124

Added line #L124 was not covered by tests
final title = useState('');
final description = useState('');
final id = ref.watch(authServiceProvider).requireValue?.$id;
final id = ref.watch(idProvider);
final username = ref.watch(usernameProvider);

Check warning on line 128 in packages/app/lib/src/app/wrapper_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper_page.dart#L127-L128

Added lines #L127 - L128 were not covered by tests

final handleSubmit = useCallback(
() async {
Expand All @@ -146,6 +148,7 @@
// TODO(MattsAttack): Find a way to handle null here.
id,
// TODO(lishaduck): This could be a whole lot less hacky.
username,
const FeedEntity.world(),
),
)
Expand All @@ -169,41 +172,48 @@
);

return Dialog(
insetPadding: const EdgeInsets.symmetric(horizontal: 64, vertical: 32),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Scaffold(
appBar: AppBar(
title: const Text('Create a New Post'),
),
body: Form(
key: formKey,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
children: [
TextFormField(
initialValue: title.value,
onSaved: (value) {
if (value == null) return;

title.value = value;
},
decoration: const InputDecoration(label: Text('Title')),
),
TextFormField(
initialValue: description.value,
onSaved: (value) {
if (value == null) return;

description.value = value;
},
decoration: const InputDecoration(label: Text('Description')),
),
ElevatedButton(
onPressed: handleSubmit,
child: const Text('Create Post'),
),
],
insetPadding: EdgeInsets.symmetric(
horizontal: MediaQuery.sizeOf(context).width / 8,
vertical: MediaQuery.sizeOf(context).height / 8,

Check warning on line 177 in packages/app/lib/src/app/wrapper_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper_page.dart#L175-L177

Added lines #L175 - L177 were not covered by tests
),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
child: Padding(

Check warning on line 180 in packages/app/lib/src/app/wrapper_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper_page.dart#L179-L180

Added lines #L179 - L180 were not covered by tests
padding: const EdgeInsets.all(40),
child: Scaffold(
appBar: AppBar(

Check warning on line 183 in packages/app/lib/src/app/wrapper_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper_page.dart#L182-L183

Added lines #L182 - L183 were not covered by tests
title: const Text('Create a New Post'),
),
body: Form(

Check warning on line 186 in packages/app/lib/src/app/wrapper_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper_page.dart#L186

Added line #L186 was not covered by tests
key: formKey,
child: Padding(

Check warning on line 188 in packages/app/lib/src/app/wrapper_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper_page.dart#L188

Added line #L188 was not covered by tests
padding: const EdgeInsets.all(16),
child: Column(
children: [
TextFormField(
initialValue: title.value,
onSaved: (value) {

Check warning on line 194 in packages/app/lib/src/app/wrapper_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper_page.dart#L190-L194

Added lines #L190 - L194 were not covered by tests
if (value == null) return;

title.value = value;

Check warning on line 197 in packages/app/lib/src/app/wrapper_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper_page.dart#L197

Added line #L197 was not covered by tests
},
decoration: const InputDecoration(label: Text('Title')),
),
TextFormField(
initialValue: description.value,
onSaved: (value) {

Check warning on line 203 in packages/app/lib/src/app/wrapper_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper_page.dart#L201-L203

Added lines #L201 - L203 were not covered by tests
if (value == null) return;

description.value = value;

Check warning on line 206 in packages/app/lib/src/app/wrapper_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper_page.dart#L206

Added line #L206 was not covered by tests
},
decoration:
const InputDecoration(label: Text('Description')),
),
ElevatedButton(

Check warning on line 211 in packages/app/lib/src/app/wrapper_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper_page.dart#L211

Added line #L211 was not covered by tests
onPressed: handleSubmit,
child: const Text('Create Post'),
),
],
),
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,19 @@
// ```dart
// return ref.watch(authServiceProvider).requireValue;
// ```

/// Get the current user's name.
///
/// Named as such to prevent a naming conflict with riverpod.
@riverpod

Check warning on line 61 in packages/app/lib/src/features/auth/application/auth_service.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/application/auth_service.dart#L61

Added line #L61 was not covered by tests
String? username(UsernameRef ref) =>
ref.watch(authServiceProvider).requireValue?.name;

Check warning on line 63 in packages/app/lib/src/features/auth/application/auth_service.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/application/auth_service.dart#L63

Added line #L63 was not covered by tests

/// Get the current user's email address.
@riverpod

Check warning on line 66 in packages/app/lib/src/features/auth/application/auth_service.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/application/auth_service.dart#L66

Added line #L66 was not covered by tests
String? email(EmailRef ref) =>
ref.watch(authServiceProvider).requireValue?.email;

Check warning on line 68 in packages/app/lib/src/features/auth/application/auth_service.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/application/auth_service.dart#L68

Added line #L68 was not covered by tests

/// Get the current user's email address.
@riverpod
String? id(IdRef ref) => ref.watch(authServiceProvider).requireValue?.$id;
Loading
Loading