mirror of
https://github.com/go-vikunja/app
synced 2024-06-03 19:19:46 +00:00
056b2d72c9
This PR formats all code with dart format and adds a step to the CI so that it will be checked on every push and PR.
53 lines
1.3 KiB
Dart
53 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:vikunja_app/theme/constants.dart';
|
|
|
|
class FancyButton extends StatelessWidget {
|
|
final double width;
|
|
final double height;
|
|
final VoidCallback? onPressed;
|
|
final Widget child;
|
|
|
|
const FancyButton({
|
|
Key? key,
|
|
required this.child,
|
|
this.width = double.infinity,
|
|
this.height = 35,
|
|
this.onPressed,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ElevatedButton(
|
|
onPressed: onPressed,
|
|
child: SizedBox(
|
|
width: width,
|
|
child: Center(child: child),
|
|
),
|
|
);
|
|
return Padding(
|
|
padding: vStandardVerticalPadding,
|
|
child: Container(
|
|
width: width,
|
|
height: height,
|
|
decoration: BoxDecoration(boxShadow: [
|
|
BoxShadow(
|
|
color: Theme.of(context).brightness == Brightness.dark
|
|
? vButtonShadowDark
|
|
: vButtonShadow,
|
|
offset: Offset(-5, 5),
|
|
blurRadius: 10,
|
|
),
|
|
]),
|
|
child: Material(
|
|
borderRadius: BorderRadius.circular(3),
|
|
color: Theme.of(context).colorScheme.primary,
|
|
child: InkWell(
|
|
onTap: onPressed,
|
|
child: Center(
|
|
child: child,
|
|
)),
|
|
),
|
|
));
|
|
}
|
|
}
|