Skip to content

Commit

Permalink
Wheyyy
Browse files Browse the repository at this point in the history
  • Loading branch information
JAicewizard committed May 8, 2024
1 parent 3706ad2 commit 6b3c7e4
Show file tree
Hide file tree
Showing 20 changed files with 6 additions and 1,083 deletions.
3 changes: 0 additions & 3 deletions integration_test/album_screen_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ void testAlbum(IntegrationTestWidgetsFlutterBinding binding) {
'mock',
false,
false,
coverphoto1,
[albumphoto1],
),
),
Expand All @@ -143,7 +142,6 @@ void testAlbum(IntegrationTestWidgetsFlutterBinding binding) {
'MOcK2',
false,
false,
coverphoto1,
[albumphoto1, albumphoto2],
),
),
Expand All @@ -157,7 +155,6 @@ void testAlbum(IntegrationTestWidgetsFlutterBinding binding) {
'MOcK2',
false,
false,
coverphoto1,
[albumphoto1, albumphoto2],
);

Expand Down
2 changes: 0 additions & 2 deletions lib/blocs.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export 'blocs/album_cubit.dart';
export 'blocs/album_list_cubit.dart';
export 'blocs/auth_cubit.dart';
export 'blocs/detail_state.dart';
export 'blocs/list_state.dart';
export 'blocs/welcome_cubit.dart';
56 changes: 0 additions & 56 deletions lib/blocs/album_cubit.dart

This file was deleted.

117 changes: 0 additions & 117 deletions lib/blocs/welcome_cubit.dart

This file was deleted.

4 changes: 0 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,6 @@ class _ThaliAppState extends State<ThaliApp> {
value: apiRepository,
child: MultiBlocProvider(
providers: [
BlocProvider(
create: (_) => WelcomeCubit(apiRepository)..load(),
lazy: false,
),
BlocProvider(
create: (_) => AlbumListCubit(apiRepository)..load(),
lazy: false,
Expand Down
13 changes: 5 additions & 8 deletions lib/models/album.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ class ListAlbum {
final String title;
final bool accessible;
final bool shareable;
final CoverPhoto? cover;

const ListAlbum(
this.slug, this.title, this.accessible, this.shareable, this.cover);
const ListAlbum(this.slug, this.title, this.accessible, this.shareable);

factory ListAlbum.fromJson(Map<String, dynamic> json) =>
_$ListAlbumFromJson(json);
Expand All @@ -35,15 +33,14 @@ class Album extends ListAlbum {
title ?? this.title,
accessible ?? this.accessible,
shareable ?? this.shareable,
cover ?? this.cover,
photos ?? this.photos,
);

const Album.fromlist(super.slug, super.title, super.accessible,
super.shareable, CoverPhoto super.cover, this.photos);
const Album.fromlist(
super.slug, super.title, super.accessible, super.shareable, this.photos);

const Album(super.slug, super.title, super.accessible, super.shareable,
super.cover, this.photos);
const Album(
super.slug, super.title, super.accessible, super.shareable, this.photos);

factory Album.fromJson(Map<String, dynamic> json) => _$AlbumFromJson(json);
}
46 changes: 0 additions & 46 deletions lib/routes.dart
Original file line number Diff line number Diff line change
@@ -1,41 +1,8 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:reaxit/models.dart';
import 'package:reaxit/ui/screens.dart';

final List<RouteBase> routes = [
GoRoute(
path: '/',
name: 'welcome',
pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
child: WelcomeScreen(),
transitionDuration: const Duration(milliseconds: 200),
transitionsBuilder: (context, animation, secondaryAnimation, child) {
return FadeTransition(
opacity: animation.drive(CurveTween(curve: Curves.easeIn)),
child: child,
);
},
),
),
GoRoute(
path: '/members/photos/liked',
redirect: (context, state) => '/albums/liked-photos',
),
GoRoute(
// This redirect is above the members route because
// the members path is a prefix of this albums path.
path: '/members/photos/:albumSlug',
redirect: (context, state) =>
'/albums/${state.pathParameters['albumSlug']}',
),
GoRoute(
// This redirect is above the members route because
// the members path is a prefix of this albums path.
path: '/members/photos',
redirect: (context, state) => '/albums',
),
GoRoute(
path: '/albums',
name: 'albums',
Expand All @@ -50,18 +17,5 @@ final List<RouteBase> routes = [
);
},
),
routes: [
GoRoute(
path: ':albumSlug',
name: 'album',
pageBuilder: (context, state) => MaterialPage(
key: state.pageKey,
child: AlbumScreen(
slug: state.pathParameters['albumSlug']!,
album: state.extra as ListAlbum?,
),
),
),
],
),
];
2 changes: 0 additions & 2 deletions lib/ui/screens.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export 'screens/album_screen.dart';
export 'screens/albums_screen.dart';
export 'screens/welcome_screen.dart';
Loading

0 comments on commit 6b3c7e4

Please sign in to comment.