fix notificationPredicate and tl_thingy for anon player
This commit is contained in:
parent
d0ead79068
commit
e26ae3a6b8
|
@ -312,13 +312,13 @@ class _MainState extends State<MainView> with TickerProviderStateMixin {
|
||||||
onRefresh: () {
|
onRefresh: () {
|
||||||
return Future(() => changePlayer(snapshot.data![0].userId));
|
return Future(() => changePlayer(snapshot.data![0].userId));
|
||||||
},
|
},
|
||||||
// notificationPredicate: (notification) {
|
notificationPredicate: (notification) {
|
||||||
// // with NestedScrollView local(depth == 2) OverscrollNotification are not sent
|
// with NestedScrollView local(depth == 2) OverscrollNotification are not sent
|
||||||
// if (!kIsWeb && (notification is OverscrollNotification || Platform.isIOS)) {
|
if (!kIsWeb && (notification is OverscrollNotification || Platform.isIOS)) {
|
||||||
// return notification.depth == 2;
|
return notification.depth == 2;
|
||||||
// }
|
}
|
||||||
// return notification.depth == 0;
|
return notification.depth == 0;
|
||||||
// },
|
},
|
||||||
child: NestedScrollView(
|
child: NestedScrollView(
|
||||||
controller: _scrollController,
|
controller: _scrollController,
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
|
@ -350,7 +350,7 @@ class _MainState extends State<MainView> with TickerProviderStateMixin {
|
||||||
body: TabBarView(
|
body: TabBarView(
|
||||||
controller: _tabController,
|
controller: _tabController,
|
||||||
children: [
|
children: [
|
||||||
TLThingy(tl: snapshot.data![0].tlSeason1, userID: snapshot.data![0].userId, states: snapshot.data![2], topTR: snapshot.data![7], bot: snapshot.data![0].role == "bot"),
|
TLThingy(tl: snapshot.data![0].tlSeason1, userID: snapshot.data![0].userId, states: snapshot.data![2], topTR: snapshot.data![7], bot: snapshot.data![0].role == "bot", guest: snapshot.data![0].role == "anon"),
|
||||||
_TLRecords(userID: snapshot.data![0].userId, data: snapshot.data![3]),
|
_TLRecords(userID: snapshot.data![0].userId, data: snapshot.data![3]),
|
||||||
_History(states: snapshot.data![2], update: _justUpdate),
|
_History(states: snapshot.data![2], update: _justUpdate),
|
||||||
_RecordThingy(record: (snapshot.data![1]['sprint'].isNotEmpty) ? snapshot.data![1]['sprint'][0] : null),
|
_RecordThingy(record: (snapshot.data![1]['sprint'].isNotEmpty) ? snapshot.data![1]['sprint'][0] : null),
|
||||||
|
|
|
@ -21,8 +21,9 @@ class TLThingy extends StatefulWidget {
|
||||||
final List<TetrioPlayer> states;
|
final List<TetrioPlayer> states;
|
||||||
final bool showTitle;
|
final bool showTitle;
|
||||||
final bool bot;
|
final bool bot;
|
||||||
|
final bool guest;
|
||||||
final double? topTR;
|
final double? topTR;
|
||||||
const TLThingy({super.key, required this.tl, required this.userID, required this.states, this.showTitle = true, this.bot=false, this.topTR});
|
const TLThingy({super.key, required this.tl, required this.userID, required this.states, this.showTitle = true, this.bot=false, this.guest=false, this.topTR});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<TLThingy> createState() => _TLThingyState();
|
State<TLThingy> createState() => _TLThingyState();
|
||||||
|
@ -409,7 +410,7 @@ class _TLThingyState extends State<TLThingy> {
|
||||||
if (currentTl.nerdStats != null) Graphs(currentTl.apm!, currentTl.pps!, currentTl.vs!, currentTl.nerdStats!, currentTl.playstyle!)
|
if (currentTl.nerdStats != null) Graphs(currentTl.apm!, currentTl.pps!, currentTl.vs!, currentTl.nerdStats!, currentTl.playstyle!)
|
||||||
]
|
]
|
||||||
: [
|
: [
|
||||||
Text(widget.bot ? t.botTL : t.neverPlayedTL, style: const TextStyle(fontFamily: "Eurostile Round", fontSize: 28)),
|
Center(child: Text(widget.guest ? t.anonTL : widget.bot ? t.botTL : t.neverPlayedTL, style: const TextStyle(fontFamily: "Eurostile Round", fontSize: 28), textAlign: TextAlign.center,)),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue