Skip to content

Commit

Permalink
Merge pull request #29 from payam-zahedi/feat/update-theme
Browse files Browse the repository at this point in the history
update theme values
  • Loading branch information
payam-zahedi authored Jul 27, 2023
2 parents b4fa0dc + 490d101 commit 0183b32
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions example/lib/src/core/views/widgets/soon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ class SoonWidget extends StatelessWidget {
borderRadius: BorderRadius.circular(10),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 4,
vertical: 2,
horizontal: 6,
vertical: 3,
),
child: Text(
'SOON',
style: theme.textTheme.titleSmall?.copyWith(
color: theme.colorScheme.onError,
fontSize: 8,
fontSize: 10,
fontWeight: FontWeight.w700,
height: 1,
),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/src/core/views/widgets/toggle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class RoundToggle extends StatelessWidget {
this.backgroundRadius ?? const BorderRadius.all(Radius.circular(8));

final backgroundColor = value
? enabledTrackColor ?? theme.focusColor
? enabledTrackColor ?? theme.colorScheme.primary
: disabledTrackColor ?? theme.disabledColor;

return InkWell(
Expand Down
9 changes: 3 additions & 6 deletions example/lib/src/features/home/views/widgets/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:example/src/features/home/views/ui_states/extra.dart';
import 'package:example/src/features/home/views/widgets/customization_panel.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:iconsax_flutter/iconsax_flutter.dart';

class ToastHeader extends StatelessWidget {
const ToastHeader({super.key});
Expand Down Expand Up @@ -79,9 +78,7 @@ class ToastHeader extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
FilledButton(
style: FilledButton.styleFrom(
padding: const EdgeInsets.symmetric(horizontal: 40),
),
style: FilledButton.styleFrom(),
onPressed: () {
// TODO: add Make a Random Toast feature
},
Expand All @@ -92,13 +89,13 @@ class ToastHeader extends StatelessWidget {
style: FilledButton.styleFrom(
padding: const EdgeInsets.symmetric(horizontal: 16),
backgroundColor: theme.colorScheme.secondary,
foregroundColor: theme.colorScheme.onSecondary,
foregroundColor: theme.colorScheme.onBackground,
),
onPressed: () {
openGithub(context);
},
label: const Text('Give a Star'),
icon: const Icon(Iconsax.star_copy, size: 24),
icon: const Icon(Icons.star_rounded, size: 20),
),
if (context.isInMobileZone) ...[
const Padding(
Expand Down
13 changes: 9 additions & 4 deletions example/lib/src/theme/theme.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:flutter/material.dart';

const _primary = Color(0xff605CFF);
const _primary = Color(0xff3F5EFF);
const _onPrimary = Color(0xffFFFFFF);
const _onPrimaryContainer = Color(0xff303030);
const _secondary = Color(0xffFFCE51);
const _onSecondary = Color(0xff000000);
const _onSecondary = Color(0xff474648);
const _background = Color(0xffffffff);
const _onBackground = Color(0xff000000);
const _surface = Color(0xffF4F6F8);
Expand All @@ -18,7 +18,7 @@ const _outline = Color(0xffF2F2F2);
const _tagBackgroundColor = Color(0xffEDFBFE);
const _tagTextColor = Color(0xff21C9EE);

const _switchActiveColor = Color(0xff605CFF);
const _switchActiveColor = _primary;
const _switchInActiveColor = Color(0xffC5CCD7);

const _cardColor = Color(0xffFAFAFA);
Expand Down Expand Up @@ -58,8 +58,13 @@ ThemeData _themeBuilder() {
brightness: Brightness.light,
colorScheme: scheme,
dividerColor: scheme.outline,
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.all(_switchActiveColor),
trackColor: MaterialStateProperty.all(_switchInActiveColor),
splashRadius: 16,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
disabledColor: _switchInActiveColor,
focusColor: _switchActiveColor,
textTheme: textTheme,
filledButtonTheme: FilledButtonThemeData(
style: FilledButton.styleFrom(
Expand Down

0 comments on commit 0183b32

Please sign in to comment.