
Performs a comprehensive project rename from 'barcode_scanner' to 'e_scan' (or 'eScan' for user-facing labels). This update spans all relevant files, including: - Application IDs and bundle identifiers for Android, iOS, macOS, and Linux. - VS Code launch configurations. - Dart package import paths. - Project names and titles in `pubspec.yaml`, `README.md`, and platform-specific configurations (e.g., CMakeLists, Info.plist, AndroidManifest).
56 lines
1.5 KiB
Dart
56 lines
1.5 KiB
Dart
import 'package:e_scan/components/loading_progress_component.dart';
|
|
import 'package:e_scan/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,
|
|
this.leading,
|
|
this.centered = false,
|
|
});
|
|
final void Function()? onPressed;
|
|
final String text;
|
|
final bool loading;
|
|
final Widget? leading;
|
|
final bool centered;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final textWidget = Text(
|
|
text,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.bold,
|
|
color: AppTheme.of(context).white,
|
|
),
|
|
);
|
|
return ElevatedButton(
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: AppTheme.of(context).primary,
|
|
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 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,
|
|
),
|
|
),
|
|
)
|
|
: leading == null
|
|
? textWidget
|
|
: Row(
|
|
mainAxisSize: centered ? MainAxisSize.min : MainAxisSize.max,
|
|
spacing: 10,
|
|
children: [?leading, textWidget],
|
|
),
|
|
);
|
|
}
|
|
}
|