mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-25 19:00:45 +01:00
change: Minor design improvements
This commit is contained in:
parent
c058d39cbb
commit
4e441d8861
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||||||
class DefaultAppBarSearchField extends StatefulWidget {
|
class DefaultAppBarSearchField extends StatefulWidget {
|
||||||
final TextEditingController searchController;
|
final TextEditingController searchController;
|
||||||
final void Function(String) onChanged;
|
final void Function(String) onChanged;
|
||||||
|
final void Function(String) onSubmit;
|
||||||
final Widget suffix;
|
final Widget suffix;
|
||||||
final bool autofocus;
|
final bool autofocus;
|
||||||
final String prefixText;
|
final String prefixText;
|
||||||
@ -15,6 +16,7 @@ class DefaultAppBarSearchField extends StatefulWidget {
|
|||||||
Key key,
|
Key key,
|
||||||
this.searchController,
|
this.searchController,
|
||||||
this.onChanged,
|
this.onChanged,
|
||||||
|
this.onSubmit,
|
||||||
this.suffix,
|
this.suffix,
|
||||||
this.autofocus = false,
|
this.autofocus = false,
|
||||||
this.prefixText,
|
this.prefixText,
|
||||||
@ -75,6 +77,7 @@ class DefaultAppBarSearchFieldState extends State<DefaultAppBarSearchField> {
|
|||||||
onChanged: widget.onChanged,
|
onChanged: widget.onChanged,
|
||||||
focusNode: _focusNode,
|
focusNode: _focusNode,
|
||||||
readOnly: widget.readOnly,
|
readOnly: widget.readOnly,
|
||||||
|
onSubmitted: widget.onSubmit,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
prefixText: widget.prefixText,
|
prefixText: widget.prefixText,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -87,6 +87,11 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
|
"noPublicRoomsFound": "No public rooms found...",
|
||||||
|
"@noPublicRoomsFound": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
"areYouSureYouWantToLogout": "Are you sure you want to log out?",
|
"areYouSureYouWantToLogout": "Are you sure you want to log out?",
|
||||||
"@areYouSureYouWantToLogout": {
|
"@areYouSureYouWantToLogout": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
|
@ -17,28 +17,12 @@ class _ArchiveState extends State<Archive> {
|
|||||||
return await Matrix.of(context).client.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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: BackButton(),
|
leading: BackButton(),
|
||||||
title: Text(L10n.of(context).archive),
|
title: Text(L10n.of(context).archive),
|
||||||
elevation: _scrolledToTop ? 0 : null,
|
|
||||||
),
|
),
|
||||||
body: FutureBuilder<List<Room>>(
|
body: FutureBuilder<List<Room>>(
|
||||||
future: getArchive(context),
|
future: getArchive(context),
|
||||||
@ -48,7 +32,6 @@ class _ArchiveState extends State<Archive> {
|
|||||||
} else {
|
} else {
|
||||||
archive = snapshot.data;
|
archive = snapshot.data;
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
controller: _scrollController,
|
|
||||||
itemCount: archive.length,
|
itemCount: archive.length,
|
||||||
itemBuilder: (BuildContext context, int i) => ChatListItem(
|
itemBuilder: (BuildContext context, int i) => ChatListItem(
|
||||||
archive[i],
|
archive[i],
|
||||||
|
@ -213,14 +213,16 @@ class _ChatListState extends State<ChatList> {
|
|||||||
size: 80,
|
size: 80,
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
Text(
|
Center(
|
||||||
searchMode
|
child: Text(
|
||||||
? L10n.of(context).noRoomsFound
|
searchMode
|
||||||
: L10n.of(context).startYourFirstChat,
|
? L10n.of(context).noRoomsFound
|
||||||
textAlign: TextAlign.center,
|
: L10n.of(context).startYourFirstChat,
|
||||||
style: TextStyle(
|
textAlign: TextAlign.start,
|
||||||
color: Colors.grey,
|
style: TextStyle(
|
||||||
fontSize: 16,
|
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/default_app_bar_search_field.dart';
|
||||||
import 'package:fluffychat/components/list_items/contact_list_tile.dart';
|
import 'package:fluffychat/components/list_items/contact_list_tile.dart';
|
||||||
import 'package:fluffychat/components/matrix.dart';
|
import 'package:fluffychat/components/matrix.dart';
|
||||||
|
import 'package:fluffychat/utils/fluffy_share.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../utils/client_presence_extension.dart';
|
import '../../utils/client_presence_extension.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
@ -83,13 +84,41 @@ class _ContactListState extends State<ContactList> {
|
|||||||
.contains(_searchQuery.toLowerCase()))
|
.contains(_searchQuery.toLowerCase()))
|
||||||
.toList();
|
.toList();
|
||||||
if (contactList.isEmpty) {
|
if (contactList.isEmpty) {
|
||||||
return Container(
|
return Column(
|
||||||
padding: EdgeInsets.all(16),
|
children: [
|
||||||
alignment: Alignment.center,
|
SizedBox(height: 32),
|
||||||
child: Text(
|
Icon(
|
||||||
'No contacts found...',
|
Icons.people_outlined,
|
||||||
textAlign: TextAlign.center,
|
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(
|
return ListView.builder(
|
||||||
|
@ -173,11 +173,26 @@ class _DiscoverState extends State<Discover> {
|
|||||||
}
|
}
|
||||||
final publicRoomsResponse = snapshot.data;
|
final publicRoomsResponse = snapshot.data;
|
||||||
if (publicRoomsResponse.chunk.isEmpty) {
|
if (publicRoomsResponse.chunk.isEmpty) {
|
||||||
return Center(
|
return Column(
|
||||||
child: Text(
|
mainAxisSize: MainAxisSize.min,
|
||||||
'No public groups found...',
|
children: [
|
||||||
textAlign: TextAlign.center,
|
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(
|
return GridView.builder(
|
||||||
|
@ -405,6 +405,11 @@ class _SettingsState extends State<Settings> {
|
|||||||
AdaptivePageLayout.of(context).pushNamed('/settings/emotes'),
|
AdaptivePageLayout.of(context).pushNamed('/settings/emotes'),
|
||||||
trailing: Icon(Icons.insert_emoticon_outlined),
|
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),
|
Divider(thickness: 1),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
|
@ -129,6 +129,7 @@ class _HomeserverPickerState extends State<HomeserverPicker> {
|
|||||||
padding: padding,
|
padding: padding,
|
||||||
onChanged: (s) => _domain = s,
|
onChanged: (s) => _domain = s,
|
||||||
readOnly: !AppConfig.allowOtherHomeservers,
|
readOnly: !AppConfig.allowOtherHomeservers,
|
||||||
|
onSubmit: (_) => _checkHomeserverAction(context),
|
||||||
),
|
),
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user