prasule/lib/pw/platformbutton.dart
2023-12-29 21:39:54 +01:00

29 lines
813 B
Dart

// ignore_for_file: public_member_api_docs
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:prasule/pw/platformwidget.dart';
/// A [PlatformWidget] implementation of a text field
class PlatformButton extends PlatformWidget<TextButton, CupertinoButton> {
const PlatformButton({
required this.text,
required this.onPressed,
super.key,
this.style,
});
final String text;
final void Function()? onPressed;
final ButtonStyle? style;
@override
TextButton createAndroidWidget(BuildContext context) => TextButton(
onPressed: onPressed,
style: style,
child: Text(text),
);
@override
CupertinoButton createIosWidget(BuildContext context) =>
CupertinoButton(onPressed: onPressed, child: Text(text));
}