31 lines
713 B
Dart
31 lines
713 B
Dart
/// Shared helpers to open Settings from app bars.
|
|
library;
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../screens/settings_screen.dart';
|
|
|
|
List<Widget> bankAppBarActions({
|
|
required BuildContext context,
|
|
VoidCallback? onRefresh,
|
|
bool refreshing = false,
|
|
}) {
|
|
return [
|
|
if (onRefresh != null)
|
|
IconButton(
|
|
tooltip: 'Refresh',
|
|
onPressed: refreshing ? null : onRefresh,
|
|
icon: const Icon(Icons.refresh),
|
|
),
|
|
IconButton(
|
|
tooltip: 'Settings',
|
|
onPressed: () {
|
|
Navigator.of(context).push(
|
|
MaterialPageRoute<void>(builder: (_) => const SettingsScreen()),
|
|
);
|
|
},
|
|
icon: const Icon(Icons.settings_outlined),
|
|
),
|
|
];
|
|
}
|