- 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.
144 lines
3.9 KiB
Dart
144 lines
3.9 KiB
Dart
import 'package:marco/helpers/theme/app_theme.dart';
|
|
import 'package:marco/helpers/utils/my_shadow.dart';
|
|
import 'package:marco/helpers/widgets/my_constant.dart';
|
|
import 'package:marco/helpers/widgets/my_spacing.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class MyCard extends StatelessWidget {
|
|
final Widget child;
|
|
final BorderRadius? borderRadius;
|
|
final double? borderRadiusAll, paddingAll, marginAll;
|
|
final EdgeInsetsGeometry? padding, margin;
|
|
final Color? color;
|
|
final GestureTapCallback? onTap;
|
|
final bool bordered;
|
|
final Border? border;
|
|
final Clip? clipBehavior;
|
|
final BoxShape? boxShape;
|
|
final MyShadow? shadow;
|
|
final double? width, height;
|
|
final Color? splashColor;
|
|
|
|
const MyCard(
|
|
{super.key,
|
|
required this.child,
|
|
this.borderRadius,
|
|
this.padding,
|
|
this.borderRadiusAll,
|
|
this.color,
|
|
this.paddingAll,
|
|
this.onTap,
|
|
this.border,
|
|
this.bordered = false,
|
|
this.clipBehavior,
|
|
this.boxShape,
|
|
this.shadow,
|
|
this.marginAll,
|
|
this.margin,
|
|
this.splashColor,
|
|
this.width,
|
|
this.height});
|
|
|
|
const MyCard.bordered(
|
|
{super.key,
|
|
required this.child,
|
|
this.borderRadius,
|
|
this.padding,
|
|
this.borderRadiusAll,
|
|
this.color,
|
|
this.paddingAll,
|
|
this.onTap,
|
|
this.border,
|
|
this.bordered = true,
|
|
this.clipBehavior,
|
|
this.boxShape,
|
|
this.shadow,
|
|
this.marginAll,
|
|
this.margin,
|
|
this.splashColor,
|
|
this.width,
|
|
this.height});
|
|
|
|
const MyCard.circular(
|
|
{super.key,
|
|
required this.child,
|
|
this.borderRadius,
|
|
this.padding,
|
|
this.borderRadiusAll,
|
|
this.color,
|
|
this.paddingAll,
|
|
this.onTap,
|
|
this.border,
|
|
this.bordered = false,
|
|
this.clipBehavior = Clip.antiAliasWithSaveLayer,
|
|
this.boxShape,
|
|
this.shadow,
|
|
this.marginAll,
|
|
this.margin,
|
|
this.splashColor,
|
|
this.width,
|
|
this.height});
|
|
|
|
const MyCard.none(
|
|
{super.key,
|
|
required this.child,
|
|
this.borderRadius,
|
|
this.padding,
|
|
this.borderRadiusAll = 0,
|
|
this.color,
|
|
this.paddingAll = 0,
|
|
this.onTap,
|
|
this.border,
|
|
this.bordered = false,
|
|
this.clipBehavior = Clip.antiAliasWithSaveLayer,
|
|
this.boxShape = BoxShape.rectangle,
|
|
this.shadow,
|
|
this.marginAll,
|
|
this.margin,
|
|
this.splashColor,
|
|
this.width,
|
|
this.height});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
MyShadow myShadow = shadow ?? MyShadow();
|
|
return InkWell(
|
|
borderRadius: boxShape != BoxShape.circle
|
|
? borderRadius ??
|
|
BorderRadius.all(Radius.circular(
|
|
borderRadiusAll ?? MyConstant.constant.cardRadius))
|
|
: null,
|
|
splashColor: splashColor ?? Colors.transparent,
|
|
highlightColor: splashColor ?? Colors.transparent,
|
|
onTap: onTap,
|
|
child: Container(
|
|
width: width,
|
|
height: height,
|
|
margin: margin ?? MySpacing.all(marginAll ?? 0),
|
|
decoration: BoxDecoration(
|
|
color: color ?? theme.cardTheme.color,
|
|
borderRadius: boxShape != BoxShape.circle
|
|
? borderRadius ??
|
|
BorderRadius.all(Radius.circular(
|
|
borderRadiusAll ?? MyConstant.constant.cardRadius))
|
|
: null,
|
|
border: bordered
|
|
? border ?? Border.all(color: theme.dividerColor, width: 1)
|
|
: null,
|
|
shape: boxShape ?? BoxShape.rectangle,
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: myShadow.color ??
|
|
theme.shadowColor.withAlpha(myShadow.alpha),
|
|
spreadRadius: myShadow.spreadRadius,
|
|
blurRadius: myShadow.blurRadius,
|
|
offset: myShadow.offset!)
|
|
]),
|
|
padding: padding ?? MySpacing.all(paddingAll ?? 16),
|
|
clipBehavior: clipBehavior ?? Clip.none,
|
|
child: child,
|
|
),
|
|
);
|
|
}
|
|
}
|