happy ending

This commit is contained in:
baroni31
2026-05-20 22:08:30 +01:00
parent 3b93cffd38
commit 20f3c821ca
24 changed files with 60 additions and 56 deletions

View File

@@ -3,17 +3,16 @@ import 'package:supabase_flutter/supabase_flutter.dart';
class SupabaseConfig {
const SupabaseConfig._();
static const _url = String.fromEnvironment('SUPABASE_URL');
static const _anonKey = String.fromEnvironment('SUPABASE_ANON_KEY');
static const _url = String.fromEnvironment(
'SUPABASE_URL',
defaultValue: 'https://vnpqjabecckhtceggtgx.supabase.co',
);
static const _anonKey = String.fromEnvironment(
'SUPABASE_ANON_KEY',
defaultValue: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZucHFqYWJlY2NraHRjZWdndGd4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzkzMDM5MTAsImV4cCI6MjA5NDg3OTkxMH0.pcHmcLNQrc3cvZPYZ8eu-A7Me_HZt9I2Brwo-k6w35A',
);
static Future<void> initialize() async {
if (_url.isEmpty || _anonKey.isEmpty) {
throw StateError(
'Missing Supabase env values. Provide SUPABASE_URL and SUPABASE_ANON_KEY '
'using --dart-define.',
);
}
await Supabase.initialize(
url: _url,
anonKey: _anonKey,

View File

@@ -10,7 +10,7 @@ import '../../features/auth/presentation/screens/login_screen.dart';
import '../../features/auth/presentation/screens/signup_screen.dart';
import '../../features/admin/presentation/screens/admin_screen.dart';
import '../../features/discover/presentation/pages/discover_page.dart';
import '../../features/feed/presentation/screens/feed_screen.dart';
import '../../features/home/presentation/pages/home_page.dart';
import '../../features/feed/presentation/screens/upload_post_screen.dart';
import '../../features/music/presentation/pages/music_page.dart';
import '../../features/profile/presentation/pages/profile_page.dart';
@@ -24,7 +24,7 @@ final appRouterProvider = Provider<GoRouter>((ref) {
final authStateStream = client.auth.onAuthStateChange;
return GoRouter(
initialLocation: AppRoutes.splash,
initialLocation: AppRoutes.home,
refreshListenable: GoRouterRefreshStream(authStateStream),
routes: [
GoRoute(
@@ -45,7 +45,7 @@ final appRouterProvider = Provider<GoRouter>((ref) {
),
GoRoute(
path: AppRoutes.home,
builder: (context, state) => const FeedScreen(),
builder: (context, state) => const HomePage(),
),
GoRoute(
path: AppRoutes.uploadPost,

View File

@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'app_colors.dart';
import 'app_typography.dart';
import 'app_motion.dart';
class AppTheme {
const AppTheme._();
@@ -96,7 +95,7 @@ class AppTheme {
// Navigation Bar - Custom Riotz Feel
navigationBarTheme: NavigationBarThemeData(
backgroundColor: AppColors.black,
indicatorColor: AppColors.neonRed.withOpacity(0.1),
indicatorColor: AppColors.neonRed.withValues(alpha: 0.1),
labelTextStyle: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.selected)) {
return textTheme.bodySmall?.copyWith(color: AppColors.neonRed, fontWeight: FontWeight.bold);

View File

@@ -35,7 +35,7 @@ class RiotzScaffold extends StatelessWidget {
end: Alignment.bottomCenter,
colors: [
AppColors.black,
AppColors.deepRed.withOpacity(0.05),
AppColors.deepRed.withValues(alpha: 0.05),
AppColors.black,
],
),

View File

@@ -4,7 +4,6 @@ import 'package:go_router/go_router.dart';
import '../../../../core/theme/app_colors.dart';
import '../../../../core/widgets/riotz_scaffold.dart';
import '../../../../core/widgets/riotz_button.dart';
import '../../../music/domain/models/track_model.dart';
import '../providers/admin_providers.dart';
import '../../domain/models/admin_user_model.dart';
@@ -15,7 +14,6 @@ class AdminScreen extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final theme = Theme.of(context);
final dataAsync = ref.watch(adminPanelDataProvider);
ref.listen(adminControllerProvider, (_, next) {
@@ -163,7 +161,7 @@ class _AdminTrackCard extends ConsumerWidget {
subtitle: Text('BY: ${track.username.toUpperCase()}', style: const TextStyle(fontSize: 10, color: AppColors.grey)),
trailing: Switch(
value: track.featured,
activeColor: AppColors.success,
activeThumbColor: AppColors.success,
onChanged: (val) {
ref.read(adminControllerProvider.notifier).setTrackFeatured(trackId: track.id, featured: val);
},
@@ -207,7 +205,7 @@ class _AdminPostCard extends ConsumerWidget {
const Spacer(),
Switch(
value: post.featured,
activeColor: AppColors.neonRed,
activeThumbColor: AppColors.neonRed,
onChanged: (val) {
ref.read(adminControllerProvider.notifier).setPostFeatured(postId: post.id, featured: val);
},

View File

@@ -11,13 +11,13 @@ final authServiceProvider = Provider<AuthService>((ref) {
final authStateChangesProvider = StreamProvider<AuthState>((ref) {
final service = ref.watch(authServiceProvider);
return service.authStateChanges();
return service.onAuthStateChange;
});
final currentSessionProvider = StreamProvider<Session?>((ref) async* {
final service = ref.watch(authServiceProvider);
yield service.currentSession;
await for (final event in service.authStateChanges()) {
await for (final event in service.onAuthStateChange) {
yield event.session;
}
});

View File

@@ -27,7 +27,6 @@ class _DiscoverPageState extends ConsumerState<DiscoverPage> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final discoverAsync = ref.watch(discoverDataProvider);
return RiotzScaffold(
@@ -225,7 +224,7 @@ class _DiscoveryGridTile extends StatelessWidget {
right: 0,
child: Container(
padding: const EdgeInsets.all(8),
color: AppColors.black.withOpacity(0.7),
color: AppColors.black.withValues(alpha: 0.7),
child: Text(
post.username.toUpperCase(),
style: const TextStyle(fontSize: 10, fontWeight: FontWeight.bold),

View File

@@ -15,7 +15,6 @@ class DiscoverScreen extends ConsumerStatefulWidget {
class _DiscoverScreenState extends ConsumerState<DiscoverScreen> {
final _searchController = TextEditingController();
String _query = '';
@override
void dispose() {
@@ -43,7 +42,7 @@ class _DiscoverScreenState extends ConsumerState<DiscoverScreen> {
prefixIcon: Icon(Icons.search, color: AppColors.white),
hintText: 'SEARCH THE VOID...',
),
onChanged: (value) => setState(() => _query = value.trim()),
onChanged: (_) {},
),
const SizedBox(height: 32),
discoverAsync.when(

View File

@@ -45,7 +45,7 @@ class PostCard extends StatelessWidget {
? CachedNetworkImage(
imageUrl: post.avatarUrl,
fit: BoxFit.cover,
errorWidget: (_, __, ___) => const Icon(Icons.person, color: AppColors.grey),
errorWidget: (_, _, _) => const Icon(Icons.person, color: AppColors.grey),
)
: const Icon(Icons.person, color: AppColors.grey),
),

View File

@@ -127,7 +127,7 @@ class _HomePageState extends ConsumerState<HomePage> {
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: posts.length,
separatorBuilder: (_, __) => const SizedBox(height: 24),
separatorBuilder: (_, _) => const SizedBox(height: 24),
itemBuilder: (context, index) {
final post = posts[index];
return _FeedPostCard(