feat: custom appbar

This commit is contained in:
efrilm
2025-08-16 00:39:09 +07:00
parent d334bb8f17
commit d73cd1a574
16 changed files with 207 additions and 1062 deletions
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:table_calendar/table_calendar.dart';
import '../../../common/theme/theme.dart';
import '../../components/appbar/appbar.dart';
// Schedule model dengan optimasi
class Schedule {
@@ -212,107 +213,7 @@ class _SchedulePageState extends State<SchedulePage>
floating: false,
pinned: true,
backgroundColor: AppColor.primary,
actions: [
Container(
margin: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: AppColor.white.withOpacity(0.2),
borderRadius: BorderRadius.circular(12),
),
child: IconButton(
onPressed: () => _showCalendarOptions(),
icon: Icon(
Icons.calendar_view_week,
color: AppColor.white,
size: 24,
),
),
),
],
flexibleSpace: FlexibleSpaceBar(
titlePadding: const EdgeInsets.only(left: 50, bottom: 16),
title: Text(
'My Schedule',
style: TextStyle(
color: AppColor.white,
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
background: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [AppColor.primary, AppColor.primary.withOpacity(0.8)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Stack(
children: [
Positioned(
right: -20,
top: -20,
child: AnimatedBuilder(
animation: rotationAnimation,
builder: (context, child) {
return Transform.rotate(
angle: rotationAnimation.value,
child: Container(
width: 100,
height: 100,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: AppColor.white.withOpacity(0.1),
),
),
);
},
),
),
Positioned(
left: -30,
bottom: -30,
child: AnimatedBuilder(
animation: rotationAnimation,
builder: (context, child) {
return Transform.rotate(
angle: -rotationAnimation.value * 0.5,
child: Container(
width: 80,
height: 80,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: AppColor.white.withOpacity(0.05),
),
),
);
},
),
),
Positioned(
right: 80,
bottom: 30,
child: AnimatedBuilder(
animation: rotationAnimation,
builder: (context, child) {
return Transform.rotate(
angle: -rotationAnimation.value * 0.2,
child: Container(
width: 40,
height: 40,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: AppColor.white.withOpacity(0.08),
),
),
);
},
),
),
],
),
),
),
flexibleSpace: CustomAppBar(title: 'Jadwal'),
);
}
@@ -639,47 +540,6 @@ class _SchedulePageState extends State<SchedulePage>
_slideController.forward();
}
void _showCalendarOptions() {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) => Container(
decoration: BoxDecoration(
color: AppColor.white,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(24),
topRight: Radius.circular(24),
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
margin: const EdgeInsets.only(top: 12),
width: 40,
height: 4,
decoration: BoxDecoration(
color: AppColor.border,
borderRadius: BorderRadius.circular(2),
),
),
Padding(
padding: const EdgeInsets.all(24),
child: Text(
'Calendar Options',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w700,
color: AppColor.textPrimary,
),
),
),
],
),
),
);
}
void _showModernScheduleDetails(Schedule schedule) {
showModalBottomSheet(
context: context,