Skip to content

Commit

Permalink
fix: License page issue & rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
wizlif committed Oct 10, 2022
1 parent e8578fe commit 6b5ee08
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 18 deletions.
6 changes: 3 additions & 3 deletions lib/presentation/auth/auth_screen.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'package:auto_route/auto_route.dart';
import 'package:collaction_app/application/user/profile/profile_bloc.dart';
import 'package:dots_indicator/dots_indicator.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';

import '../../application/auth/auth_bloc.dart';
import '../../infrastructure/core/injection.dart';
import '../routes/app_routes.gr.dart';
import '../core/routes/app_page.dart';
import '../shared_widgets/custom_app_bars/custom_appbar.dart';
import '../themes/constants.dart';
import '../utils/context.ext.dart';
Expand Down Expand Up @@ -125,7 +125,7 @@ class _AuthPageState extends State<AuthPage> {
}

void _authDone(BuildContext context) =>
context.router.replaceAll([const VerifiedRoute()]);
context.replace(AppPage.verified.toPath);

void _toPage(int page) => _pageController.animateToPage(
page,
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/auth/widgets/profile_photo.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'dart:io';

import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';

import '../../../application/auth/auth_bloc.dart';
import '../../../application/user/avatar/avatar_bloc.dart';
Expand Down Expand Up @@ -43,7 +43,7 @@ class _SelectProfilePhotoState extends State<SelectProfilePhoto> {
/// TODO: Loading indication
},
uploadSuccess: () {
context.router.pop();
context.pop();
},
uploadFailed: () {
/// TODO: Show error snackbar | Implement failures
Expand Down
8 changes: 4 additions & 4 deletions lib/presentation/auth/widgets/verified.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import 'package:auto_route/auto_route.dart';
import 'package:collaction_app/application/user/profile/profile_bloc.dart';
import 'package:collaction_app/infrastructure/core/injection.dart';
import 'package:collaction_app/presentation/shared_widgets/shimmers/title_shimmer_line.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:rive/rive.dart';
import 'package:shimmer/shimmer.dart';

import '../../routes/app_routes.gr.dart';
import '../../core/routes/app_page.dart';
import '../../shared_widgets/pill_button.dart';
import '../../themes/constants.dart';

Expand Down Expand Up @@ -81,12 +81,12 @@ class VerifiedPage extends StatelessWidget {
const SizedBox(height: 40),
PillButton(
onTap: () =>
context.router.replaceAll([const HomeRoute()]),
context.replace(AppPage.home.toPath),
text: 'Go to CrowdActions',
),
TextButton(
onPressed: () =>
context.router.replaceAll([const HomeRoute()]),
context.replace(AppPage.home.toPath),
child: const Text(
'Show me all CrowdActions',
style: TextStyle(
Expand Down
11 changes: 10 additions & 1 deletion lib/presentation/core/routes/router.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:collaction_app/domain/core/i_settings_repository.dart';
import 'package:collaction_app/presentation/crowdaction/crowdaction_participants/crowdaction_participants_screen.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

Expand All @@ -13,6 +14,7 @@ import '../../demo/components_demo/components_demo_screen.dart';
import '../../demo/demo_screen.dart';
import '../../home/captive_screen.dart';
import '../../home/home_screen.dart';
import '../../licenses/licenses_page.dart';
import '../../onboarding/onboarding_screen.dart';
import '../../profile/profile_screen.dart';
import '../../settings/settings_layout.dart';
Expand Down Expand Up @@ -71,6 +73,13 @@ class AppRouter {
);
},
),
GoRoute(
path: AppPage.crowdActionParticipants.toPath,
parentNavigatorKey: _rootNavigatorKey,
builder: (_, state) => CrowdActionParticipantsPage(
crowdActionId: state.extra! as String,
),
),
GoRoute(
path: AppPage.onBoarding.toPath,
parentNavigatorKey: _rootNavigatorKey,
Expand Down Expand Up @@ -104,7 +113,7 @@ class AppRouter {
GoRoute(
path: AppPage.licenses.toPath,
parentNavigatorKey: _rootNavigatorKey,
builder: (_, __) => const LicensePage(),
builder: (_, __) => const LicensesPage(),
),
GoRoute(
path: AppPage.settingsLayout.toPath,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import 'package:auto_route/auto_route.dart';
import 'package:collaction_app/application/crowdaction/crowdaction_details/crowdaction_details_bloc.dart';
import 'package:collaction_app/presentation/routes/app_routes.gr.dart';
import 'package:collaction_app/presentation/shared_widgets/shimmers/title_shimmer_line.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:shimmer/shimmer.dart';

import '../../../../domain/crowdaction/crowdaction.dart';
import '../../../../presentation/themes/constants.dart';
import '../../../core/routes/app_page.dart';

class ParticipationCountText extends StatelessWidget {
const ParticipationCountText({
Expand All @@ -20,10 +20,9 @@ class ParticipationCountText extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => context.router.push(
CrowdActionParticipantsRoute(
crowdActionId: crowdAction!.id,
),
onTap: () => context.push(
AppPage.crowdActionParticipants.toPath,
extra: crowdAction!.id,
),
child: BlocProvider<CrowdActionDetailsBloc>.value(
value: BlocProvider.of<CrowdActionDetailsBloc>(context),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:auto_route/auto_route.dart';
import 'package:collaction_app/application/crowdaction/crowdaction_participants/crowdaction_participants_bloc.dart';
import 'package:collaction_app/domain/participation/participation.dart';
import 'package:collaction_app/infrastructure/core/injection.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:go_router/go_router.dart';
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';

import '../../themes/constants.dart';
Expand Down Expand Up @@ -68,7 +68,7 @@ class CrowdActionParticipantsPage extends StatelessWidget {
Icons.chevron_left,
color: kPrimaryColor200,
),
onPressed: () => context.router.pop(),
onPressed: () => context.pop(),
),
title: const Text(
"Participants",
Expand Down

0 comments on commit 6b5ee08

Please sign in to comment.