change: Minor design improvements
This commit is contained in:
parent
1c80090ccb
commit
387e027885
8 changed files with 80 additions and 37 deletions
|
|
@ -17,28 +17,12 @@ class _ArchiveState extends State<Archive> {
|
|||
return await Matrix.of(context).client.archive;
|
||||
}
|
||||
|
||||
final ScrollController _scrollController = ScrollController();
|
||||
bool _scrolledToTop = true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_scrollController.addListener(() async {
|
||||
if (_scrollController.position.pixels > 0 && _scrolledToTop) {
|
||||
setState(() => _scrolledToTop = false);
|
||||
} else if (_scrollController.position.pixels == 0 && !_scrolledToTop) {
|
||||
setState(() => _scrolledToTop = true);
|
||||
}
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: BackButton(),
|
||||
title: Text(L10n.of(context).archive),
|
||||
elevation: _scrolledToTop ? 0 : null,
|
||||
),
|
||||
body: FutureBuilder<List<Room>>(
|
||||
future: getArchive(context),
|
||||
|
|
@ -48,7 +32,6 @@ class _ArchiveState extends State<Archive> {
|
|||
} else {
|
||||
archive = snapshot.data;
|
||||
return ListView.builder(
|
||||
controller: _scrollController,
|
||||
itemCount: archive.length,
|
||||
itemBuilder: (BuildContext context, int i) => ChatListItem(
|
||||
archive[i],
|
||||
|
|
|
|||
|
|
@ -213,14 +213,16 @@ class _ChatListState extends State<ChatList> {
|
|||
size: 80,
|
||||
color: Colors.grey,
|
||||
),
|
||||
Text(
|
||||
searchMode
|
||||
? L10n.of(context).noRoomsFound
|
||||
: L10n.of(context).startYourFirstChat,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 16,
|
||||
Center(
|
||||
child: Text(
|
||||
searchMode
|
||||
? L10n.of(context).noRoomsFound
|
||||
: L10n.of(context).startYourFirstChat,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import 'package:fluffychat/components/avatar.dart';
|
|||
import 'package:fluffychat/components/default_app_bar_search_field.dart';
|
||||
import 'package:fluffychat/components/list_items/contact_list_tile.dart';
|
||||
import 'package:fluffychat/components/matrix.dart';
|
||||
import 'package:fluffychat/utils/fluffy_share.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../utils/client_presence_extension.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
|
@ -83,13 +84,41 @@ class _ContactListState extends State<ContactList> {
|
|||
.contains(_searchQuery.toLowerCase()))
|
||||
.toList();
|
||||
if (contactList.isEmpty) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'No contacts found...',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(height: 32),
|
||||
Icon(
|
||||
Icons.people_outlined,
|
||||
size: 80,
|
||||
color: Colors.grey,
|
||||
),
|
||||
RaisedButton(
|
||||
elevation: 7,
|
||||
color: Theme.of(context).primaryColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.share_outlined, color: Colors.white),
|
||||
SizedBox(width: 16),
|
||||
Text(
|
||||
L10n.of(context).inviteContact,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
onPressed: () => FluffyShare.share(
|
||||
L10n.of(context).inviteText(
|
||||
Matrix.of(context).client.userID,
|
||||
'https://matrix.to/#/${Matrix.of(context).client.userID}'),
|
||||
context),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
return ListView.builder(
|
||||
|
|
|
|||
|
|
@ -173,11 +173,26 @@ class _DiscoverState extends State<Discover> {
|
|||
}
|
||||
final publicRoomsResponse = snapshot.data;
|
||||
if (publicRoomsResponse.chunk.isEmpty) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'No public groups found...',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SizedBox(height: 32),
|
||||
Icon(
|
||||
Icons.search_outlined,
|
||||
size: 80,
|
||||
color: Colors.grey,
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
L10n.of(context).noPublicRoomsFound,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
return GridView.builder(
|
||||
|
|
|
|||
|
|
@ -405,6 +405,11 @@ class _SettingsState extends State<Settings> {
|
|||
AdaptivePageLayout.of(context).pushNamed('/settings/emotes'),
|
||||
trailing: Icon(Icons.insert_emoticon_outlined),
|
||||
),
|
||||
ListTile(
|
||||
title: Text(L10n.of(context).archive),
|
||||
onTap: () => AdaptivePageLayout.of(context).pushNamed('/archive'),
|
||||
trailing: Icon(Icons.archive_outlined),
|
||||
),
|
||||
Divider(thickness: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ class _HomeserverPickerState extends State<HomeserverPicker> {
|
|||
padding: padding,
|
||||
onChanged: (s) => _domain = s,
|
||||
readOnly: !AppConfig.allowOtherHomeservers,
|
||||
onSubmit: (_) => _checkHomeserverAction(context),
|
||||
),
|
||||
elevation: 0,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue