Skip to content

Commit 9388bcd

Browse files
committed
refactor: change to extended floating action button
1 parent 988bf18 commit 9388bcd

File tree

1 file changed

+10
-27
lines changed

1 file changed

+10
-27
lines changed

lib/features/on_going/view/on_going_page.dart

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,21 @@ import 'package:flutter_bloc/flutter_bloc.dart';
55
class OnGoingPage extends StatelessWidget {
66
const OnGoingPage({super.key});
77

8-
@override
9-
Widget build(BuildContext context) {
10-
return const Scaffold(
11-
body: OnGoingScreen(),
12-
floatingActionButton: _FloatingActionButton(),
13-
);
14-
}
15-
}
16-
17-
class _FloatingActionButton extends StatelessWidget {
18-
const _FloatingActionButton();
19-
208
@override
219
Widget build(BuildContext context) {
2210
ThemeData theme = Theme.of(context);
23-
return ElevatedButton.icon(
24-
onPressed: () {
25-
Navigator.push(context, AddWishPage.route()).then(
26-
(_) {
27-
context.read<OnGoingBloc>().add(FetchWishEvent());
28-
},
29-
);
30-
},
31-
style: ElevatedButton.styleFrom(
32-
backgroundColor: theme.colorScheme.primary,
33-
foregroundColor: theme.colorScheme.onPrimary,
34-
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
35-
padding: const EdgeInsets.all(16),
11+
return Scaffold(
3612
backgroundColor: theme.colorScheme.surface,
13+
body: const OnGoingScreen(),
14+
floatingActionButton: FloatingActionButton.extended(
15+
onPressed: () {
16+
Navigator.push(context, AddWishPage.route()).then(
17+
(_) => context.read<OnGoingBloc>().add(FetchWishEvent()),
18+
);
19+
},
20+
label: const Text('Tambah Celengan', style: TextStyle(fontWeight: FontWeight.bold)),
21+
icon: const Icon(Icons.add),
3722
),
38-
icon: const Icon(Icons.add),
39-
label: const Text("Tambah Celengan", style: TextStyle(fontWeight: FontWeight.bold)),
4023
);
4124
}
4225
}

0 commit comments

Comments
 (0)