@@ -70,28 +70,35 @@ class AddWishScreen extends StatelessWidget {
7070 style: theme.textTheme.titleSmall? .copyWith (color: theme.colorScheme.primary),
7171 ),
7272 const SizedBox (height: 8 ),
73- Padding (
74- padding: const EdgeInsets .all (8.0 ),
75- child: Row (
76- mainAxisAlignment: MainAxisAlignment .center,
77- children: const [
78- CustomRadioOutlinedButton (
79- borderRadius: BorderRadius .horizontal (left: Radius .circular (50 )),
80- labelText: 'Harian' ,
81- value: SavingPlan .daily,
82- ),
83- CustomRadioOutlinedButton (
84- borderRadius: null ,
85- labelText: 'Mingguan' ,
86- value: SavingPlan .weekly,
87- ),
88- CustomRadioOutlinedButton (
89- borderRadius: BorderRadius .horizontal (right: Radius .circular (50 )),
90- labelText: 'Bulanan' ,
91- value: SavingPlan .monthly,
92- ),
93- ],
94- ),
73+ Row (
74+ mainAxisAlignment: MainAxisAlignment .center,
75+ children: [
76+ BlocBuilder <AddWishBloc , AddWishState >(
77+ builder: (context, state) {
78+ return SegmentedButton <SavingPlan >(
79+ onSelectionChanged: (newSelection) {
80+ context.read <AddWishBloc >().add (WishSavingPlanChanged (savingPlan: newSelection.first));
81+ },
82+ showSelectedIcon: false ,
83+ segments: const [
84+ ButtonSegment (
85+ value: SavingPlan .daily,
86+ label: Text ('Harian' ),
87+ ),
88+ ButtonSegment (
89+ value: SavingPlan .weekly,
90+ label: Text ('Mingguan' ),
91+ ),
92+ ButtonSegment (
93+ value: SavingPlan .monthly,
94+ label: Text ('Bulanan' ),
95+ ),
96+ ],
97+ selected: {state.newWish.savingPlan},
98+ );
99+ },
100+ ),
101+ ],
95102 ),
96103 BlocBuilder <AddWishBloc , AddWishState >(
97104 builder: (context, state) {
0 commit comments