A Flutter component library and design system providing a Military Terminal / Tactical HUD interface.
- 🪖 Military Terminal Aesthetic: Flat 1px borders, zero-radius corners, and JetBrains Mono monospace typography.
- 🎨 Pre-configured Dark Theme: Drop-in
TacticalTheme.darkready for instant application setup. - 🧱 20+ Tactical UI Components: State toggles, segmented controls, color swatch pickers, location chips, task lists, status badges, expandable accordion sections, animated radar sweep indicators, modal confirm dialogs, and custom snackbars.
- 🎯 Centralized Tokens: Access
TacticalColorsandTacticalSpacingfor custom HUD extensions. - 📱 Interactive Showcase Included: Complete demo screen included out-of-the-box (
TacticalDemoApp).
- Flat & Sharp Geometry: Zero border radii (
BorderRadius.zero) on all buttons, inputs, dialogs, and containers. - 1px Tactical Borders: Surfaces are demarcated by 1px solid borders (
TacticalColors.outline/TacticalColors.outlineStrong) without dropshadows or gradients (elevation: 0). - Monospace Typography: All text is rendered using JetBrains Mono via
GoogleFontsand formatted in UPPERCASE for a terminal interface aesthetic. - High-Contrast Dark Theme: Deep black/dark-gray backgrounds combined with distinct semantic state colors (Green, Yellow, Orange, Red, Blue, Muted).
- Flutter:
>=3.12.0 - Dart:
>=3.12.0
dependencies:
flutter:
sdk: flutter
tactical_components:
path: ../path/to/tactical_componentsdependencies:
flutter:
sdk: flutter
tactical_components:
git:
url: https://github.com/your-username/tactical_components.git
ref: maindependencies:
flutter:
sdk: flutter
tactical_components: ^1.0.0Then fetch the package:
flutter pub getImport all components, theme settings, and widgets via a single library import (package:tactical_components/tactical_components.dart):
import 'package:flutter/material.dart';
import 'package:tactical_components/tactical_components.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Tactical HUD',
theme: TacticalTheme.dark, // Apply military dark theme
home: const TacticalDemoScreen(),
);
}
}- 🔤 JetBrains Mono Font: The library automatically loads JetBrains Mono using
google_fonts. No manual TTF assets are required in your app'spubspec.yaml. - 🔠 Uppercase Text Convention: Tactical HUD components automatically transform text strings to uppercase. When writing custom text widgets, use
TacticalText('LABEL')or.toUpperCase()to maintain terminal consistency. - 📐 Zero Border Radius: Never add rounded corners (
BorderRadius.circular(...)) to tactical components; keep all edges sharp and rectangular to preserve the military terminal aesthetic. - 🧪 Running the Example App: You can run the interactive component showcase directly from the repository using:
flutter run -t example/lib/main.dart
| Color Constant | Hex Value | Intended Usage |
|---|---|---|
background |
#0A0A0A |
Main app scaffold background |
surface |
#141414 |
Card, box, and container background |
surfaceHigh |
#1B1B1B |
Elevated header / panel background |
outline |
#2A2A2A |
Standard 1px divider and border color |
outlineStrong |
#3A3A3A |
Emphasized element border color |
textPrimary |
#E0E0E0 |
Primary readable text |
textSecondary |
#8A8A8A |
Muted labels, subtitles, and detail headers |
textDisabled |
#4A4A4A |
Disabled text and buttons |
green |
#3DFF6E |
Active state, success, positive values, radar accents |
yellow |
#F2C744 |
Warnings, primary action buttons, code comments (//:) |
orange |
#FF7A29 |
Task requirements, warning headers |
red |
#FF4444 |
Locked items, external links, error/danger states |
blue |
#4A9EFF |
Links, toggles, sub-navigation highlights |
muted |
#6E6E6E |
Inactive / OFF toggle state |
swatchPalette |
List | Pre-defined drawing color palette (White, Yellow, Blue, Red, Green) |
xs: 4.0sm: 8.0md: 16.0lg: 24.0xl: 32.0borderWidth: 1.0radius:BorderRadius.zeroinputBorderShape:OutlineInputBorder(borderRadius: BorderRadius.zero)
A convenience helper widget that automatically renders uppercase monospace text:
TacticalText('Tactical Map ///', style: TextStyle(fontSize: 16))Label button displaying bracketed [ ON ] / [OFF] state.
TacticalStateToggle(
label: 'GRID',
value: isGridEnabled,
onChanged: (val) => setState(() => isGridEnabled = val),
)Multi-option selector with highlighted active background.
TacticalSegmentedControl(
options: const ['Solid', 'Dashed'],
selectedIndex: selectedIndex,
onChanged: (index) => setState(() => selectedIndex = index),
selectedColor: TacticalColors.blue,
)Row of color swatches for drawing/annotation toolbars with active selection outline.
TacticalColorSwatchPicker(
selectedColor: currentColor,
onChanged: (color) => setState(() => currentColor = color),
colors: TacticalColors.swatchPalette,
)Square primary or neutral action button with bold uppercase text.
// Primary Action (Yellow)
TacticalFilledButton(
label: 'BACK',
onPressed: () => Navigator.pop(context),
backgroundColor: TacticalColors.yellow,
)
// Neutral Action (Gray)
TacticalFilledButton(
label: 'KEY',
onPressed: () {},
backgroundColor: TacticalFilledButton.neutralBackground,
)Square gray close button with an 'X' icon.
TacticalCloseButton(
onPressed: () => Navigator.pop(context),
size: 48,
)Uppercase section title with semantic variant coloring.
- Variants:
neutral,warning,success,info,danger.
TacticalSectionHeader(
'TASK REQUIREMENT',
variant: TacticalHeaderVariant.warning,
)Code-style comment header prefixed with //:.
TacticalCodeHeader('Feedback & Bug Reports')Underlined actionable link or wavy-underlined glossary term.
// Action Link
TacticalInlineLink(
'Primary Recon',
variant: TacticalLinkVariant.link,
onTap: () {},
)
// Glossary Term (Wavy Yellow Underline)
TacticalInlineLink(
'static spawns',
variant: TacticalLinkVariant.glossaryTerm,
)Key-value metadata rows with bottom divider line.
TacticalDetailList(
entries: {
'LOCATION': 'Sector Alpha Base',
'KEY REQUIRED': 'SEC-02',
'AUTHORITY': 'HQ',
},
)Bordered chips displaying coordinates, spawn points, or locked icons.
TacticalLocationChipGrid(
chips: [
TacticalLocationChip(
label: 'Spawn #1',
icon: Icons.gps_fixed,
iconColor: TacticalColors.green,
onTap: () {},
),
TacticalLocationChip(
label: 'Locked Object',
icon: Icons.lock,
iconColor: TacticalColors.red,
showTrailingIcon: true,
),
],
)Icon + text annotation row with leading alert/link icon.
TacticalNoteRow(
text: 'Appears only during active quest phase.',
icon: Icons.link,
iconColor: TacticalColors.red,
)Highlighted popup dropdown field with optional color indicators.
TacticalDropdownField<String>(
selected: selectedVersion,
onChanged: (val) => setState(() => selectedVersion = val),
options: const [
TacticalDropdownOption(value: 'v0.3', label: 'Sector 0.3'),
TacticalDropdownOption(
value: 'v0.4',
label: 'Sector 0.4',
indicatorColor: TacticalColors.green,
),
],
)Terminal-style text field prefixed with >_ .
TacticalSearchField(
hintText: 'Filter locations...',
onChanged: (query) => filterItems(query),
)Compact status badge for list items (variants: neutral, success, warning, danger, info).
TacticalBadgeGroup(
badges: const [
TacticalStatusBadge('LCKD', variant: TacticalBadgeVariant.danger),
TacticalStatusBadge('0.4', variant: TacticalBadgeVariant.success),
],
)Full-width banner header showing title and item count [N].
TacticalCounterHeader(
title: 'Active Tasks',
count: 4,
)Item row featuring a leading radar icon, title, optional swap icon, and status badges.
TacticalTaskListItem(
title: 'First Recon',
leadingIcon: Icons.radar,
badges: const [
TacticalStatusBadge('0.4', variant: TacticalBadgeVariant.success),
],
onTap: () {},
)Row of compact dropdown menus separated by thin vertical borders (DEFAULT ▾ | NORMAL ▾ | SECTOR 0.4 ▾).
TacticalToolbarSelectGroup(
items: [
TacticalToolbarSelect(
label: 'Default ▾',
options: ['Option A', 'Option B'],
onSelected: (opt) {},
),
TacticalToolbarSelect(
label: 'Normal ▾',
options: ['Normal', 'High Contrast'],
onSelected: (opt) {},
),
],
)5-item tactical bottom navigation bar with outline icons and active indicator color.
TacticalBottomNavBar(
currentIndex: _selectedIndex,
onTap: (i) => setState(() => _selectedIndex = i),
items: const [
TacticalNavItem(icon: Icons.map_outlined, selectedIcon: Icons.map),
TacticalNavItem(icon: Icons.list_alt),
TacticalNavItem(icon: Icons.search),
TacticalNavItem(icon: Icons.settings),
],
)Collapsible accordion section featuring animated expand/collapse transitions and header color variants.
TacticalExpandableSection(
title: 'Key Additional Details',
variant: TacticalHeaderVariantAlias.neutral,
initiallyExpanded: true,
child: TacticalDetailList(entries: {'Map': 'Sector Alpha'}),
)Modal dialog function styled with tactical typography and standard/danger confirmation buttons.
final confirmed = await showTacticalConfirmDialog(
context,
title: 'Confirm Operation',
message: 'Do you want to reset all tactical markers?',
confirmLabel: 'CONFIRM',
danger: true,
);Toast alert notification with a colored status indicator bar on the left edge.
showTacticalSnackBar(
context,
'Marker updated successfully.',
variant: TacticalBadgeVariant.success,
);Placeholder layout for empty search or query results with icon and centered text.
TacticalEmptyState(
message: 'No tactical locations found',
icon: Icons.search_off,
)Animated radar sweep progress indicator (replaces standard CircularProgressIndicator).
TacticalScanIndicator(
size: 56,
color: TacticalColors.green,
)Military terminal styled side navigation drawer and square hamburger trigger button.
// Hamburger Menu Button (AppBar leading or toolbar)
AppBar(
leading: const Padding(
padding: EdgeInsets.all(TacticalSpacing.xs),
child: TacticalMenuButton(),
),
)
// Tactical Side Navigation Drawer
Scaffold(
drawer: TacticalDrawer(
title: 'NAVIGATION ///',
currentIndex: selectedIndex,
onItemTap: (index) => setState(() => selectedIndex = index),
items: const [
TacticalMenuItem(
label: 'Tactical Map',
icon: Icons.map_outlined,
selectedIcon: Icons.map,
badge: 'v0.4',
badgeVariant: TacticalBadgeVariant.success,
),
TacticalMenuItem(
label: 'Active Objectives',
icon: Icons.checklist_outlined,
badge: '3 ACTIVE',
badgeVariant: TacticalBadgeVariant.warning,
),
],
footer: const Text('TAC_SYS v1.0.0 /// SYSTEM ONLINE'),
),
)Terminal input field with top label, monospace font, green focus border, and red error state support.
TacticalTextField(
label: 'Encryption Key ///',
hintText: 'Enter 16-character key...',
prefixText: '>_ ',
suffixIcon: Icons.lock_outline,
onChanged: (text) {},
)Linear progress gauge with percentage readout in segmented or solid bar style.
TacticalProgressBar(
label: 'System Diagnostics',
value: 0.85,
color: TacticalColors.green,
style: TacticalProgressStyle.segmented,
)Numbered phase/step timeline tracker (01, 02, 03) connected by 1px tactical lines.
TacticalStepTracker(
direction: Axis.vertical,
steps: const [
TacticalStep(title: 'Phase 1: Infiltration', isCompleted: true),
TacticalStep(title: 'Phase 2: Terminal Breach', isActive: true),
TacticalStep(title: 'Phase 3: Exfiltration'),
],
)Terminal 1px divider line with optional centered label string.
TacticalDivider(
label: 'SECTION ALPHA',
color: TacticalColors.outline,
)Overlay notification badge wrapping any widget with corner alert badge.
TacticalNotificationBadge(
text: '3',
variant: TacticalBadgeVariant.danger,
child: Icon(Icons.notifications_outlined),
)Single-choice radio option selector with square check indicators [X] and monospace uppercase labels.
TacticalRadioGroup<String>(
selectedValue: selectedOption,
onChanged: (val) => setState(() => selectedOption = val),
options: const [
TacticalRadioOption(value: 'opt1', label: 'Protocol Alpha'),
TacticalRadioOption(value: 'opt2', label: 'Protocol Beta'),
],
)Universal HUD container with 1px border, dark surface background, and optional colored accent top/left stripe.
TacticalPanel(
title: 'TELEMETRY PANEL',
accentColor: TacticalColors.green,
accentPosition: TacticalPanelAccentPosition.top,
child: Text('Panel contents...'),
)Animated terminal loading placeholder with pulsing opacity effect.
TacticalSkeleton(
width: 200,
height: 18,
)Compact stat card featuring prominent metric values, unit labels, icons, and trend indicators (▲ +2.4%).
TacticalKpiCard(
title: 'STAMINA',
value: '98',
unit: '%',
trend: '▲ +2.4%',
trendColor: TacticalColors.green,
icon: Icons.flash_on,
)Contextual terminal info tooltip wrapper with 1px border and uppercase text.
TacticalTooltip(
message: 'LIVE TELEMETRY FEED ACTIVE',
child: Icon(Icons.info_outline),
)To preview and interact with all Tactical HUD widgets in a single scrollable showcase screen:
import 'package:flutter/material.dart';
import 'package:tactical_components/tactical_components.dart';
void main() => runApp(const TacticalDemoApp());