general minor modifications
This commit is contained in:
@@ -187,6 +187,7 @@ class _RouteCalculatorState extends State<RouteCalculator> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: ReorderableListView(
|
||||
buildDefaultDragHandles: false,
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
onReorder: (oldIndex, newIndex) {
|
||||
if (newIndex > oldIndex) newIndex -= 1;
|
||||
@@ -205,7 +206,7 @@ class _RouteCalculatorState extends State<RouteCalculator> {
|
||||
ReorderableDragStartListener(
|
||||
index: index,
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.only(top: 16),
|
||||
padding: EdgeInsets.only(top: 28),
|
||||
child: Icon(Icons.drag_indicator),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -172,20 +172,22 @@ class _LoginPanelContentState extends State<LoginPanelContent> {
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
TextFormField(
|
||||
controller: _usernameController,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: "Username",
|
||||
),
|
||||
onFieldSubmitted: (_) => login(),
|
||||
),
|
||||
TextField(
|
||||
TextFormField(
|
||||
controller: _passwordController,
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: "Password",
|
||||
),
|
||||
onFieldSubmitted: (_) => login(),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
||||
@@ -14,7 +14,25 @@ class TractionPage extends StatelessWidget {
|
||||
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: Padding(
|
||||
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",
|
||||
"/traction",
|
||||
"/trips",
|
||||
"/add",
|
||||
];
|
||||
|
||||
int _getIndexFromLocation(String location) {
|
||||
@@ -263,14 +264,10 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
NavigationDestination(icon: Icon(Icons.list), label: "Entries"),
|
||||
NavigationDestination(icon: Icon(Icons.train), label: "Traction"),
|
||||
NavigationDestination(icon: Icon(Icons.book), label: "Trips"),
|
||||
NavigationDestination(icon: Icon(Icons.add), label: "Add"),
|
||||
],
|
||||
),
|
||||
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'],
|
||||
locoNotes: json['loco_notes'],
|
||||
locoEvn: json['loco_evn'],
|
||||
mileage: (json['loco_mileage'] as num?)?.toDouble(),
|
||||
journeys: json['loco_journeys'],
|
||||
mileage: (json['loco_mileage'] as num?)?.toDouble() ?? 0,
|
||||
journeys: json['loco_journeys'] ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user