Skip to content

Commit

Permalink
feat: Set default theme value #2760
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Jul 3, 2024
1 parent ea360c7 commit ada5ac3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/app/shared/constants/parameters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,7 @@ class Parameters {
static const Color seedColor = Color(0xff6600FF);
// Talao
// static const Color seedColor = Color(0xff1EAADC);

// ThemeMode.light for talao
static const ThemeMode defaultTheme = ThemeMode.dark;
}
3 changes: 2 additions & 1 deletion lib/theme/theme_repository.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:async';

import 'package:altme/app/app.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';

Expand Down Expand Up @@ -48,7 +49,7 @@ class ThemeRepository implements ThemePersistence {
_controller.add(ThemeMode.dark);
}
} else {
_controller.add(ThemeMode.dark);
_controller.add(Parameters.defaultTheme);
}
}

Expand Down
5 changes: 3 additions & 2 deletions lib/theme/theme_state.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
part of 'theme_cubit.dart';

class ThemeState extends Equatable {
const ThemeState(
{this.themeMode = ThemeMode.dark,}); // Default theme = light theme
const ThemeState({
this.themeMode = ThemeMode.dark,
}); // Default theme = light theme

final ThemeMode themeMode;

Expand Down

0 comments on commit ada5ac3

Please sign in to comment.