barcode_scanner/lib/components/primary_button_component.dart
mandreshope 6f2f94b2da chore: Update app icons and button text
Updates the app icons for both Android and iOS across various sizes and densities.

Changes the text color of the primary button component to white for improved visibility.
2025-07-03 10:46:47 +03:00

45 lines
1.3 KiB
Dart

import 'package:barcode_scanner/components/loading_progress_component.dart';
import 'package:barcode_scanner/themes/app_theme.dart';
import 'package:flutter/material.dart';
class PrimaryButtonComponent extends StatelessWidget {
const PrimaryButtonComponent({
super.key,
required this.text,
required this.onPressed,
this.loading = false,
});
final void Function()? onPressed;
final String text;
final bool loading;
@override
Widget build(BuildContext context) {
return ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: AppTheme.of(context).primary,
padding: const EdgeInsets.symmetric(vertical: 16),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
),
onPressed: loading ? null : onPressed,
child: loading
? SizedBox(
height: 20,
width: 20,
child: Center(
child: LoadingProgressComponent(
color: AppTheme.of(context).primary,
),
),
)
: Text(
text,
style: TextStyle(
fontWeight: FontWeight.bold,
color: AppTheme.of(context).white,
),
),
);
}
}