Skip to content

Commit

Permalink
chore(deps): bump flutter, auto_route and appwrite
Browse files Browse the repository at this point in the history
Which requires bumping freezed and downgrading riverpod from the v3 alpha.
It also requires regenerating the web files.
  • Loading branch information
lishaduck committed Sep 20, 2024
1 parent f775e8f commit 3d1444f
Show file tree
Hide file tree
Showing 11 changed files with 234 additions and 262 deletions.
12 changes: 8 additions & 4 deletions lib/app/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "package:hooks_riverpod/hooks_riverpod.dart";

import "../../l10n/l10n.dart";
import "../features/auth/application/auth_service.dart";
import "../features/auth/domain/pirate_user_entity.dart";
import "../utils/design.dart";
import "../utils/router.dart";
import "boostrap.dart";
Expand Down Expand Up @@ -47,10 +48,13 @@ class _EagerInitialization extends ConsumerWidget {

return ColoredBox(
color: theme.colorScheme.surfaceContainerHighest,
child: switch (user) {
AsyncData() || AsyncError() => child,
AsyncLoading() => const Center(child: CircularProgressIndicator()),
},
child: Center(
child: switch (user) {
AsyncData<PirateUserEntity> _ => child,
AsyncError<PirateUserEntity>(:final error) => Text("Error: $error"),
_ => const CircularProgressIndicator(),
},
),
);
}
}
13 changes: 3 additions & 10 deletions lib/app/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,11 @@ import "package:auto_route/auto_route.dart";
import "package:hooks_riverpod/hooks_riverpod.dart";

import "../features/auth/application/auth_service.dart";
import "../features/auth/presentation/auth_page/auth_page.dart";
import "../features/dashboard/presentation/dashboard_page/dashboard_page.dart";
import "../features/dashboard/presentation/wrapper_page/wrapper_page.dart";
import "../features/gpa_calculator/presentation/gpa_page/gpa_page.dart";
import "../features/pirate_coins/presentation/pirate_coins_page/pirate_coins_page.dart";
import "../features/pirate_coins/presentation/stats_page/stats_page.dart";

part "app_router.gr.dart";
import "app_router.gr.dart";

/// The router for the application.
@AutoRouterConfig(replaceInRouteName: "Page,Route")
class AppRouter extends _$AppRouter {
@AutoRouterConfig(replaceInRouteName: "Page,Route", deferredLoading: true)
class AppRouter extends RootStackRouter {
/// Create a new instance of [AppRouter].
AppRouter({required this.ref});

Expand Down
2 changes: 1 addition & 1 deletion lib/features/auth/presentation/auth_page/auth_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "package:auto_size_text/auto_size_text.dart";
import "package:flutter/material.dart";
import "package:hooks_riverpod/hooks_riverpod.dart";

import "../../../../app/app_router.dart";
import "../../../../app/app_router.gr.dart";
import "../../../../l10n/l10n.dart";
import "../../application/auth_service.dart";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "package:flutter_hooks/flutter_hooks.dart";
import "package:hooks_riverpod/hooks_riverpod.dart";
import "package:url_launcher/link.dart";

import "../../../../app/app_router.dart";
import "../../../../app/app_router.gr.dart";
import "../../../../gen/assets.gen.dart";
import "../../../../gen/fonts.gen.dart";
import "../../../../gen/version.gen.dart";
Expand Down
5 changes: 1 addition & 4 deletions lib/features/pirate_coins/domain/coins_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,5 @@ sealed class Stage with _$Stage {
const factory Stage.pickStudent() = PickStudentStage;

/// Represent the stage of the coins page where the teacher can view and add to a student's [CoinEntity]s.
const factory Stage.viewCoins({
required int student,
}) = ViewCoinsStage;
const factory Stage.viewCoins({required int student}) = ViewCoinsStage;
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class _ViewCoins extends StatelessWidget {
child: switch (data) {
AsyncData(:final value) => BigCard("${value.coins.coins}"),
AsyncError(:final error) => BigCard(l10n.error("$error")),
AsyncLoading() => Column(
_ => Column(
children: [
const CircularProgressIndicator(),
AutoSizeText(l10n.loading),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class StatsPage extends ConsumerWidget {
? BigCard(l10n.howManyCoins(value.coins.coins))
: BigCard(l10n.emptyReport),
AsyncError(:final error) => BigCard(l10n.error("$error")),
AsyncLoading() => Column(
_ => Column(
children: [
const CircularProgressIndicator(),
AutoSizeText(l10n.loading),
Expand Down
Loading

0 comments on commit 3d1444f

Please sign in to comment.