
Replaces hardcoded colors and standard Theme.of(context) accesses with a custom AppTheme. Introduces distinct light and dark themes and persists the selected theme mode using shared_preferences. Integrates the theme into the main app structure and applies it to various components and pages. Adds google_fonts dependency for theme typography.
32 lines
713 B
Dart
32 lines
713 B
Dart
import 'package:barcode_scanner/themes/app_theme.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class LoadingProgressComponent extends StatelessWidget {
|
|
const LoadingProgressComponent({
|
|
super.key,
|
|
this.color,
|
|
this.height,
|
|
this.width,
|
|
this.value,
|
|
});
|
|
final Color? color;
|
|
final double? height;
|
|
final double? width;
|
|
final double? value;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SizedBox(
|
|
height: height ?? 20,
|
|
width: width ?? 20,
|
|
child: CircularProgressIndicator(
|
|
value: value,
|
|
strokeWidth: 2,
|
|
valueColor: AlwaysStoppedAnimation<Color>(
|
|
color ?? AppTheme.of(context).primary,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|