list traction and add leaderboard panel
This commit is contained in:
23
lib/components/pages/traction.dart
Normal file
23
lib/components/pages/traction.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mileograph_flutter/objects/objects.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:mileograph_flutter/services/dataService.dart';
|
||||
|
||||
class TractionPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final data = context.watch<DataService>();
|
||||
return ListView.builder(
|
||||
itemCount: data.traction.length,
|
||||
itemBuilder: (context, index) {
|
||||
final loco = data.traction[index];
|
||||
return Card(
|
||||
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Text('${loco.locoClass} ${loco.locoNumber}'),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user