feat: Add chat permissions settings
This commit is contained in:
parent
068cb85f90
commit
4c8744f027
7 changed files with 466 additions and 81 deletions
32
lib/components/dialogs/adaptive_flat_button.dart
Normal file
32
lib/components/dialogs/adaptive_flat_button.dart
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AdaptiveFlatButton extends StatelessWidget {
|
||||
final Widget child;
|
||||
final Color textColor;
|
||||
final Function onPressed;
|
||||
|
||||
const AdaptiveFlatButton({
|
||||
Key key,
|
||||
this.child,
|
||||
this.textColor,
|
||||
this.onPressed,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (PlatformInfos.isCupertinoStyle) {
|
||||
return CupertinoDialogAction(
|
||||
child: child,
|
||||
onPressed: onPressed,
|
||||
textStyle: textColor != null ? TextStyle(color: textColor) : null,
|
||||
);
|
||||
}
|
||||
return FlatButton(
|
||||
child: child,
|
||||
textColor: textColor,
|
||||
onPressed: onPressed,
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue