a37e73f066
Reviewed-on: #16
22 lines
701 B
Dart
22 lines
701 B
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:prasule/pw/platformwidget.dart';
|
|
|
|
class PlatformButton extends PlatformWidget<TextButton, CupertinoButton> {
|
|
final String text;
|
|
final void Function()? onPressed;
|
|
final ButtonStyle? style;
|
|
const PlatformButton(
|
|
{super.key, required this.text, required this.onPressed, this.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));
|
|
}
|