mirror of
https://github.com/inventree/inventree-app.git
synced 2025-07-06 22:00:43 +00:00
Link icons (#677)
* Add LinkIcon component * Visual UI updates - Refactor some components - Clearer text display - Add obvious chevron icon when a "tile" will take the user somewhere else * dart format * Adjust release notes * Add visual separator * Cleanup unused imports
This commit is contained in:
44
lib/widget/link_icon.dart
Normal file
44
lib/widget/link_icon.dart
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* An icon component to indicate that pressing on an item will change the page.
|
||||
*/
|
||||
|
||||
import "package:cached_network_image/cached_network_image.dart";
|
||||
import "package:flutter/cupertino.dart";
|
||||
import "package:flutter_tabler_icons/flutter_tabler_icons.dart";
|
||||
import "package:inventree/app_colors.dart";
|
||||
|
||||
Widget LargeText(
|
||||
String text, {
|
||||
double size = 14.0,
|
||||
bool bold = false,
|
||||
Color? color,
|
||||
}) {
|
||||
// Return a large text widget with specified text
|
||||
return Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: size,
|
||||
fontWeight: bold ? FontWeight.bold : FontWeight.normal,
|
||||
color: color,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget LinkIcon({
|
||||
bool external = false,
|
||||
String? text,
|
||||
CachedNetworkImage? image,
|
||||
}) {
|
||||
// Return a row of items with an icon and text
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (text != null) ...[LargeText(text)],
|
||||
if (image != null) ...[image],
|
||||
Icon(
|
||||
external ? TablerIcons.external_link : TablerIcons.chevron_right,
|
||||
color: COLOR_ACTION,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user