Files
lunasea/lib/core/ui/highlighted_node.dart
Jagandeep Brar a1d68cd234 [share_plus] iOS 12 and lower crashes at launch due to missing LinkPresentation.framework (#442)
* chore(packages): Added pedantic package to enforce linting and styling
* feat(lunasea): Enforce effective dart styling
* Comment and format colours class
* Localize additional classes in Dashboard, cleanup additional code
* chore(lunasea): Major refactor by running dartfmt on the entire codebase, added widget return for page routers
* Additional work on conforming to effective dart style
* fix(share_plus): Roll back share_plus package to 2.0.0 to support iOS 12 or lower
* chore(lunasea): Fix remaining enabled analysis warnings
2021-04-24 04:26:39 -05:00

39 lines
953 B
Dart

import 'package:flutter/material.dart';
import 'package:lunasea/core.dart';
class LunaHighlightedNode extends StatelessWidget {
final Color backgroundColor;
final Color textColor;
final String text;
LunaHighlightedNode({
@required this.text,
this.backgroundColor = LunaColours.accent,
this.textColor = Colors.white,
}) {
assert(text != null);
}
@override
Widget build(BuildContext context) {
return Container(
child: Padding(
child: Text(
text,
maxLines: 1,
style: TextStyle(
fontSize: LunaUI.FONT_SIZE_HIGHLIGHTED_NODE,
color: textColor,
fontWeight: LunaUI.FONT_WEIGHT_BOLD,
),
),
padding: EdgeInsets.symmetric(vertical: 4.0, horizontal: 8.0),
),
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: BorderRadius.circular(LunaUI.BORDER_RADIUS),
),
);
}
}