mirror of
https://github.com/Myzel394/quid_faciam_hodie.git
synced 2025-06-19 15:45:26 +02:00
added calendar animation
This commit is contained in:
parent
8c8d561966
commit
f300e52993
@ -71,6 +71,7 @@ class MyApp extends StatelessWidget {
|
||||
GrantPermissionScreen.ID: (context) => const GrantPermissionScreen(),
|
||||
CalendarScreen.ID: (context) => const CalendarScreen(),
|
||||
},
|
||||
initialRoute: CalendarScreen.ID);
|
||||
initialRoute: initialPage,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,11 @@ class _CalendarScreenState extends State<CalendarScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (calendar.isInitializing) {
|
||||
return CircularProgressIndicator();
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final theme = Theme.of(context);
|
||||
|
@ -6,6 +6,8 @@ import 'package:share_location/utils/loadable.dart';
|
||||
import 'package:share_location/widgets/timeline_page.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
|
||||
import 'calendar_screen.dart';
|
||||
|
||||
final supabase = Supabase.instance.client;
|
||||
|
||||
class TimelineScreen extends StatefulWidget {
|
||||
@ -95,7 +97,13 @@ class _TimelineScreenState extends State<TimelineScreen> with Loadable {
|
||||
);
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
await Navigator.pushNamed(context, CalendarScreen.ID);
|
||||
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
body: ChangeNotifierProvider.value(
|
||||
value: timeline,
|
||||
child: PageView.builder(
|
||||
@ -120,6 +128,7 @@ class _TimelineScreenState extends State<TimelineScreen> with Loadable {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ import 'package:flutter_calendar_widget/flutter_calendar_widget.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:share_location/constants/spacing.dart';
|
||||
import 'package:share_location/screens/timeline_screen.dart';
|
||||
import 'package:share_location/widgets/delay_render.dart';
|
||||
import 'package:share_location/widgets/fade_and_move_in_animation.dart';
|
||||
|
||||
class MonthCalendarBuilder extends CalendarBuilder {
|
||||
@override
|
||||
@ -35,7 +37,12 @@ class MonthCalendarBuilder extends CalendarBuilder {
|
||||
return amount / highestAmountOfEvents;
|
||||
}();
|
||||
|
||||
return Opacity(
|
||||
final duration = Duration(milliseconds: Random().nextInt(800));
|
||||
|
||||
return DelayRender(
|
||||
delay: duration,
|
||||
child: FadeAndMoveInAnimation(
|
||||
child: Opacity(
|
||||
opacity: () {
|
||||
if (type.isOutSide) {
|
||||
return 0.0;
|
||||
@ -75,6 +82,8 @@ class MonthCalendarBuilder extends CalendarBuilder {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user