feat: Update translations, finish saved views rework, some other fixes

This commit is contained in:
Anton Stubenbord
2023-09-22 00:46:24 +02:00
parent f3560f00ea
commit 18ab657932
55 changed files with 2049 additions and 1087 deletions

View File

@@ -30,6 +30,7 @@ class _LabelsPageState extends State<LabelsPage>
SliverOverlapAbsorberHandle();
late final TabController _tabController;
int _currentIndex = 0;
int _calculateTabCount(UserModel user) => [
@@ -48,6 +49,12 @@ class _LabelsPageState extends State<LabelsPage>
..addListener(() => setState(() => _currentIndex = _tabController.index));
}
@override
void dispose() {
_tabController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return ValueListenableBuilder(
@@ -65,8 +72,17 @@ class _LabelsPageState extends State<LabelsPage>
return SafeArea(
child: Scaffold(
drawer: const AppDrawer(),
floatingActionButton: FloatingActionButton(
heroTag: "fab_labels_page",
floatingActionButton: FloatingActionButton.extended(
heroTag: "inbox_page_fab",
label: Text(
[
S.of(context)!.addCorrespondent,
S.of(context)!.addDocumentType,
S.of(context)!.addTag,
S.of(context)!.addStoragePath,
][_currentIndex],
),
icon: Icon(Icons.add),
onPressed: [
if (user.canViewCorrespondents)
() => CreateLabelRoute(LabelType.correspondent)
@@ -80,7 +96,6 @@ class _LabelsPageState extends State<LabelsPage>
() => CreateLabelRoute(LabelType.storagePath)
.push(context),
][_currentIndex],
child: const Icon(Icons.add),
),
body: NestedScrollView(
floatHeaderSlivers: true,