-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cat-voices): workspace segments behaviour (#1204)
* feat: section initial expand/selection * feat: SpaceScaffold body expands * chore: renaming from selected to active * feat: select step from section when opening while others are closed * refactor: extract common section tile widget * feat: section header on tap * refactor: sections list view with each step as its own item * feat: scrolling to steps * feat: SectionsListViewBuilder * fix: SectionsListView separators * refactor: remove SectionStepOffstage * feat: animated ChevronExpandButton * fix: unused imports
- Loading branch information
1 parent
618f769
commit 7b7c37d
Showing
34 changed files
with
555 additions
and
274 deletions.
There are no files selected for viewing
34 changes: 17 additions & 17 deletions
34
catalyst_voices/apps/voices/lib/pages/treasury/treasury_body.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
import 'package:catalyst_voices/pages/treasury/treasury_campaign_setup.dart'; | ||
import 'package:catalyst_voices/pages/treasury/treasury_dummy_topic_step.dart'; | ||
import 'package:catalyst_voices/widgets/widgets.dart'; | ||
import 'package:catalyst_voices_view_models/catalyst_voices_view_models.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; | ||
|
||
class TreasuryBody extends StatelessWidget { | ||
final List<TreasurySection> sections; | ||
final ItemScrollController itemScrollController; | ||
|
||
const TreasuryBody({ | ||
super.key, | ||
required this.sections, | ||
required this.itemScrollController, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListView.separated( | ||
padding: const EdgeInsets.only(top: 10), | ||
itemCount: sections.length, | ||
itemBuilder: (context, index) { | ||
final section = sections[index]; | ||
|
||
switch (section) { | ||
case CampaignSetup(): | ||
return TreasuryCampaignSetup( | ||
key: ValueKey('CampaignSetupSection[${section.id}]Key'), | ||
data: section, | ||
); | ||
} | ||
return SectionsListViewBuilder( | ||
builder: (context, value, child) { | ||
return SectionsListView<TreasurySection, TreasurySectionStep>( | ||
itemScrollController: itemScrollController, | ||
items: value, | ||
stepBuilder: (context, step) { | ||
switch (step) { | ||
case DummyTopicStep(): | ||
return TreasuryDummyTopicStep(step: step); | ||
} | ||
}, | ||
); | ||
}, | ||
separatorBuilder: (context, index) => const SizedBox(height: 24), | ||
); | ||
} | ||
} |
87 changes: 0 additions & 87 deletions
87
catalyst_voices/apps/voices/lib/pages/treasury/treasury_campaign_setup.dart
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
catalyst_voices/apps/voices/lib/pages/treasury/treasury_dummy_topic_step.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'package:catalyst_voices/widgets/navigation/section_step_state_builder.dart'; | ||
import 'package:catalyst_voices/widgets/widgets.dart'; | ||
import 'package:catalyst_voices_localization/catalyst_voices_localization.dart'; | ||
import 'package:catalyst_voices_view_models/catalyst_voices_view_models.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class TreasuryDummyTopicStep extends StatelessWidget { | ||
final DummyTopicStep step; | ||
|
||
const TreasuryDummyTopicStep({ | ||
super.key, | ||
required this.step, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return SectionStepStateBuilder( | ||
id: step.sectionStepId, | ||
builder: (context, value, child) { | ||
return WorkspaceTextTileContainer( | ||
name: step.localizedName(context), | ||
isSelected: value.isSelected, | ||
headerActions: [ | ||
VoicesTextButton( | ||
onTap: step.isEditable ? () {} : null, | ||
child: Text(context.l10n.stepEdit), | ||
), | ||
], | ||
content: step.localizedDesc(context), | ||
); | ||
}, | ||
); | ||
} | ||
} |
2 changes: 0 additions & 2 deletions
2
catalyst_voices/apps/voices/lib/pages/treasury/treasury_navigation_panel.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 17 additions & 13 deletions
30
catalyst_voices/apps/voices/lib/pages/workspace/workspace_body.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,33 @@ | ||
import 'package:catalyst_voices/pages/workspace/workspace_form_section.dart'; | ||
import 'package:catalyst_voices/pages/workspace/workspace_rich_text_step.dart'; | ||
import 'package:catalyst_voices/widgets/navigation/sections_list_view.dart'; | ||
import 'package:catalyst_voices/widgets/navigation/sections_list_view_builder.dart'; | ||
import 'package:catalyst_voices_view_models/catalyst_voices_view_models.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; | ||
|
||
class WorkspaceBody extends StatelessWidget { | ||
final List<WorkspaceSection> sections; | ||
final ItemScrollController itemScrollController; | ||
|
||
const WorkspaceBody({ | ||
super.key, | ||
required this.sections, | ||
required this.itemScrollController, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListView.separated( | ||
padding: const EdgeInsets.only(top: 10), | ||
itemCount: sections.length, | ||
itemBuilder: (context, index) { | ||
final section = sections[index]; | ||
|
||
return WorkspaceFormSection( | ||
key: ValueKey('WorkspaceSection[${section.id}]Key'), | ||
data: section, | ||
return SectionsListViewBuilder( | ||
builder: (context, value, child) { | ||
return SectionsListView<WorkspaceSection, WorkspaceSectionStep>( | ||
itemScrollController: itemScrollController, | ||
items: value, | ||
stepBuilder: (context, step) { | ||
switch (step) { | ||
case RichTextStep(): | ||
return WorkspaceRichTextStep(step: step); | ||
} | ||
}, | ||
); | ||
}, | ||
separatorBuilder: (context, index) => const SizedBox(height: 24), | ||
); | ||
} | ||
} |
79 changes: 0 additions & 79 deletions
79
catalyst_voices/apps/voices/lib/pages/workspace/workspace_form_section.dart
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
catalyst_voices/apps/voices/lib/pages/workspace/workspace_navigation_panel.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.