TetraStats/lib/views/singleplayer_record_view.dart

46 lines
1.6 KiB
Dart
Raw Permalink Normal View History

import 'package:flutter/material.dart';
2024-09-05 21:42:21 +00:00
import 'package:tetra_stats/data_objects/record_single.dart';
import 'package:tetra_stats/gen/strings.g.dart';
2024-11-19 23:21:03 +00:00
import 'package:tetra_stats/views/destination_home.dart';
import 'package:tetra_stats/widgets/singleplayer_record.dart';
class SingleplayerRecordView extends StatelessWidget {
final RecordSingle record;
const SingleplayerRecordView({super.key, required this.record});
@override
Widget build(BuildContext context) {
final t = Translations.of(context);
//bool bigScreen = MediaQuery.of(context).size.width >= 368;
return Scaffold(
backgroundColor: Colors.black,
2024-11-19 23:21:03 +00:00
floatingActionButtonLocation: FloatingActionButtonLocation.startTop,
floatingActionButton: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 8.0, 0.0, 0.0),
child: FloatingActionButton(
onPressed: () => Navigator.pop(context),
2024-11-28 20:37:07 +00:00
tooltip: t.goBackButton,
2024-11-19 23:21:03 +00:00
child: const Icon(Icons.arrow_back),
),
),
body: SafeArea(
child: SingleChildScrollView(
2024-11-19 23:21:03 +00:00
child: Center(
child: Container(
constraints: BoxConstraints(
maxWidth: 768
),
child: switch (record.gamemode){
2024-12-02 20:45:15 +00:00
"zenith" => ZenithCard(record, false, width: MediaQuery.of(context).size.width),
"zenithex" => ZenithCard(record, false, width: MediaQuery.of(context).size.width),
2024-11-19 23:21:03 +00:00
_ => SingleplayerRecord(record: record, hideTitle: true)
},
),
)
)
),
);
}
}