38 lines
1.1 KiB
Dart
38 lines
1.1 KiB
Dart
import 'package:adaptix/adaptix.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:sapaly_shop/services/app_constants.dart';
|
|
import 'package:sapaly_shop/themes/app_theme.dart';
|
|
|
|
Widget customButton({
|
|
void Function()? tap,
|
|
bool? status = false,
|
|
String? text = 'Save',
|
|
String? statusText,
|
|
bool? isValid = false,
|
|
BuildContext? context,
|
|
}) {
|
|
return Container(
|
|
height: 48.adaptedPx(),
|
|
width: AppConstants.deviceWidth(context!),
|
|
margin: EdgeInsets.symmetric(
|
|
vertical: 15.adaptedPx(), horizontal: 10.adaptedPx()),
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(8.adaptedPx()),
|
|
color: status == false
|
|
? AppTheme.lightPrimaryColor
|
|
: AppTheme.blackColor.withOpacity(0.3),
|
|
),
|
|
child: TextButton(
|
|
onPressed: status == true ? null : tap,
|
|
child: Text(
|
|
status == false ? text! : statusText!,
|
|
style: Theme.of(context).primaryTextTheme.bodyMedium?.copyWith(
|
|
fontSize: 18.adaptedPx(),
|
|
color: AppTheme.whiteColor,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|