fix: Design

This commit is contained in:
Christian Pauly 2021-05-30 15:37:39 +02:00
parent 4705b8d998
commit 797ace3948
3 changed files with 3 additions and 22 deletions

View File

@ -97,6 +97,7 @@ abstract class FluffyThemes {
fillColor: lighten(AppConfig.primaryColor, .51), fillColor: lighten(AppConfig.primaryColor, .51),
), ),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
elevation: 2,
brightness: Brightness.light, brightness: Brightness.light,
color: Colors.white, color: Colors.white,
textTheme: TextTheme( textTheme: TextTheme(
@ -178,6 +179,7 @@ abstract class FluffyThemes {
), ),
snackBarTheme: SnackBarThemeData(behavior: SnackBarBehavior.floating), snackBarTheme: SnackBarThemeData(behavior: SnackBarBehavior.floating),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
elevation: 2,
brightness: Brightness.dark, brightness: Brightness.dark,
color: Color(0xff1D1D1D), color: Color(0xff1D1D1D),
textTheme: TextTheme( textTheme: TextTheme(

View File

@ -32,7 +32,6 @@ class ChatList extends StatefulWidget {
} }
class ChatListController extends State<ChatList> { class ChatListController extends State<ChatList> {
final ScrollController scrollController = ScrollController();
StreamSubscription _intentDataStreamSubscription; StreamSubscription _intentDataStreamSubscription;
StreamSubscription _intentFileStreamSubscription; StreamSubscription _intentFileStreamSubscription;
@ -43,15 +42,6 @@ class ChatListController extends State<ChatList> {
String get activeChat => VRouter.of(context).pathParameters['roomid']; String get activeChat => VRouter.of(context).pathParameters['roomid'];
bool scrolledTop = true;
void updateScrolledTop() {
final newScrolledTop = scrollController.offset == 0;
if (scrolledTop != newScrolledTop) {
setState(() => scrolledTop = newScrolledTop);
}
}
void _processIncomingSharedFiles(List<SharedMediaFile> files) { void _processIncomingSharedFiles(List<SharedMediaFile> files) {
if (files?.isEmpty ?? true) return; if (files?.isEmpty ?? true) return;
VRouter.of(context).push('/rooms'); VRouter.of(context).push('/rooms');
@ -119,7 +109,6 @@ class ChatListController extends State<ChatList> {
@override @override
void initState() { void initState() {
_initReceiveSharingIntent(); _initReceiveSharingIntent();
scrollController.addListener(updateScrolledTop);
super.initState(); super.initState();
} }
@ -128,7 +117,6 @@ class ChatListController extends State<ChatList> {
_intentDataStreamSubscription?.cancel(); _intentDataStreamSubscription?.cancel();
_intentFileStreamSubscription?.cancel(); _intentFileStreamSubscription?.cancel();
_intentUriStreamSubscription?.cancel(); _intentUriStreamSubscription?.cancel();
scrollController.removeListener(updateScrolledTop);
super.dispose(); super.dispose();
} }

View File

@ -34,7 +34,6 @@ class ChatListView extends StatelessWidget {
}, },
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
elevation: controller.scrolledTop ? 0 : null,
leading: selectMode == SelectMode.normal leading: selectMode == SelectMode.normal
? null ? null
: IconButton( : IconButton(
@ -230,15 +229,7 @@ class ChatListView extends StatelessWidget {
), ),
]), ]),
floatingActionButton: selectMode == SelectMode.normal floatingActionButton: selectMode == SelectMode.normal
? controller.scrolledTop ? FloatingActionButton(
? FloatingActionButton.extended(
heroTag: 'main_fab',
onPressed: () =>
VRouter.of(context).push('/newprivatechat'),
icon: Icon(CupertinoIcons.chat_bubble),
label: Text(L10n.of(context).newChat),
)
: FloatingActionButton(
heroTag: 'main_fab', heroTag: 'main_fab',
onPressed: () => onPressed: () =>
VRouter.of(context).push('/newprivatechat'), VRouter.of(context).push('/newprivatechat'),