Skip to content

Commit

Permalink
Analyze fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Carapacik committed Feb 9, 2025
1 parent 52dcfd1 commit 22e0e25
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/src/feature/initialization/model/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ enum Environment {
/// Production environment.
prod._('PROD');

const Environment._(this.value);

/// The environment value.
final String value;

const Environment._(this.value);

/// Returns the environment from the given [value].
static Environment from(String? value) => switch (value) {
'DEV' => Environment.dev,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import 'package:flutter/material.dart';
/// Screen that is shown when the initialization of the app fails.
/// {@endtemplate}
class InitializationFailedApp extends StatefulWidget {
/// {@macro initialization_failed_screen}
const InitializationFailedApp({
required this.error,
required this.stackTrace,
this.onRetryInitialization,
super.key,
});

/// The error that caused the initialization to fail.
final Object error;

Expand All @@ -15,14 +23,6 @@ class InitializationFailedApp extends StatefulWidget {
/// If null, the retry button will not be shown.
final Future<void> Function()? onRetryInitialization;

/// {@macro initialization_failed_screen}
const InitializationFailedApp({
required this.error,
required this.stackTrace,
this.onRetryInitialization,
super.key,
});

@override
State<InitializationFailedApp> createState() => _InitializationFailedAppState();
}
Expand Down Expand Up @@ -71,7 +71,7 @@ class _InitializationFailedAppState extends State<InitializationFailedApp> {
),
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8),
child: Text(
'${widget.stackTrace}',
style: Theme.of(context).textTheme.bodyLarge,
Expand Down
3 changes: 1 addition & 2 deletions lib/src/feature/initialization/widget/material_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:wordly/src/core/constant/localization/localization.dart';
import 'package:wordly/src/core/utils/extensions/extensions.dart';
import 'package:wordly/src/feature/game/widget/game_page.dart';
import 'package:wordly/src/feature/settings/model/app_theme.dart';
import 'package:wordly/src/feature/settings/widget/settings_scope.dart';

/// {@template material_context}
Expand All @@ -23,7 +22,7 @@ class MaterialContext extends StatelessWidget {
final settings = SettingsScope.settingsOf(context);
final mediaQueryData = MediaQuery.of(context);

final theme = settings.appTheme ?? AppTheme.defaultTheme;
final theme = settings.appTheme;
final lightTheme = theme.buildThemeData(ThemeMode.light);
final darkTheme = theme.buildThemeData(ThemeMode.dark);

Expand Down

0 comments on commit 22e0e25

Please sign in to comment.