opt: get theme color

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-28 21:32:30 +08:00
parent 451a84e696
commit ca993df0c6
149 changed files with 4415 additions and 4803 deletions

View File

@@ -28,6 +28,7 @@ class _FavNoteChildPageState extends State<FavNoteChildPage>
@override
Widget build(BuildContext context) {
super.build(context);
final theme = Theme.of(context);
return LayoutBuilder(
builder: (context, constraints) => Stack(
clipBehavior: Clip.none,
@@ -55,14 +56,11 @@ class _FavNoteChildPageState extends State<FavNoteChildPage>
child: Container(
padding: MediaQuery.paddingOf(context),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.onInverseSurface,
color: theme.colorScheme.onInverseSurface,
border: Border(
top: BorderSide(
width: 0.5,
color: Theme.of(context)
.colorScheme
.outline
.withOpacity(0.5),
color: theme.colorScheme.outline.withOpacity(0.5),
),
),
),

View File

@@ -25,6 +25,7 @@ class _FavNotePageState extends State<FavNotePage>
@override
Widget build(BuildContext context) {
super.build(context);
final theme = Theme.of(context);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -43,7 +44,7 @@ class _FavNotePageState extends State<FavNotePage>
indicatorPadding:
const EdgeInsets.symmetric(horizontal: 3, vertical: 8),
indicator: BoxDecoration(
color: Theme.of(context).colorScheme.secondaryContainer,
color: theme.colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(20),
),
indicatorSize: TabBarIndicatorSize.tab,
@@ -51,8 +52,8 @@ class _FavNotePageState extends State<FavNotePage>
.labelStyle
?.copyWith(fontSize: 14) ??
const TextStyle(fontSize: 14),
labelColor: Theme.of(context).colorScheme.onSecondaryContainer,
unselectedLabelColor: Theme.of(context).colorScheme.outline,
labelColor: theme.colorScheme.onSecondaryContainer,
unselectedLabelColor: theme.colorScheme.outline,
tabs: [
Tab(text: '未发布笔记'),
Tab(text: '公开笔记'),
@@ -61,7 +62,7 @@ class _FavNotePageState extends State<FavNotePage>
),
// TextButton(
// style: TextButton.styleFrom(
// foregroundColor: Theme.of(context).colorScheme.onSurfaceVariant,
// foregroundColor: theme.colorScheme.onSurfaceVariant,
// visualDensity: VisualDensity(horizontal: -2, vertical: -2),
// tapTargetSize: MaterialTapTargetSize.shrinkWrap,
// ),

View File

@@ -19,6 +19,7 @@ class FavNoteItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Material(
color: Colors.transparent,
child: InkWell(
@@ -72,7 +73,7 @@ class FavNoteItem extends StatelessWidget {
style: TextStyle(
fontSize: 13,
height: 1,
color: Theme.of(context).colorScheme.outline,
color: theme.colorScheme.outline,
overflow: TextOverflow.clip,
),
),
@@ -83,7 +84,7 @@ class FavNoteItem extends StatelessWidget {
style: TextStyle(
fontSize: 13,
height: 1,
color: Theme.of(context).colorScheme.outline,
color: theme.colorScheme.outline,
overflow: TextOverflow.clip,
),
),
@@ -137,9 +138,7 @@ class FavNoteItem extends StatelessWidget {
backgroundColor:
WidgetStateProperty.resolveWith(
(states) {
return Theme.of(context)
.colorScheme
.surface
return theme.colorScheme.surface
.withOpacity(0.8);
},
),
@@ -147,9 +146,7 @@ class FavNoteItem extends StatelessWidget {
onPressed: null,
icon: Icon(
Icons.done_all_outlined,
color: Theme.of(context)
.colorScheme
.primary,
color: theme.colorScheme.primary,
),
),
),