mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-06-18 16:36:27 +10:00
feat: add custom los icon
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
class LosIcon extends StatelessWidget {
|
||||
final double size;
|
||||
final Color? color;
|
||||
|
||||
const LosIcon({super.key, this.size = 24, this.color});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final iconColor = color ?? IconTheme.of(context).color ?? Colors.black;
|
||||
return SvgPicture.string(
|
||||
_losSvg,
|
||||
width: size,
|
||||
height: size,
|
||||
colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const String _losSvg = '''
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor">
|
||||
<path d="m82-120 258-360h202l298-348v708H82Zm70-233-64-46 172-241h202l188-219 60 52-212 247H300L152-353Zm86 153h522v-412L578-400H380L238-200Zm522 0Z"/>
|
||||
</svg>
|
||||
''';
|
||||
@@ -16,6 +16,7 @@ import '../services/map_tile_cache_service.dart';
|
||||
import '../utils/route_transitions.dart';
|
||||
import '../widgets/app_bar.dart';
|
||||
import '../widgets/quick_switch_bar.dart';
|
||||
import '../icons/los_icon.dart';
|
||||
|
||||
class LineOfSightEndpoint {
|
||||
final String label;
|
||||
@@ -642,7 +643,7 @@ class _LineOfSightMapScreenState extends State<LineOfSightMapScreen> {
|
||||
alignment: Alignment.centerRight,
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: _loading ? null : _runLos,
|
||||
icon: const Icon(Icons.visibility),
|
||||
icon: const LosIcon(),
|
||||
label: Text(context.l10n.losRun),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -20,6 +20,7 @@ import '../services/map_tile_cache_service.dart';
|
||||
import '../utils/contact_search.dart';
|
||||
import '../utils/route_transitions.dart';
|
||||
import '../widgets/quick_switch_bar.dart';
|
||||
import '../icons/los_icon.dart';
|
||||
import 'channels_screen.dart';
|
||||
import 'chat_screen.dart';
|
||||
import 'contacts_screen.dart';
|
||||
@@ -280,7 +281,7 @@ class _MapScreenState extends State<MapScreen> {
|
||||
),
|
||||
if (!_isBuildingPathTrace)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.visibility),
|
||||
icon: const LosIcon(),
|
||||
onPressed: () {
|
||||
final candidates = <LineOfSightEndpoint>[];
|
||||
if (connector.selfLatitude != null &&
|
||||
|
||||
Reference in New Issue
Block a user