forked from zulip/zulip-flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
theme [nfc]: Pull
zulipThemeData
out from app.dart to new theme.dar…
…t file
- Loading branch information
1 parent
74aa25d
commit af20651
Showing
4 changed files
with
44 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'text.dart'; | ||
|
||
ThemeData zulipThemeData(BuildContext context) { | ||
return ThemeData( | ||
typography: zulipTypography(context), | ||
appBarTheme: const AppBarTheme( | ||
// Set these two fields to prevent a color change in [AppBar]s when | ||
// there is something scrolled under it. If an app bar hasn't been | ||
// given a backgroundColor directly or by theme, it uses | ||
// ColorScheme.surfaceContainer for the scrolled-under state and | ||
// ColorScheme.surface otherwise, and those are different colors. | ||
scrolledUnderElevation: 0, | ||
backgroundColor: Color(0xfff5f5f5), | ||
|
||
shape: Border(bottom: BorderSide(color: Color(0xffcccccc))), | ||
), | ||
// This applies Material 3's color system to produce a palette of | ||
// appropriately matching and contrasting colors for use in a UI. | ||
// The Zulip brand color is a starting point, but doesn't end up as | ||
// one that's directly used. (After all, we didn't design it for that | ||
// purpose; we designed a logo.) See docs: | ||
// https://api.flutter.dev/flutter/material/ColorScheme/ColorScheme.fromSeed.html | ||
// Or try this tool to see the whole palette: | ||
// https://m3.material.io/theme-builder#/custom | ||
colorScheme: ColorScheme.fromSeed( | ||
seedColor: kZulipBrandColor, | ||
), | ||
scaffoldBackgroundColor: const Color(0xfff6f6f6), | ||
tooltipTheme: const TooltipThemeData(preferBelow: false), | ||
); | ||
} | ||
|
||
/// The Zulip "brand color", a purplish blue. | ||
/// | ||
/// This is chosen as the sRGB midpoint of the Zulip logo's gradient. | ||
// As computed by Anders: https://github.com/zulip/zulip-mobile/pull/4467 | ||
const kZulipBrandColor = Color.fromRGBO(0x64, 0x92, 0xfe, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters