Skip to content

Commit

Permalink
Add ability to play created specifications
Browse files Browse the repository at this point in the history
  • Loading branch information
backspace committed Sep 26, 2024
1 parent 0639218 commit 3d89a2f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions waydowntown_app/lib/tools/my_specifications_table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:waydowntown/app.dart';
import 'package:waydowntown/models/specification.dart';
import 'package:waydowntown/routes/request_run_route.dart';

class MySpecificationsTable extends StatefulWidget {
final Dio dio;
Expand Down Expand Up @@ -84,6 +85,7 @@ class _MySpecificationsTableState extends State<MySpecificationsTable> {
columns: const [
DataColumn(label: Text('Concept')),
DataColumn(label: Text('Start Description')),
DataColumn(label: Text('')),
],
rows: _buildTableRows(),
),
Expand Down Expand Up @@ -118,12 +120,24 @@ class _MySpecificationsTableState extends State<MySpecificationsTable> {
),
),
const DataCell(Text('')),
const DataCell(Text('')),
],
));
rows.addAll(specs.map((spec) => DataRow(
cells: [
DataCell(Text(spec.concept)),
DataCell(_truncatedText(spec.start)),
DataCell(IconButton(
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => RequestRunRoute(
dio: widget.dio,
specificationId: spec.id,
),
),
),
icon: const Icon(Icons.play_arrow),
)),
],
)));
});
Expand Down

0 comments on commit 3d89a2f

Please sign in to comment.