Compare commits
6 Commits
c344f57698
...
1.1
| Author | SHA1 | Date | |
|---|---|---|---|
| db6e489de6 | |||
| 51dd38ca9a | |||
| 5ee6b33097 | |||
| 4aa5bf784b | |||
| ec76a028cb | |||
| 9f98189983 |
15
README.md
15
README.md
@@ -1,14 +1,3 @@
|
|||||||
# IFR Buddy
|
# ifrbuddy
|
||||||
|
|
||||||
**IFR Buddy** is a Flutter-based web application designed to help pilots and aviation enthusiasts easily record Instrument Flight Rules (IFR) clearances without the need for a pen. Featuring seamless navigation between input fields, dark mode, and a user-friendly interface, IFR Buddy simplifies the process of entering essential IFR details such as Clearance Limit, Route/SID, Altitude, Squawk Code, and Departure Frequency.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- **Seamless Navigation:** Move between input fields using keyboard buttons.
|
|
||||||
- **Dark Mode:** Toggle between light and dark themes for comfortable usage in any lighting condition.
|
|
||||||
- **Efficient Data Entry:** Quickly input and manage Clearance Limit, Route/SID, Altitude, Squawk Code, and Departure Frequency.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
This project is licensed under the MIT License.
|
|
||||||
|
|
||||||
|
A simple way to write down IFR clearances using the CRAFT method.
|
||||||
@@ -12,7 +12,8 @@ class ComparisonPage extends StatefulWidget {
|
|||||||
final bool isDarkMode;
|
final bool isDarkMode;
|
||||||
final Function toggleDarkMode;
|
final Function toggleDarkMode;
|
||||||
|
|
||||||
const ComparisonPage({super.key,
|
const ComparisonPage({
|
||||||
|
super.key,
|
||||||
required this.expectedClearanceLimit,
|
required this.expectedClearanceLimit,
|
||||||
required this.expectedRoute,
|
required this.expectedRoute,
|
||||||
required this.expectedAltitude,
|
required this.expectedAltitude,
|
||||||
@@ -183,7 +184,7 @@ Widget build(BuildContext context) {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(16.0),
|
padding: EdgeInsets.all(16.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Use this Page while receiving your clearance. The arrow button copies the excpected value. Same if left empty.',
|
'Use this Page while receiving your clearance. The arrow button copies the expected value. Same if left empty.',
|
||||||
style: TextStyle(fontSize: 16),
|
style: TextStyle(fontSize: 16),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
@@ -212,8 +213,8 @@ Widget build(BuildContext context) {
|
|||||||
buildExpectedClearanceField('Clearance Limit', widget.expectedClearanceLimit),
|
buildExpectedClearanceField('Clearance Limit', widget.expectedClearanceLimit),
|
||||||
buildExpectedClearanceField('Route', widget.expectedRoute),
|
buildExpectedClearanceField('Route', widget.expectedRoute),
|
||||||
buildExpectedClearanceField('Altitude', widget.expectedAltitude),
|
buildExpectedClearanceField('Altitude', widget.expectedAltitude),
|
||||||
buildExpectedClearanceField('Transponder (Squawk)', widget.expectedSquawk),
|
|
||||||
buildExpectedClearanceField('Frequency', widget.expectedFrequency),
|
buildExpectedClearanceField('Frequency', widget.expectedFrequency),
|
||||||
|
buildExpectedClearanceField('Transponder (Squawk)', widget.expectedSquawk),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -251,6 +252,12 @@ Widget build(BuildContext context) {
|
|||||||
widget.expectedAltitude,
|
widget.expectedAltitude,
|
||||||
focusNode: _actualAltitudeFocusNode,
|
focusNode: _actualAltitudeFocusNode,
|
||||||
),
|
),
|
||||||
|
buildActualClearanceField(
|
||||||
|
'Frequency',
|
||||||
|
_actualFrequencyController,
|
||||||
|
widget.expectedFrequency,
|
||||||
|
formatterList: [FrequencyInputFormatter()],
|
||||||
|
),
|
||||||
buildActualClearanceField(
|
buildActualClearanceField(
|
||||||
'Transponder (Squawk)',
|
'Transponder (Squawk)',
|
||||||
_actualSquawkController,
|
_actualSquawkController,
|
||||||
@@ -260,12 +267,6 @@ Widget build(BuildContext context) {
|
|||||||
LengthLimitingTextInputFormatter(4),
|
LengthLimitingTextInputFormatter(4),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
buildActualClearanceField(
|
|
||||||
'Frequency',
|
|
||||||
_actualFrequencyController,
|
|
||||||
widget.expectedFrequency,
|
|
||||||
formatterList: [FrequencyInputFormatter()],
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -278,7 +279,7 @@ Widget build(BuildContext context) {
|
|||||||
// Proceed Button
|
// Proceed Button
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: _navigateToFinalClearance,
|
onPressed: _navigateToFinalClearance,
|
||||||
child: const Text('Proceed to Clearance Display'),
|
child: const Text('Proceed to Readback page'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:keyboard_actions/keyboard_actions.dart'; // Correct package import
|
|
||||||
import 'comparison_page.dart';
|
import 'comparison_page.dart';
|
||||||
import 'final_clearance_page.dart'; // Import final clearance page
|
import 'final_clearance_page.dart'; // Import final clearance page
|
||||||
import '../utils/frequency_input_formatter.dart';
|
import '../utils/frequency_input_formatter.dart'; // Ensure this path is correct
|
||||||
|
|
||||||
class ExpectationInputPage extends StatefulWidget {
|
class ExpectationInputPage extends StatefulWidget {
|
||||||
final bool isDarkMode;
|
final bool isDarkMode;
|
||||||
@@ -32,12 +31,12 @@ class ExpectationInputPageState extends State<ExpectationInputPage> {
|
|||||||
final TextEditingController _expectedFrequencyController =
|
final TextEditingController _expectedFrequencyController =
|
||||||
TextEditingController();
|
TextEditingController();
|
||||||
|
|
||||||
// Reintroduce FocusNodes
|
// FocusNodes for each field
|
||||||
final FocusNode _clearanceLimitFocusNode = FocusNode();
|
final FocusNode _clearanceLimitFocusNode = FocusNode();
|
||||||
final FocusNode _routeFocusNode = FocusNode();
|
final FocusNode _routeFocusNode = FocusNode();
|
||||||
final FocusNode _altitudeFocusNode = FocusNode();
|
final FocusNode _altitudeFocusNode = FocusNode();
|
||||||
final FocusNode _squawkFocusNode = FocusNode();
|
|
||||||
final FocusNode _frequencyFocusNode = FocusNode();
|
final FocusNode _frequencyFocusNode = FocusNode();
|
||||||
|
final FocusNode _squawkFocusNode = FocusNode();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
@@ -49,8 +48,8 @@ class ExpectationInputPageState extends State<ExpectationInputPage> {
|
|||||||
_clearanceLimitFocusNode.dispose();
|
_clearanceLimitFocusNode.dispose();
|
||||||
_routeFocusNode.dispose();
|
_routeFocusNode.dispose();
|
||||||
_altitudeFocusNode.dispose();
|
_altitudeFocusNode.dispose();
|
||||||
_squawkFocusNode.dispose();
|
|
||||||
_frequencyFocusNode.dispose();
|
_frequencyFocusNode.dispose();
|
||||||
|
_squawkFocusNode.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +92,7 @@ class ExpectationInputPageState extends State<ExpectationInputPage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updated method to build a text field with optional input
|
// Method to build a text field with optional input and standard keyboard
|
||||||
Widget buildTextField({
|
Widget buildTextField({
|
||||||
required String label,
|
required String label,
|
||||||
required TextEditingController controller,
|
required TextEditingController controller,
|
||||||
@@ -120,20 +119,15 @@ class ExpectationInputPageState extends State<ExpectationInputPage> {
|
|||||||
enableIMEPersonalizedLearning: enableIMEPersonalizedLearning,
|
enableIMEPersonalizedLearning: enableIMEPersonalizedLearning,
|
||||||
onFieldSubmitted: (_) {
|
onFieldSubmitted: (_) {
|
||||||
if (isLastField) {
|
if (isLastField) {
|
||||||
// If it's the last field, unfocus to close the keyboard
|
// If it's the last field, unfocus to close the keyboard and submit
|
||||||
currentFocus.unfocus();
|
currentFocus.unfocus();
|
||||||
// Optionally, you can trigger form submission here
|
_navigateToComparisonPage();
|
||||||
// _navigateToComparisonPage();
|
|
||||||
} else if (nextFocus != null) {
|
} else if (nextFocus != null) {
|
||||||
FocusScope.of(context).requestFocus(nextFocus);
|
FocusScope.of(context).requestFocus(nextFocus);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Updated validator to allow empty inputs
|
// Validator allows empty inputs but validates if input is present
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
// If you want to perform validation only when input is not empty,
|
|
||||||
// you can add conditional checks here.
|
|
||||||
|
|
||||||
// Example: Validate numerical fields if they are not empty
|
|
||||||
if (value != null && value.isNotEmpty) {
|
if (value != null && value.isNotEmpty) {
|
||||||
if (keyboardType == TextInputType.number ||
|
if (keyboardType == TextInputType.number ||
|
||||||
keyboardType == const TextInputType.numberWithOptions(decimal: true)) {
|
keyboardType == const TextInputType.numberWithOptions(decimal: true)) {
|
||||||
@@ -144,7 +138,7 @@ class ExpectationInputPageState extends State<ExpectationInputPage> {
|
|||||||
// Add more specific validations if needed
|
// Add more specific validations if needed
|
||||||
}
|
}
|
||||||
|
|
||||||
// Example: Validate Transponder (Squawk) field
|
// Validate Transponder (Squawk) field
|
||||||
if (label == 'Transponder (Squawk)') {
|
if (label == 'Transponder (Squawk)') {
|
||||||
if (!RegExp(r'^[0-7]{1,4}$').hasMatch(value)) {
|
if (!RegExp(r'^[0-7]{1,4}$').hasMatch(value)) {
|
||||||
return 'Squawk must be 1-4 digits between 0 and 7';
|
return 'Squawk must be 1-4 digits between 0 and 7';
|
||||||
@@ -165,105 +159,6 @@ class ExpectationInputPageState extends State<ExpectationInputPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure KeyboardActions
|
|
||||||
KeyboardActionsConfig _buildConfig(BuildContext context) {
|
|
||||||
return KeyboardActionsConfig(
|
|
||||||
keyboardSeparatorColor: Colors.grey, // Optional: Customize the separator color
|
|
||||||
nextFocus: true, // Automatically handle next focus
|
|
||||||
actions: [
|
|
||||||
// Define actions for each FocusNode
|
|
||||||
KeyboardActionsItem(
|
|
||||||
focusNode: _clearanceLimitFocusNode,
|
|
||||||
toolbarButtons: [
|
|
||||||
(node) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () => node.nextFocus(),
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(8.0),
|
|
||||||
child: Text(
|
|
||||||
"Next",
|
|
||||||
style: TextStyle(color: Colors.blue, fontSize: 16),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
],
|
|
||||||
),
|
|
||||||
KeyboardActionsItem(
|
|
||||||
focusNode: _routeFocusNode,
|
|
||||||
toolbarButtons: [
|
|
||||||
(node) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () => node.nextFocus(),
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(8.0),
|
|
||||||
child: Text(
|
|
||||||
"Next",
|
|
||||||
style: TextStyle(color: Colors.blue, fontSize: 16),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
],
|
|
||||||
),
|
|
||||||
KeyboardActionsItem(
|
|
||||||
focusNode: _altitudeFocusNode,
|
|
||||||
toolbarButtons: [
|
|
||||||
(node) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () => node.nextFocus(),
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(8.0),
|
|
||||||
child: Text(
|
|
||||||
"Next",
|
|
||||||
style: TextStyle(color: Colors.blue, fontSize: 16),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
],
|
|
||||||
),
|
|
||||||
KeyboardActionsItem(
|
|
||||||
focusNode: _squawkFocusNode,
|
|
||||||
toolbarButtons: [
|
|
||||||
(node) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () => node.nextFocus(),
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(8.0),
|
|
||||||
child: Text(
|
|
||||||
"Next",
|
|
||||||
style: TextStyle(color: Colors.blue, fontSize: 16),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
],
|
|
||||||
),
|
|
||||||
KeyboardActionsItem(
|
|
||||||
focusNode: _frequencyFocusNode,
|
|
||||||
toolbarButtons: [
|
|
||||||
(node) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
node.unfocus(); // Dismiss the keyboard
|
|
||||||
_navigateToComparisonPage(); // Optionally, submit the form
|
|
||||||
},
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(8.0),
|
|
||||||
child: Text(
|
|
||||||
"Done",
|
|
||||||
style: TextStyle(color: Colors.blue, fontSize: 16),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@@ -282,8 +177,6 @@ class ExpectationInputPageState extends State<ExpectationInputPage> {
|
|||||||
body: GestureDetector(
|
body: GestureDetector(
|
||||||
// Dismiss the keyboard when tapping outside
|
// Dismiss the keyboard when tapping outside
|
||||||
onTap: () => FocusScope.of(context).unfocus(),
|
onTap: () => FocusScope.of(context).unfocus(),
|
||||||
child: KeyboardActions(
|
|
||||||
config: _buildConfig(context), // Apply KeyboardActionsConfig
|
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -341,6 +234,12 @@ class ExpectationInputPageState extends State<ExpectationInputPage> {
|
|||||||
controller: _expectedClearanceLimitController,
|
controller: _expectedClearanceLimitController,
|
||||||
currentFocus: _clearanceLimitFocusNode,
|
currentFocus: _clearanceLimitFocusNode,
|
||||||
nextFocus: _routeFocusNode,
|
nextFocus: _routeFocusNode,
|
||||||
|
keyboardType: TextInputType.text, // Standard keyboard
|
||||||
|
inputFormatters: [
|
||||||
|
// Allow letters, numbers, spaces, and hyphens
|
||||||
|
FilteringTextInputFormatter.allow(
|
||||||
|
RegExp(r'[A-Za-z0-9\s\-]')),
|
||||||
|
],
|
||||||
enableAutocorrect: false, // Disable autocorrect
|
enableAutocorrect: false, // Disable autocorrect
|
||||||
enableSuggestions: false, // Disable suggestions
|
enableSuggestions: false, // Disable suggestions
|
||||||
enableIMEPersonalizedLearning:
|
enableIMEPersonalizedLearning:
|
||||||
@@ -351,6 +250,12 @@ class ExpectationInputPageState extends State<ExpectationInputPage> {
|
|||||||
controller: _expectedRouteController,
|
controller: _expectedRouteController,
|
||||||
currentFocus: _routeFocusNode,
|
currentFocus: _routeFocusNode,
|
||||||
nextFocus: _altitudeFocusNode,
|
nextFocus: _altitudeFocusNode,
|
||||||
|
keyboardType: TextInputType.text, // Standard keyboard
|
||||||
|
inputFormatters: [
|
||||||
|
// Allow letters, numbers, spaces, and hyphens
|
||||||
|
FilteringTextInputFormatter.allow(
|
||||||
|
RegExp(r'[A-Za-z0-9\s\-]')),
|
||||||
|
],
|
||||||
enableAutocorrect: false, // Disable autocorrect
|
enableAutocorrect: false, // Disable autocorrect
|
||||||
enableSuggestions: false, // Disable suggestions
|
enableSuggestions: false, // Disable suggestions
|
||||||
enableIMEPersonalizedLearning:
|
enableIMEPersonalizedLearning:
|
||||||
@@ -360,10 +265,22 @@ class ExpectationInputPageState extends State<ExpectationInputPage> {
|
|||||||
label: 'Altitude',
|
label: 'Altitude',
|
||||||
controller: _expectedAltitudeController,
|
controller: _expectedAltitudeController,
|
||||||
currentFocus: _altitudeFocusNode,
|
currentFocus: _altitudeFocusNode,
|
||||||
nextFocus: _squawkFocusNode,
|
nextFocus: _frequencyFocusNode, // Updated next focus
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.text, // Standard keyboard
|
||||||
|
inputFormatters: null, // No restrictions
|
||||||
|
enableAutocorrect: false, // Disable autocorrect
|
||||||
|
enableSuggestions: false, // Disable suggestions
|
||||||
|
enableIMEPersonalizedLearning:
|
||||||
|
false, // iOS-specific
|
||||||
|
),
|
||||||
|
buildTextField(
|
||||||
|
label: 'Departure Frequency', // Changed label
|
||||||
|
controller: _expectedFrequencyController,
|
||||||
|
currentFocus: _frequencyFocusNode,
|
||||||
|
nextFocus: _squawkFocusNode, // Next focus to Squawk
|
||||||
|
keyboardType: TextInputType.text, // Standard keyboard
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
FilteringTextInputFormatter.digitsOnly
|
FrequencyInputFormatter(), // Handles decimal inputs
|
||||||
],
|
],
|
||||||
enableAutocorrect: false, // Disable autocorrect
|
enableAutocorrect: false, // Disable autocorrect
|
||||||
enableSuggestions: false, // Disable suggestions
|
enableSuggestions: false, // Disable suggestions
|
||||||
@@ -371,12 +288,13 @@ class ExpectationInputPageState extends State<ExpectationInputPage> {
|
|||||||
false, // iOS-specific
|
false, // iOS-specific
|
||||||
),
|
),
|
||||||
buildTextField(
|
buildTextField(
|
||||||
label: 'Transponder (Squawk)',
|
label: 'Transponder (Squawk)', // Now last field
|
||||||
controller: _expectedSquawkController,
|
controller: _expectedSquawkController,
|
||||||
currentFocus: _squawkFocusNode,
|
currentFocus: _squawkFocusNode,
|
||||||
nextFocus: _frequencyFocusNode,
|
isLastField: true, // Mark as last field
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.text, // Standard keyboard
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
|
// Allow only digits 0-7 and limit to 4 characters
|
||||||
FilteringTextInputFormatter.allow(
|
FilteringTextInputFormatter.allow(
|
||||||
RegExp(r'[0-7]')),
|
RegExp(r'[0-7]')),
|
||||||
LengthLimitingTextInputFormatter(4),
|
LengthLimitingTextInputFormatter(4),
|
||||||
@@ -386,28 +304,15 @@ class ExpectationInputPageState extends State<ExpectationInputPage> {
|
|||||||
enableIMEPersonalizedLearning:
|
enableIMEPersonalizedLearning:
|
||||||
false, // iOS-specific
|
false, // iOS-specific
|
||||||
),
|
),
|
||||||
buildTextField(
|
|
||||||
label: 'Departure Frequency',
|
|
||||||
controller: _expectedFrequencyController,
|
|
||||||
currentFocus: _frequencyFocusNode,
|
|
||||||
isLastField: true,
|
|
||||||
keyboardType:
|
|
||||||
const TextInputType.numberWithOptions(decimal: true),
|
|
||||||
inputFormatters: [FrequencyInputFormatter()],
|
|
||||||
enableAutocorrect: false, // Disable autocorrect
|
|
||||||
enableSuggestions: false, // Disable suggestions
|
|
||||||
enableIMEPersonalizedLearning:
|
|
||||||
false, // iOS-specific
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: _skipReadback,
|
onPressed: _navigateToComparisonPage,
|
||||||
child: const Text('Skip to Readback'),
|
child: const Text('Next'),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
ElevatedButton(
|
TextButton(
|
||||||
onPressed: _navigateToComparisonPage,
|
onPressed: _skipReadback,
|
||||||
child: const Text('Navigate to Comparison Page'),
|
child: const Text('Skip to end'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -420,7 +325,6 @@ class ExpectationInputPageState extends State<ExpectationInputPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'expectation_input_page.dart';
|
import 'expectation_input_page.dart';
|
||||||
import 'edit_clearance_page.dart'; // Import the edit clearance page
|
// Import the edit clearance page
|
||||||
import '../widgets/clearance_field.dart';
|
import '../widgets/clearance_field.dart';
|
||||||
|
|
||||||
class FinalClearanceDisplay extends StatefulWidget {
|
class FinalClearanceDisplay extends StatefulWidget {
|
||||||
@@ -44,33 +44,6 @@ class FinalClearanceDisplayState extends State<FinalClearanceDisplay> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Navigate to Edit Clearance Page and handle returned data
|
// Navigate to Edit Clearance Page and handle returned data
|
||||||
Future<void> _navigateToEditClearance() async {
|
|
||||||
final result = await Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) => EditClearancePage(
|
|
||||||
clearanceLimit: clearanceLimit,
|
|
||||||
route: route,
|
|
||||||
altitude: altitude,
|
|
||||||
squawk: squawk,
|
|
||||||
frequency: frequency,
|
|
||||||
isDarkMode: widget.isDarkMode,
|
|
||||||
toggleDarkMode: widget.toggleDarkMode,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
// If the result contains updated data, update the state with the new values
|
|
||||||
if (result != null && mounted) {
|
|
||||||
setState(() {
|
|
||||||
clearanceLimit = result['clearanceLimit'];
|
|
||||||
route = result['route'];
|
|
||||||
altitude = result['altitude'];
|
|
||||||
squawk = result['squawk'];
|
|
||||||
frequency = result['frequency'];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Navigate back to the first page (ExpectationInputPage)
|
// Navigate back to the first page (ExpectationInputPage)
|
||||||
void _navigateHome(BuildContext context) {
|
void _navigateHome(BuildContext context) {
|
||||||
@@ -97,18 +70,7 @@ class FinalClearanceDisplayState extends State<FinalClearanceDisplay> {
|
|||||||
_navigateHome(context);
|
_navigateHome(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
actions: [
|
actions: const [],
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Icons.edit), // Edit button
|
|
||||||
onPressed: _navigateToEditClearance,
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
icon: Icon(widget.isDarkMode ? Icons.dark_mode : Icons.light_mode),
|
|
||||||
onPressed: () {
|
|
||||||
widget.toggleDarkMode();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
body: Center(
|
body: Center(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
@@ -129,8 +91,8 @@ class FinalClearanceDisplayState extends State<FinalClearanceDisplay> {
|
|||||||
buildClearanceField('Clearance Limit', clearanceLimit),
|
buildClearanceField('Clearance Limit', clearanceLimit),
|
||||||
buildClearanceField('Route', route),
|
buildClearanceField('Route', route),
|
||||||
buildClearanceField('Altitude', altitude),
|
buildClearanceField('Altitude', altitude),
|
||||||
buildClearanceField('Transponder (Squawk)', squawk),
|
|
||||||
buildClearanceField('Frequency', frequency),
|
buildClearanceField('Frequency', frequency),
|
||||||
|
buildClearanceField('Transponder (Squawk)', squawk),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -176,14 +176,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.9.0"
|
version: "4.9.0"
|
||||||
keyboard_actions:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: keyboard_actions
|
|
||||||
sha256: "31e0ab2a706ac8f58887efa60efc1f19aecdf37d8ab0f665a0f156d1fbeab650"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "4.2.0"
|
|
||||||
leak_tracker:
|
leak_tracker:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -36,9 +36,7 @@ dependencies:
|
|||||||
cupertino_icons: ^1.0.6
|
cupertino_icons: ^1.0.6
|
||||||
http: ^1.2.2
|
http: ^1.2.2
|
||||||
shared_preferences: ^2.3.2
|
shared_preferences: ^2.3.2
|
||||||
keyboard_actions: ^4.2.0
|
|
||||||
flutter_launcher_icons: ^0.14.1
|
flutter_launcher_icons: ^0.14.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
@@ -50,6 +48,12 @@ dev_dependencies:
|
|||||||
# rules and activating additional ones.
|
# rules and activating additional ones.
|
||||||
flutter_lints: ^3.0.0
|
flutter_lints: ^3.0.0
|
||||||
|
|
||||||
|
flutter_icons:
|
||||||
|
android: true
|
||||||
|
ios: true
|
||||||
|
macos: true # Enable macOS icon generation
|
||||||
|
image_path: "assets/icon-512.png" # Path to your icon image
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 403 B |
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
||||||
<meta name="description" content="A new Flutter project.">
|
<meta name="description" content="Write down IFR Clearances easily">
|
||||||
|
|
||||||
<!-- No cache tag -->
|
<!-- No cache tag -->
|
||||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
<!-- iOS meta tags & icons -->
|
<!-- iOS meta tags & icons -->
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||||
<meta name="apple-mobile-web-app-title" content="ifrbuddy">
|
<meta name="apple-mobile-web-app-title" content="IFR Buddy">
|
||||||
<link rel="apple-touch-icon" href="icons/Icon-192.png">
|
<link rel="apple-touch-icon" href="icons/Icon-192.png">
|
||||||
|
|
||||||
<!-- Favicon -->
|
<!-- Favicon -->
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "ifrbuddy",
|
"name": "IFR Buddy",
|
||||||
"short_name": "ifrbuddy",
|
"short_name": "IFR Buddy",
|
||||||
"start_url": ".",
|
"start_url": ".",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"background_color": "#hexcode",
|
"background_color": "#hexcode",
|
||||||
"theme_color": "#hexcode",
|
"theme_color": "#hexcode",
|
||||||
"description": "A new Flutter project.",
|
"description": "Write down IFR Clearances easily",
|
||||||
"orientation": "portrait-primary",
|
"orientation": "portrait-primary",
|
||||||
"prefer_related_applications": false,
|
"prefer_related_applications": false,
|
||||||
"icons": [
|
"icons": [
|
||||||
|
|||||||
Reference in New Issue
Block a user