Fix Personal button - create separate button instead of fake Organization object
This commit is contained in:
@@ -192,15 +192,11 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
// Personal workspace button (always show when logged in)
|
// Personal workspace button (always show when logged in)
|
||||||
_buildOrgButton(
|
_buildPersonalButton(selectedOrg == null, () {
|
||||||
Organization(id: '', name: 'Personal'),
|
context.read<OrganizationBloc>().add(
|
||||||
selectedOrg == null,
|
SelectOrganization(''),
|
||||||
() {
|
);
|
||||||
context.read<OrganizationBloc>().add(
|
}),
|
||||||
SelectOrganization(''),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(width: 16),
|
const SizedBox(width: 16),
|
||||||
// Organization tabs
|
// Organization tabs
|
||||||
...orgs.map(
|
...orgs.map(
|
||||||
@@ -252,6 +248,21 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildPersonalButton(bool selected, VoidCallback onTap) {
|
||||||
|
final highlightColor = const Color.fromARGB(255, 100, 200, 255);
|
||||||
|
final defaultColor = AppTheme.secondaryText;
|
||||||
|
return TextButton(
|
||||||
|
onPressed: onTap,
|
||||||
|
child: Text(
|
||||||
|
'Personal',
|
||||||
|
style: TextStyle(
|
||||||
|
color: selected ? highlightColor : defaultColor,
|
||||||
|
fontWeight: selected ? FontWeight.bold : FontWeight.normal,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildAddButton(VoidCallback onTap) {
|
Widget _buildAddButton(VoidCallback onTap) {
|
||||||
final defaultColor = AppTheme.secondaryText;
|
final defaultColor = AppTheme.secondaryText;
|
||||||
return TextButton(
|
return TextButton(
|
||||||
|
|||||||
Reference in New Issue
Block a user