ui improvements
This commit is contained in:
+2
@@ -35,7 +35,9 @@ class ExtensionBadgeIcon extends StatelessWidget {
|
|||||||
label: hasBadge ? Text(state.badgeText!) : null,
|
label: hasBadge ? Text(state.badgeText!) : null,
|
||||||
textColor: state.badgeTextColor,
|
textColor: state.badgeTextColor,
|
||||||
backgroundColor: state.badgeBackgroundColor,
|
backgroundColor: state.badgeBackgroundColor,
|
||||||
|
child: RepaintBoundary(
|
||||||
child: RawImage(image: state.icon?.value, width: 24, height: 24),
|
child: RawImage(image: state.icon?.value, width: 24, height: 24),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-37
@@ -380,14 +380,20 @@ class ViewTabsSheetWidget extends HookConsumerWidget {
|
|||||||
return Stack(
|
return Stack(
|
||||||
alignment: Alignment.bottomRight,
|
alignment: Alignment.bottomRight,
|
||||||
children: [
|
children: [
|
||||||
Column(
|
NestedScrollView(
|
||||||
children: [
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
DraggableScrollableHeader(
|
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||||
|
SliverToBoxAdapter(
|
||||||
|
child: DraggableScrollableHeader(
|
||||||
controller: draggableScrollableController,
|
controller: draggableScrollableController,
|
||||||
child: _TabSheetHeader(onClose: onClose, treeViewEnabled: false),
|
child: _TabSheetHeader(
|
||||||
|
onClose: onClose,
|
||||||
|
treeViewEnabled: false,
|
||||||
),
|
),
|
||||||
Expanded(
|
),
|
||||||
child: HookConsumer(
|
),
|
||||||
|
],
|
||||||
|
body: HookConsumer(
|
||||||
builder: (context, ref, child) {
|
builder: (context, ref, child) {
|
||||||
final gridViewKey = useMemoized(() => GlobalKey());
|
final gridViewKey = useMemoized(() => GlobalKey());
|
||||||
|
|
||||||
@@ -455,8 +461,7 @@ class ViewTabsSheetWidget extends HookConsumerWidget {
|
|||||||
() => sheetScrollController.hasClients,
|
() => sheetScrollController.hasClients,
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(
|
useEffect(() {
|
||||||
() {
|
|
||||||
if (scrollControllerIsAttached) {
|
if (scrollControllerIsAttached) {
|
||||||
if (lastScroll.value != activeTab) {
|
if (lastScroll.value != activeTab) {
|
||||||
final index = filteredTabEntities.value.indexWhere(
|
final index = filteredTabEntities.value.indexWhere(
|
||||||
@@ -482,13 +487,7 @@ class ViewTabsSheetWidget extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
},
|
}, [filteredTabEntities, activeTab, scrollControllerIsAttached]);
|
||||||
[
|
|
||||||
filteredTabEntities,
|
|
||||||
activeTab,
|
|
||||||
scrollControllerIsAttached,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
|
|
||||||
final tabs = useMemoized(() {
|
final tabs = useMemoized(() {
|
||||||
return [
|
return [
|
||||||
@@ -496,10 +495,7 @@ class ViewTabsSheetWidget extends HookConsumerWidget {
|
|||||||
(entity) => CustomDraggable(
|
(entity) => CustomDraggable(
|
||||||
key: Key(entity.tabId),
|
key: Key(entity.tabId),
|
||||||
data: TabDragData(entity.tabId),
|
data: TabDragData(entity.tabId),
|
||||||
child: _TabDraggable(
|
child: _TabDraggable(entity: entity, onClose: onClose),
|
||||||
entity: entity,
|
|
||||||
onClose: onClose,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
...suggestedTabEntities.value.map(
|
...suggestedTabEntities.value.map(
|
||||||
@@ -547,35 +543,31 @@ class ViewTabsSheetWidget extends HookConsumerWidget {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final tabId =
|
final tabId = filteredTabEntities.value[oldIndex].tabId;
|
||||||
filteredTabEntities.value[oldIndex].tabId;
|
|
||||||
final containerId = await ref
|
final containerId = await ref
|
||||||
.read(tabDataRepositoryProvider.notifier)
|
.read(tabDataRepositoryProvider.notifier)
|
||||||
.getContainerTabId(tabId);
|
.getContainerTabId(tabId);
|
||||||
|
|
||||||
final String key;
|
final String key;
|
||||||
if (newIndex <= 0) {
|
if (newIndex <= 0) {
|
||||||
key = await containerRepository
|
key = await containerRepository.getLeadingOrderKey(
|
||||||
.getLeadingOrderKey(containerId);
|
containerId,
|
||||||
|
);
|
||||||
} else if (newIndex >=
|
} else if (newIndex >=
|
||||||
filteredTabEntities.value.length - 1) {
|
filteredTabEntities.value.length - 1) {
|
||||||
key = await containerRepository
|
key = await containerRepository.getTrailingOrderKey(
|
||||||
.getTrailingOrderKey(containerId);
|
containerId,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
if (newIndex < oldIndex) {
|
if (newIndex < oldIndex) {
|
||||||
key = await containerRepository
|
key = await containerRepository.getOrderKeyAfterTab(
|
||||||
.getOrderKeyAfterTab(
|
filteredTabEntities.value[newIndex - 1].tabId,
|
||||||
filteredTabEntities
|
|
||||||
.value[newIndex - 1]
|
|
||||||
.tabId,
|
|
||||||
containerId,
|
containerId,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
key = await containerRepository
|
key = await containerRepository
|
||||||
.getOrderKeyBeforeTab(
|
.getOrderKeyBeforeTab(
|
||||||
filteredTabEntities
|
filteredTabEntities.value[newIndex + 1].tabId,
|
||||||
.value[newIndex + 1]
|
|
||||||
.tabId,
|
|
||||||
containerId,
|
containerId,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -589,8 +581,7 @@ class ViewTabsSheetWidget extends HookConsumerWidget {
|
|||||||
return GridView.builder(
|
return GridView.builder(
|
||||||
key: gridViewKey,
|
key: gridViewKey,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
gridDelegate:
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
//Sync values for itemHeight calculation _calculateItemHeight
|
//Sync values for itemHeight calculation _calculateItemHeight
|
||||||
childAspectRatio: 0.75,
|
childAspectRatio: 0.75,
|
||||||
mainAxisSpacing: 8.0,
|
mainAxisSpacing: 8.0,
|
||||||
@@ -609,8 +600,6 @@ class ViewTabsSheetWidget extends HookConsumerWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
top: _TabSheetHeader.headerSize + 4,
|
top: _TabSheetHeader.headerSize + 4,
|
||||||
|
|||||||
Reference in New Issue
Block a user