- Created CMakeLists.txt for Flutter and runner components. - Implemented resource script (Runner.rc) for application metadata. - Developed main entry point (main.cpp) for the Windows application. - Added FlutterWindow class to manage the Flutter view within a Win32 window. - Implemented utility functions for console management and command line argument parsing. - Established Win32Window class for high DPI-aware window handling. - Included application icon and manifest for proper Windows integration. - Set up build configurations and dependencies for the Flutter application on Windows.
44 lines
1013 B
Dart
44 lines
1013 B
Dart
import 'dart:math';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
class MyPageReveal extends StatelessWidget {
|
|
final double? revealPercent;
|
|
final Widget? child;
|
|
|
|
MyPageReveal({super.key, this.revealPercent, this.child});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ClipOval(
|
|
clipper: CircleRevealClipper(revealPercent),
|
|
child: child,
|
|
);
|
|
}
|
|
}
|
|
|
|
class CircleRevealClipper extends CustomClipper<Rect> {
|
|
final double? revealPercent;
|
|
|
|
CircleRevealClipper(this.revealPercent);
|
|
|
|
@override
|
|
Rect getClip(Size size) {
|
|
final epicenter = Offset(size.width / 2, size.height * 0.9);
|
|
|
|
double theta = atan(epicenter.dy / epicenter.dx);
|
|
final distanceToCorner = epicenter.dy / sin(theta);
|
|
|
|
final radius = distanceToCorner * revealPercent!;
|
|
final diameter = 2 * radius;
|
|
|
|
return Rect.fromLTWH(
|
|
epicenter.dx - radius, epicenter.dy - radius, diameter, diameter);
|
|
}
|
|
|
|
@override
|
|
bool shouldReclip(CustomClipper<Rect> oldClipper) {
|
|
return true;
|
|
}
|
|
}
|