mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-02 11:16:10 -04:00
layout fixes
This commit is contained in:
parent
71f4d37efa
commit
216aef8173
56 changed files with 654 additions and 342 deletions
54
lib/theme/views/option_box.dart
Normal file
54
lib/theme/views/option_box.dart
Normal file
|
@ -0,0 +1,54 @@
|
|||
import 'package:awesome_extensions/awesome_extensions.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../theme.dart';
|
||||
|
||||
class OptionBox extends StatelessWidget {
|
||||
const OptionBox(
|
||||
{required String instructions,
|
||||
required IconData buttonIcon,
|
||||
required String buttonText,
|
||||
required void Function() onClick,
|
||||
super.key})
|
||||
: _instructions = instructions,
|
||||
_buttonIcon = buttonIcon,
|
||||
_buttonText = buttonText,
|
||||
_onClick = onClick;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final scale = theme.extension<ScaleScheme>()!;
|
||||
final scaleConfig = theme.extension<ScaleConfig>()!;
|
||||
|
||||
return Container(
|
||||
constraints: const BoxConstraints(maxWidth: 400),
|
||||
decoration: BoxDecoration(
|
||||
color: scale.primaryScale.subtleBackground,
|
||||
borderRadius:
|
||||
BorderRadius.circular(8 * scaleConfig.borderRadiusScale),
|
||||
border: Border.all(color: scale.primaryScale.border)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
style: theme.textTheme.labelMedium!
|
||||
.copyWith(color: scale.primaryScale.appText),
|
||||
softWrap: true,
|
||||
textAlign: TextAlign.center,
|
||||
_instructions),
|
||||
ElevatedButton(
|
||||
onPressed: _onClick,
|
||||
child: Row(mainAxisSize: MainAxisSize.min, children: [
|
||||
Icon(_buttonIcon, size: 24).paddingLTRB(0, 8, 8, 8),
|
||||
Text(textAlign: TextAlign.center, _buttonText)
|
||||
])).paddingLTRB(0, 12, 0, 0).toCenter()
|
||||
]).paddingAll(12))
|
||||
.paddingLTRB(24, 0, 24, 12);
|
||||
}
|
||||
|
||||
final String _instructions;
|
||||
final IconData _buttonIcon;
|
||||
final String _buttonText;
|
||||
final void Function() _onClick;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue