- Updated various screens to replace hardcoded color values with contentTheme.buttonColor for consistency. - Changed icons in NotesView, UserDocumentsPage, EmployeeDetailPage, EmployeesScreen, ExpenseDetailScreen, and others to use updated icon styles. - Refactored OfflineScreen and TenantSelectionScreen to utilize new wave background widget. - Introduced ThemeEditorWidget in UserProfileBar for dynamic theme adjustments. - Enhanced logout confirmation dialog styling to align with new theme colors.
70 lines
1.7 KiB
Dart
70 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class RedWaveBackground extends StatelessWidget {
|
|
final Color brandRed;
|
|
final double heightFactor;
|
|
|
|
const RedWaveBackground({
|
|
super.key,
|
|
required this.brandRed,
|
|
this.heightFactor = 0.2,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return CustomPaint(
|
|
painter: RedWavePainter(brandRed, heightFactor),
|
|
size: Size.infinite,
|
|
);
|
|
}
|
|
}
|
|
|
|
class RedWavePainter extends CustomPainter {
|
|
final Color brandRed;
|
|
final double heightFactor;
|
|
|
|
RedWavePainter(this.brandRed, this.heightFactor);
|
|
|
|
@override
|
|
void paint(Canvas canvas, Size size) {
|
|
final paint1 = Paint()
|
|
..shader = LinearGradient(
|
|
colors: [brandRed, const Color.fromARGB(255, 97, 22, 22)],
|
|
begin: Alignment.topLeft,
|
|
end: Alignment.bottomRight,
|
|
).createShader(Rect.fromLTWH(0, 0, size.width, size.height));
|
|
|
|
final path1 = Path()
|
|
..moveTo(0, size.height * heightFactor)
|
|
..quadraticBezierTo(
|
|
size.width * 0.25, size.height * 0.05,
|
|
size.width * 0.5, size.height * 0.15,
|
|
)
|
|
..quadraticBezierTo(
|
|
size.width * 0.75, size.height * 0.25,
|
|
size.width, size.height * 0.1,
|
|
)
|
|
..lineTo(size.width, 0)
|
|
..lineTo(0, 0)
|
|
..close();
|
|
|
|
canvas.drawPath(path1, paint1);
|
|
|
|
final paint2 = Paint()..color = brandRed.withOpacity(0.15);
|
|
final path2 = Path()
|
|
..moveTo(0, size.height * (heightFactor + 0.05))
|
|
..quadraticBezierTo(
|
|
size.width * 0.4, size.height * 0.1,
|
|
size.width, size.height * 0.2,
|
|
)
|
|
..lineTo(size.width, 0)
|
|
..lineTo(0, 0)
|
|
..close();
|
|
|
|
canvas.drawPath(path2, paint2);
|
|
}
|
|
|
|
@override
|
|
bool shouldRepaint(CustomPainter oldDelegate) => false;
|
|
}
|