немножко оптiмiзации и чистка кала за коки
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_symbols_icons/symbols.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
@@ -60,6 +63,12 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
}
|
||||
|
||||
void _onChatSelected(DesktopChatSelection chat) {
|
||||
if (chat.imageUrl.isNotEmpty) {
|
||||
unawaited(precacheImage(
|
||||
CachedNetworkImageProvider(chat.imageUrl, maxWidth: 144, maxHeight: 144),
|
||||
context,
|
||||
));
|
||||
}
|
||||
setState(() => _selected = chat);
|
||||
}
|
||||
|
||||
@@ -84,7 +93,7 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
if (constraints.maxWidth < _breakpoint) {
|
||||
return ChatListScreen(onChatSelected: _onChatSelected);
|
||||
return const ChatListScreen();
|
||||
}
|
||||
final totalWidth = constraints.maxWidth;
|
||||
final effectiveListWidth = _listWidth.clamp(
|
||||
|
||||
Reference in New Issue
Block a user