Skip to content

Commit 285b4f2

Browse files
committed
Add opacity to FloatingActionButton in NoteView and MemoriesOnDay for improved UI consistency
1 parent 25ffaa2 commit 285b4f2

File tree

2 files changed

+51
-48
lines changed

2 files changed

+51
-48
lines changed

lib/screens/components/note_view.dart

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,14 @@ class NoteViewState extends State<NoteView> {
7171
crossAxisAlignment: CrossAxisAlignment.start,
7272
children: [
7373
widget.note.isMarkdown
74-
? MarkdownBodyHere(
75-
data: widget.note.content,
76-
isPrivate: widget.note.isPrivate
77-
)
74+
? MarkdownBodyHere(data: widget.note.content, isPrivate: widget.note.isPrivate)
7875
: Text(
79-
widget.note.formattedContent,
80-
style: TextStyle(
81-
fontSize: 16.0,
82-
color: widget.note.isPrivate ? Colors.grey : Colors.black,
83-
),
84-
),
76+
widget.note.formattedContent,
77+
style: TextStyle(
78+
fontSize: 16.0,
79+
color: widget.note.isPrivate ? Colors.grey : Colors.black,
80+
),
81+
),
8582
],
8683
),
8784
),
@@ -101,29 +98,32 @@ class NoteViewState extends State<NoteView> {
10198
Positioned(
10299
right: 16,
103100
bottom: 16,
104-
child: FloatingActionButton(
105-
onPressed: () async {
106-
final navigator = Navigator.of(context);
107-
final newNote = await Navigator.push(
108-
context,
109-
MaterialPageRoute(
110-
builder: (context) => NewNote(
111-
isPrivate: widget.note.isPrivate,
112-
initialTag: '@${widget.note.id}',
113-
onNoteSaved: navigator.pop,
101+
child: Opacity(
102+
opacity: 0.5,
103+
child: FloatingActionButton(
104+
onPressed: () async {
105+
final navigator = Navigator.of(context);
106+
final newNote = await Navigator.push(
107+
context,
108+
MaterialPageRoute(
109+
builder: (context) => NewNote(
110+
isPrivate: widget.note.isPrivate,
111+
initialTag: '@${widget.note.id}',
112+
onNoteSaved: navigator.pop,
113+
),
114114
),
115-
),
116-
);
117-
if (newNote != null) {
118-
await _loadLinkedNotes();
119-
}
120-
},
121-
child: const Icon(Icons.add),
115+
);
116+
if (newNote != null) {
117+
await _loadLinkedNotes();
118+
}
119+
},
120+
child: const Icon(Icons.add),
121+
),
122122
),
123123
),
124124
],
125125
);
126126
},
127127
);
128128
}
129-
}
129+
}

lib/screens/memories/memories_on_day.dart

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -123,26 +123,29 @@ class MemoriesOnDayState extends State<MemoriesOnDay> with RouteAware {
123123
Positioned(
124124
right: 16,
125125
bottom: 16,
126-
child: FloatingActionButton(
127-
onPressed: () async {
128-
final navigator = Navigator.of(context);
129-
final newNote = await Navigator.push(
130-
context,
131-
MaterialPageRoute(
132-
builder: (context) => NewNote(
133-
date: widget.date,
134-
isPrivate: true,
135-
onNoteSaved: (note) async {
136-
navigator.pop();
137-
},
126+
child: Opacity(
127+
opacity: 0.5,
128+
child: FloatingActionButton(
129+
onPressed: () async {
130+
final navigator = Navigator.of(context);
131+
final newNote = await Navigator.push(
132+
context,
133+
MaterialPageRoute(
134+
builder: (context) => NewNote(
135+
date: widget.date,
136+
isPrivate: true,
137+
onNoteSaved: (note) async {
138+
navigator.pop();
139+
},
140+
),
138141
),
139-
),
140-
);
141-
if (newNote != null) {
142-
setState(() {});
143-
}
144-
},
145-
child: const Icon(Icons.add),
142+
);
143+
if (newNote != null) {
144+
setState(() {});
145+
}
146+
},
147+
child: const Icon(Icons.add),
148+
),
146149
),
147150
),
148151
],
@@ -154,4 +157,4 @@ class MemoriesOnDayState extends State<MemoriesOnDay> with RouteAware {
154157
),
155158
);
156159
}
157-
}
160+
}

0 commit comments

Comments
 (0)