Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/presentation/calendar/screens/calendar_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
Future<void> _openCreateScheduleSheet(BuildContext context) async {
final saved = await showModalBottomSheet<bool>(
context: context,
isDismissible: false,
isScrollControlled: true,
backgroundColor: Colors.transparent,
builder: (context) =>
Expand Down
11 changes: 3 additions & 8 deletions lib/presentation/shared/components/bottom_nav_bar_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class _BottomNavigationBarScaffoldState extends State<BottomNavBarScaffold> {
onPressed: () {
showModalBottomSheet(
context: context,
isDismissible: false,
isScrollControlled: true,
backgroundColor: Colors.transparent,
builder: (context) => const ScheduleCreateScreen(),
Expand Down Expand Up @@ -174,10 +175,7 @@ class _HomeIcon extends StatelessWidget {
semanticsLabel: AppLocalizations.of(context)!.home,
height: iconTheme.size,
fit: BoxFit.contain,
colorFilter: ColorFilter.mode(
iconTheme.color!,
BlendMode.srcIn,
),
colorFilter: ColorFilter.mode(iconTheme.color!, BlendMode.srcIn),
);
}
}
Expand All @@ -194,10 +192,7 @@ class _MyIcon extends StatelessWidget {
semanticsLabel: AppLocalizations.of(context)!.myPage,
height: iconTheme.size,
fit: BoxFit.contain,
colorFilter: ColorFilter.mode(
iconTheme.color!,
BlendMode.srcIn,
),
colorFilter: ColorFilter.mode(iconTheme.color!, BlendMode.srcIn),
);
}
}
Expand Down
116 changes: 65 additions & 51 deletions lib/presentation/shared/components/cupertino_picker_modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ extension ModalBottomSheetExtension on BuildContext {
required Duration initialValue,
required CupertinoTimerPickerMode mode,
required Function(Duration value) onSaved,
Function? onDisposed,
VoidCallback? onDisposed,
}) {
showModalBottomSheet<void>(
isDismissible: false,
isDismissible: true,
context: this,
builder: (BuildContext context) {
final textTheme = Theme.of(context).textTheme;
Expand Down Expand Up @@ -41,18 +41,20 @@ extension ModalBottomSheetExtension on BuildContext {
Expanded(
flex: 1,
child: ElevatedButton(
onPressed: () {
//calling order matters
Navigator.pop(context);
onDisposed?.call();
},
style: ButtonStyle(
backgroundColor: WidgetStatePropertyAll(
Color.fromARGB(255, 220, 227, 255)),
foregroundColor: WidgetStatePropertyAll(
Color.fromARGB(255, 92, 121, 251)),
onPressed: () {
//calling order matters
Navigator.pop(context);
},
style: ButtonStyle(
backgroundColor: WidgetStatePropertyAll(
Color.fromARGB(255, 220, 227, 255),
),
child: Text(AppLocalizations.of(this)!.cancel)),
foregroundColor: WidgetStatePropertyAll(
Color.fromARGB(255, 92, 121, 251),
),
),
child: Text(AppLocalizations.of(this)!.cancel),
),
),
SizedBox(width: 20.0),
Expanded(
Expand All @@ -61,7 +63,6 @@ extension ModalBottomSheetExtension on BuildContext {
onPressed: () {
Navigator.pop(context);
onSaved(duration);
onDisposed?.call();
},
child: Text(AppLocalizations.of(this)!.ok),
),
Expand All @@ -73,17 +74,19 @@ extension ModalBottomSheetExtension on BuildContext {
),
);
},
);
).whenComplete(() {
onDisposed?.call();
});
}

void showCupertinoMinutePickerModal({
required String title,
required Duration initialValue,
required Function(Duration value) onSaved,
Function? onDisposed,
VoidCallback? onDisposed,
}) {
showModalBottomSheet<void>(
isDismissible: false,
isDismissible: true,
context: this,
builder: (BuildContext context) {
final textTheme = Theme.of(context).textTheme;
Expand All @@ -92,8 +95,10 @@ extension ModalBottomSheetExtension on BuildContext {
borderRadius: BorderRadius.vertical(top: Radius.circular(20.0)),
child: Container(
color: Theme.of(context).colorScheme.surface,
padding:
const EdgeInsets.symmetric(horizontal: 29.0, vertical: 28.0),
padding: const EdgeInsets.symmetric(
horizontal: 29.0,
vertical: 28.0,
),
child: SizedBox(
height: 334,
child: Column(
Expand All @@ -106,16 +111,19 @@ extension ModalBottomSheetExtension on BuildContext {
width: 69.0,
child: CupertinoPicker(
scrollController: FixedExtentScrollController(
initialItem: initialValue.inMinutes),
initialItem: initialValue.inMinutes,
),
looping: true,
itemExtent: 32,
onSelectedItemChanged: (int value) {
minutes = value;
},
children: List.generate(
60,
(index) => Text(
(index < 10 ? '0' : '') + index.toString())),
60,
(index) => Text(
(index < 10 ? '0' : '') + index.toString(),
),
),
),
),
),
Expand All @@ -127,18 +135,20 @@ extension ModalBottomSheetExtension on BuildContext {
Expanded(
flex: 1,
child: ElevatedButton(
onPressed: () {
//calling order matters
Navigator.pop(context);
onDisposed?.call();
},
style: ButtonStyle(
backgroundColor: WidgetStatePropertyAll(
Color.fromARGB(255, 220, 227, 255)),
foregroundColor: WidgetStatePropertyAll(
Color.fromARGB(255, 92, 121, 251)),
onPressed: () {
//calling order matters
Navigator.pop(context);
},
style: ButtonStyle(
backgroundColor: WidgetStatePropertyAll(
Color.fromARGB(255, 220, 227, 255),
),
foregroundColor: WidgetStatePropertyAll(
Color.fromARGB(255, 92, 121, 251),
),
child: Text(AppLocalizations.of(this)!.cancel)),
),
child: Text(AppLocalizations.of(this)!.cancel),
),
),
SizedBox(width: 20.0),
Expanded(
Expand All @@ -147,7 +157,6 @@ extension ModalBottomSheetExtension on BuildContext {
onPressed: () {
Navigator.pop(context);
onSaved(Duration(minutes: minutes));
onDisposed?.call();
},
child: Text(AppLocalizations.of(this)!.ok),
),
Expand All @@ -160,18 +169,20 @@ extension ModalBottomSheetExtension on BuildContext {
),
);
},
);
).whenComplete(() {
onDisposed?.call();
});
}

void showCupertinoDatePickerModal({
required String title,
required DateTime initialValue,
required Function(DateTime value) onSaved,
required CupertinoDatePickerMode mode,
Function? onDisposed,
VoidCallback? onDisposed,
}) {
showModalBottomSheet<void>(
isDismissible: false,
isDismissible: true,
context: this,
builder: (BuildContext context) {
final textTheme = Theme.of(context).textTheme;
Expand Down Expand Up @@ -203,18 +214,20 @@ extension ModalBottomSheetExtension on BuildContext {
Expanded(
flex: 1,
child: ElevatedButton(
onPressed: () {
//calling order matters
Navigator.pop(context);
onDisposed?.call();
},
style: ButtonStyle(
backgroundColor: WidgetStatePropertyAll(
Color.fromARGB(255, 220, 227, 255)),
foregroundColor: WidgetStatePropertyAll(
Color.fromARGB(255, 92, 121, 251)),
onPressed: () {
//calling order matters
Navigator.pop(context);
},
style: ButtonStyle(
backgroundColor: WidgetStatePropertyAll(
Color.fromARGB(255, 220, 227, 255),
),
foregroundColor: WidgetStatePropertyAll(
Color.fromARGB(255, 92, 121, 251),
),
child: Text(AppLocalizations.of(this)!.cancel)),
),
child: Text(AppLocalizations.of(this)!.cancel),
),
),
SizedBox(width: 20.0),
Expanded(
Expand All @@ -223,7 +236,6 @@ extension ModalBottomSheetExtension on BuildContext {
onPressed: () {
Navigator.pop(context);
onSaved(dateTime);
onDisposed?.call();
},
child: Text(AppLocalizations.of(this)!.ok),
),
Expand All @@ -235,6 +247,8 @@ extension ModalBottomSheetExtension on BuildContext {
),
);
},
);
).whenComplete(() {
onDisposed?.call();
});
}
}
Loading