feat(directory): enhance toggle UI for Directory and Notes views with improved styling and animations
This commit is contained in:
parent
ae868bb0f6
commit
6907d176da
@ -84,29 +84,100 @@ class DirectoryMainScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
// Toggle between Directory and Notes
|
// Toggle between Directory and Notes
|
||||||
Padding(
|
Padding(
|
||||||
padding: MySpacing.xy(8, 5),
|
padding: MySpacing.fromLTRB(8, 12, 8, 5),
|
||||||
child: Obx(() {
|
child: Obx(() {
|
||||||
final isNotesView = controller.isNotesView.value;
|
final isNotesView = controller.isNotesView.value;
|
||||||
return Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
return Container(
|
||||||
children: [
|
padding: EdgeInsets.all(2),
|
||||||
IconButton(
|
decoration: BoxDecoration(
|
||||||
tooltip: 'Directory View',
|
color: const Color(0xFFF0F0F0),
|
||||||
onPressed: () => controller.isNotesView.value = false,
|
borderRadius: BorderRadius.circular(10),
|
||||||
icon: Icon(
|
boxShadow: [
|
||||||
Icons.contacts,
|
BoxShadow(
|
||||||
color: !isNotesView ? Colors.red : Colors.grey,
|
color: Colors.black.withOpacity(0.05),
|
||||||
|
blurRadius: 4,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
IconButton(
|
),
|
||||||
tooltip: 'Notes View',
|
child: Row(
|
||||||
onPressed: () => controller.isNotesView.value = true,
|
children: [
|
||||||
icon: Icon(
|
Expanded(
|
||||||
Icons.notes,
|
child: GestureDetector(
|
||||||
color: isNotesView ? Colors.red : Colors.grey,
|
onTap: () => controller.isNotesView.value = false,
|
||||||
|
child: AnimatedContainer(
|
||||||
|
duration: const Duration(milliseconds: 200),
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 6, horizontal: 10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: !isNotesView
|
||||||
|
? Colors.red
|
||||||
|
: Colors.transparent,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Icon(Icons.contacts,
|
||||||
|
size: 16,
|
||||||
|
color: !isNotesView
|
||||||
|
? Colors.white
|
||||||
|
: Colors.grey),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Text(
|
||||||
|
'Directory',
|
||||||
|
style: TextStyle(
|
||||||
|
color: !isNotesView
|
||||||
|
? Colors.white
|
||||||
|
: Colors.grey,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 13,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
],
|
child: GestureDetector(
|
||||||
|
onTap: () => controller.isNotesView.value = true,
|
||||||
|
child: AnimatedContainer(
|
||||||
|
duration: const Duration(milliseconds: 200),
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 6, horizontal: 10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color:
|
||||||
|
isNotesView ? Colors.red : Colors.transparent,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Icon(Icons.notes,
|
||||||
|
size: 16,
|
||||||
|
color: isNotesView
|
||||||
|
? Colors.white
|
||||||
|
: Colors.grey),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Text(
|
||||||
|
'Notes',
|
||||||
|
style: TextStyle(
|
||||||
|
color: isNotesView
|
||||||
|
? Colors.white
|
||||||
|
: Colors.grey,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 13,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user