mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-19 10:39:26 +01:00
feat: Use SalomonBottomBar
This commit is contained in:
parent
10480ec408
commit
ae0a720d16
@ -56,12 +56,7 @@ class ChatListView extends StatelessWidget {
|
|||||||
? null
|
? null
|
||||||
: selectMode == SelectMode.select
|
: selectMode == SelectMode.select
|
||||||
? [
|
? [
|
||||||
if (controller.spaces.isNotEmpty &&
|
if (controller.spaces.isNotEmpty)
|
||||||
!Matrix.of(context)
|
|
||||||
.client
|
|
||||||
.getRoomById(
|
|
||||||
controller.selectedRoomIds.single)
|
|
||||||
.isDirectChat)
|
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: L10n.of(context).addToSpace,
|
tooltip: L10n.of(context).addToSpace,
|
||||||
icon: const Icon(Icons.group_work_outlined),
|
icon: const Icon(Icons.group_work_outlined),
|
||||||
|
@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
|
import 'package:salomon_bottom_bar/salomon_bottom_bar.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
||||||
import 'package:fluffychat/widgets/avatar.dart';
|
import 'package:fluffychat/widgets/avatar.dart';
|
||||||
@ -17,29 +18,32 @@ class SpacesBottomBar extends StatelessWidget {
|
|||||||
: controller.spaces
|
: controller.spaces
|
||||||
.indexWhere((space) => controller.activeSpaceId == space.id) +
|
.indexWhere((space) => controller.activeSpaceId == space.id) +
|
||||||
1;
|
1;
|
||||||
return BottomNavigationBar(
|
return Material(
|
||||||
|
color: Theme.of(context).appBarTheme.backgroundColor,
|
||||||
|
elevation: 6,
|
||||||
|
child: SalomonBottomBar(
|
||||||
|
itemPadding: const EdgeInsets.all(8),
|
||||||
currentIndex: currentIndex,
|
currentIndex: currentIndex,
|
||||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
||||||
landscapeLayout: BottomNavigationBarLandscapeLayout.spread,
|
|
||||||
onTap: (i) => controller.setActiveSpaceId(
|
onTap: (i) => controller.setActiveSpaceId(
|
||||||
context,
|
context,
|
||||||
i == 0 ? null : controller.spaces[i - 1].id,
|
i == 0 ? null : controller.spaces[i - 1].id,
|
||||||
),
|
),
|
||||||
items: [
|
items: [
|
||||||
BottomNavigationBarItem(
|
SalomonBottomBarItem(
|
||||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
||||||
icon: const Icon(CupertinoIcons.chat_bubble_2),
|
icon: const Icon(CupertinoIcons.chat_bubble_2),
|
||||||
label: L10n.of(context).allChats,
|
activeIcon: const Icon(CupertinoIcons.chat_bubble_2_fill),
|
||||||
|
title: Text(L10n.of(context).allChats),
|
||||||
),
|
),
|
||||||
...controller.spaces
|
...controller.spaces
|
||||||
.map((space) => BottomNavigationBarItem(
|
.map((space) => SalomonBottomBarItem(
|
||||||
icon: InkWell(
|
icon: InkWell(
|
||||||
borderRadius: BorderRadius.circular(28),
|
borderRadius: BorderRadius.circular(28),
|
||||||
onTap: () => controller.setActiveSpaceId(
|
onTap: () => controller.setActiveSpaceId(
|
||||||
context,
|
context,
|
||||||
space.id,
|
space.id,
|
||||||
),
|
),
|
||||||
onLongPress: () => controller.editSpace(context, space.id),
|
onLongPress: () =>
|
||||||
|
controller.editSpace(context, space.id),
|
||||||
child: Avatar(
|
child: Avatar(
|
||||||
space.avatar,
|
space.avatar,
|
||||||
space.displayname,
|
space.displayname,
|
||||||
@ -47,10 +51,11 @@ class SpacesBottomBar extends StatelessWidget {
|
|||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
label: space.displayname,
|
title: Text(space.displayname),
|
||||||
))
|
))
|
||||||
.toList(),
|
.toList(),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1152,6 +1152,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.26.0"
|
version: "0.26.0"
|
||||||
|
salomon_bottom_bar:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: salomon_bottom_bar
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0"
|
||||||
scroll_to_index:
|
scroll_to_index:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -61,6 +61,7 @@ dependencies:
|
|||||||
qr_flutter: ^4.0.0
|
qr_flutter: ^4.0.0
|
||||||
receive_sharing_intent: ^1.4.5
|
receive_sharing_intent: ^1.4.5
|
||||||
record: ^3.0.0
|
record: ^3.0.0
|
||||||
|
salomon_bottom_bar: ^3.1.0
|
||||||
scroll_to_index: ^2.1.0
|
scroll_to_index: ^2.1.0
|
||||||
sembast_web: ^2.0.1+1
|
sembast_web: ^2.0.1+1
|
||||||
sentry: ^6.0.1
|
sentry: ^6.0.1
|
||||||
|
Loading…
Reference in New Issue
Block a user