2024-10-17 22:17:23 +00:00
|
|
|
import 'dart:io';
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:intl/intl.dart';
|
|
|
|
import 'package:tetra_stats/gen/strings.g.dart';
|
|
|
|
import 'package:tetra_stats/main.dart';
|
|
|
|
import 'package:tetra_stats/views/destination_home.dart';
|
2024-11-05 23:07:43 +00:00
|
|
|
import 'package:tetra_stats/views/main_view.dart';
|
2024-10-17 22:17:23 +00:00
|
|
|
|
|
|
|
final DateFormat dateFormat = DateFormat.yMMMd(LocaleSettings.currentLocale.languageCode).add_Hms();
|
|
|
|
|
|
|
|
class UserView extends StatefulWidget {
|
|
|
|
final String searchFor;
|
|
|
|
const UserView({super.key, required this.searchFor});
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<StatefulWidget> createState() => UserState();
|
|
|
|
}
|
|
|
|
|
|
|
|
late String oldWindowTitle;
|
|
|
|
|
|
|
|
class UserState extends State<UserView> {
|
|
|
|
late ScrollController _scrollController;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
_scrollController = ScrollController();
|
|
|
|
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS){
|
|
|
|
// windowManager.getTitle().then((value) => oldWindowTitle = value);
|
|
|
|
// windowManager.setTitle("State from ${timestamp(widget.state.timestamp)}");
|
|
|
|
}
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
_scrollController.dispose();
|
|
|
|
// if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
//final t = Translations.of(context);
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: Colors.black,
|
2024-10-21 22:38:41 +00:00
|
|
|
floatingActionButtonLocation: FloatingActionButtonLocation.startTop,
|
|
|
|
floatingActionButton: Padding(
|
2024-11-04 22:20:36 +00:00
|
|
|
padding: const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 0.0),
|
2024-10-21 22:38:41 +00:00
|
|
|
child: FloatingActionButton(
|
|
|
|
onPressed: () => Navigator.pop(context),
|
|
|
|
tooltip: 'Fuck go back',
|
|
|
|
child: const Icon(Icons.arrow_back),
|
|
|
|
),
|
|
|
|
),
|
2024-10-17 22:17:23 +00:00
|
|
|
body: SafeArea(
|
2024-10-21 22:38:41 +00:00
|
|
|
child: LayoutBuilder(
|
|
|
|
builder: (BuildContext context, BoxConstraints constraints) {
|
2024-11-13 23:20:52 +00:00
|
|
|
return DestinationHome(searchFor: widget.searchFor, dataFuture: getData(widget.searchFor), constraints: constraints, noSidebar: true);
|
2024-10-21 22:38:41 +00:00
|
|
|
}
|
2024-10-17 22:17:23 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|