fix: resolve 2 remaining strict analysis errors
- introPage.dart: Convert fireItems to proper static function closure - mainDrawer.dart: Convert unreadCount int to String for Text widget
This commit is contained in:
parent
1864e5b105
commit
7a4c9fb3bc
61 changed files with 1386 additions and 1202 deletions
|
|
@ -7,6 +7,8 @@ import 'package:flutter_map/flutter_map.dart';
|
|||
/// Compass button widget for resetting map rotation to north
|
||||
/// Only visible when map is rotated (rotation != 0)
|
||||
class CompassMapPluginWidget extends StatefulWidget {
|
||||
const CompassMapPluginWidget({super.key});
|
||||
|
||||
@override
|
||||
_CompassMapPluginWidgetState createState() => _CompassMapPluginWidgetState();
|
||||
}
|
||||
|
|
@ -29,7 +31,7 @@ class _CompassMapPluginWidgetState extends State<CompassMapPluginWidget> {
|
|||
|
||||
void _initRotationMonitoring() {
|
||||
// Check rotation periodically (every 100ms) to detect changes
|
||||
_rotationCheckTimer = Timer.periodic(Duration(milliseconds: 100), (_) {
|
||||
_rotationCheckTimer = Timer.periodic(const Duration(milliseconds: 100), (_) {
|
||||
_checkRotation();
|
||||
});
|
||||
|
||||
|
|
@ -41,8 +43,8 @@ class _CompassMapPluginWidgetState extends State<CompassMapPluginWidget> {
|
|||
try {
|
||||
if (!mounted) return;
|
||||
|
||||
final rotation = _mapController.camera.rotation;
|
||||
final isRotated = rotation.abs() > 0.0;
|
||||
final double rotation = _mapController.camera.rotation;
|
||||
final bool isRotated = rotation.abs() > 0.0;
|
||||
|
||||
if (isRotated != _isRotated) {
|
||||
setState(() {
|
||||
|
|
@ -56,7 +58,7 @@ class _CompassMapPluginWidgetState extends State<CompassMapPluginWidget> {
|
|||
|
||||
void _resetRotation() {
|
||||
try {
|
||||
final controller = MapController.of(context);
|
||||
final MapController controller = MapController.of(context);
|
||||
controller.rotate(0);
|
||||
} catch (e) {
|
||||
print('Error resetting rotation: $e');
|
||||
|
|
@ -66,7 +68,7 @@ class _CompassMapPluginWidgetState extends State<CompassMapPluginWidget> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) => Stack(
|
||||
builder: (BuildContext context, BoxConstraints constraints) => Stack(
|
||||
fit: StackFit.expand,
|
||||
children: <Widget>[
|
||||
if (_isRotated)
|
||||
|
|
@ -94,7 +96,7 @@ class _CompassMapPluginWidgetState extends State<CompassMapPluginWidget> {
|
|||
heroTag: 'compass_button',
|
||||
tooltip: 'Go to North',
|
||||
onPressed: _resetRotation,
|
||||
child: Icon(Icons.explore),
|
||||
child: const Icon(Icons.explore),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue