mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
Init repo
This commit is contained in:
commit
764b6034e3
566 changed files with 212335 additions and 0 deletions
49
lib/util/sticky_header_text.dart
Normal file
49
lib/util/sticky_header_text.dart
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
import 'package:ficonsax/ficonsax.dart';
|
||||
import 'package:fladder/screens/shared/flat_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class StickyHeaderText extends ConsumerStatefulWidget {
|
||||
final String label;
|
||||
final Function()? onClick;
|
||||
|
||||
const StickyHeaderText({required this.label, this.onClick, super.key});
|
||||
|
||||
@override
|
||||
ConsumerState<ConsumerStatefulWidget> createState() => StickyHeaderTextState();
|
||||
}
|
||||
|
||||
class StickyHeaderTextState extends ConsumerState<StickyHeaderText> {
|
||||
late Color color = Theme.of(context).colorScheme.onSurface;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FlatButton(
|
||||
onTap: widget.onClick,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 2),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
widget.label,
|
||||
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
if (widget.onClick != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8).copyWith(bottom: 4),
|
||||
child: Icon(
|
||||
IconsaxOutline.arrow_right_3,
|
||||
size: 18,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue