general minor modifications
This commit is contained in:
@@ -187,6 +187,7 @@ class _RouteCalculatorState extends State<RouteCalculator> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReorderableListView(
|
child: ReorderableListView(
|
||||||
|
buildDefaultDragHandles: false,
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||||
onReorder: (oldIndex, newIndex) {
|
onReorder: (oldIndex, newIndex) {
|
||||||
if (newIndex > oldIndex) newIndex -= 1;
|
if (newIndex > oldIndex) newIndex -= 1;
|
||||||
@@ -205,7 +206,7 @@ class _RouteCalculatorState extends State<RouteCalculator> {
|
|||||||
ReorderableDragStartListener(
|
ReorderableDragStartListener(
|
||||||
index: index,
|
index: index,
|
||||||
child: const Padding(
|
child: const Padding(
|
||||||
padding: EdgeInsets.only(top: 16),
|
padding: EdgeInsets.only(top: 28),
|
||||||
child: Icon(Icons.drag_indicator),
|
child: Icon(Icons.drag_indicator),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -172,20 +172,22 @@ class _LoginPanelContentState extends State<LoginPanelContent> {
|
|||||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextField(
|
TextFormField(
|
||||||
controller: _usernameController,
|
controller: _usernameController,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
labelText: "Username",
|
labelText: "Username",
|
||||||
),
|
),
|
||||||
|
onFieldSubmitted: (_) => login(),
|
||||||
),
|
),
|
||||||
TextField(
|
TextFormField(
|
||||||
controller: _passwordController,
|
controller: _passwordController,
|
||||||
obscureText: true,
|
obscureText: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
labelText: "Password",
|
labelText: "Password",
|
||||||
),
|
),
|
||||||
|
onFieldSubmitted: (_) => login(),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|||||||
@@ -14,7 +14,25 @@ class TractionPage extends StatelessWidget {
|
|||||||
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(16),
|
padding: EdgeInsets.all(16),
|
||||||
child: Text('${loco.locoClass} ${loco.number}'),
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [Text('${loco.locoClass} ${loco.number}')],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'${loco.name}',
|
||||||
|
style: TextStyle(fontStyle: FontStyle.italic),
|
||||||
|
),
|
||||||
|
Text('${loco.mileage} mi'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
"/legs",
|
"/legs",
|
||||||
"/traction",
|
"/traction",
|
||||||
"/trips",
|
"/trips",
|
||||||
|
"/add",
|
||||||
];
|
];
|
||||||
|
|
||||||
int _getIndexFromLocation(String location) {
|
int _getIndexFromLocation(String location) {
|
||||||
@@ -263,14 +264,10 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
NavigationDestination(icon: Icon(Icons.list), label: "Entries"),
|
NavigationDestination(icon: Icon(Icons.list), label: "Entries"),
|
||||||
NavigationDestination(icon: Icon(Icons.train), label: "Traction"),
|
NavigationDestination(icon: Icon(Icons.train), label: "Traction"),
|
||||||
NavigationDestination(icon: Icon(Icons.book), label: "Trips"),
|
NavigationDestination(icon: Icon(Icons.book), label: "Trips"),
|
||||||
|
NavigationDestination(icon: Icon(Icons.add), label: "Add"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: currentPage,
|
body: currentPage,
|
||||||
floatingActionButton: FloatingActionButton(
|
|
||||||
onPressed: () => {context.push("/add")},
|
|
||||||
tooltip: 'New Entry',
|
|
||||||
child: const Icon(Icons.add),
|
|
||||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,8 +144,8 @@ class LocoSummary extends Loco {
|
|||||||
locoOperator: json['loco_operator'],
|
locoOperator: json['loco_operator'],
|
||||||
locoNotes: json['loco_notes'],
|
locoNotes: json['loco_notes'],
|
||||||
locoEvn: json['loco_evn'],
|
locoEvn: json['loco_evn'],
|
||||||
mileage: (json['loco_mileage'] as num?)?.toDouble(),
|
mileage: (json['loco_mileage'] as num?)?.toDouble() ?? 0,
|
||||||
journeys: json['loco_journeys'],
|
journeys: json['loco_journeys'] ?? 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user