refactor: Move widgets to lib

This commit is contained in:
Christian Pauly 2021-05-22 08:53:52 +02:00
commit c8827ae1b2
86 changed files with 136 additions and 136 deletions

View file

@ -0,0 +1,34 @@
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class AdaptiveFlatButton extends StatelessWidget {
final String label;
final Color textColor;
final Function onPressed;
const AdaptiveFlatButton({
Key key,
@required this.label,
this.textColor,
this.onPressed,
}) : super(key: key);
@override
Widget build(BuildContext context) {
if (PlatformInfos.isCupertinoStyle) {
return CupertinoDialogAction(
onPressed: onPressed,
textStyle: textColor != null ? TextStyle(color: textColor) : null,
child: Text(label),
);
}
return TextButton(
onPressed: onPressed,
child: Text(
label,
style: TextStyle(color: textColor),
),
);
}
}