fix(ui): ensure all button loading indicators render as perfect circles with SizedBox.square and Center
This commit is contained in:
1 parent
d863b18f3f
commit
8eadef3f92
9 files changed
+47
-44
No files matched your search
@@ -971,7 +971,10 @@ class _NetworkScanDialogState extends State<_NetworkScanDialog> {
|
||||
title: const Text('Local Network Scan'),
|
||||
content: Row(
|
||||
children: [
|
||||
const CircularProgressIndicator(),
|
||||
const SizedBox.square(
|
||||
dimension: 24,
|
||||
child: CircularProgressIndicator(strokeWidth: 2.5),
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
Expanded(child: Text(_status)),
|
||||
],
|
||||
|
||||
@@ -1640,12 +1640,13 @@ class _BulkEditModalState extends ConsumerState<_BulkEditModal> {
|
||||
? null
|
||||
: _handleBulkSave,
|
||||
child: _isLoading
|
||||
? const SizedBox(
|
||||
width: 16,
|
||||
height: 16,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: Colors.white,
|
||||
? const Center(
|
||||
child: SizedBox.square(
|
||||
dimension: 16,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
)
|
||||
: const Text('APPLY'),
|
||||
|
||||
@@ -643,10 +643,11 @@ class _StudentsScreenState extends ConsumerState<StudentsScreen> {
|
||||
},
|
||||
style: TextButton.styleFrom(foregroundColor: AppColors.error),
|
||||
child: isLoading
|
||||
? const SizedBox(
|
||||
width: 16,
|
||||
height: 16,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
? const Center(
|
||||
child: SizedBox.square(
|
||||
dimension: 16,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
),
|
||||
)
|
||||
: const Text('DELETE'),
|
||||
),
|
||||
|
||||
@@ -1245,12 +1245,13 @@ class _AddStudentModalState extends ConsumerState<AddStudentModal> {
|
||||
elevation: 0,
|
||||
),
|
||||
child: _isLoading && isLastStep
|
||||
? const SizedBox(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.white,
|
||||
strokeWidth: 2,
|
||||
? const Center(
|
||||
child: SizedBox.square(
|
||||
dimension: 20,
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.white,
|
||||
strokeWidth: 2,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
@@ -1428,12 +1429,13 @@ class _AddStudentModalState extends ConsumerState<AddStudentModal> {
|
||||
elevation: 0,
|
||||
),
|
||||
child: _isLoading && isLastStep
|
||||
? const SizedBox(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.white,
|
||||
strokeWidth: 2,
|
||||
? const Center(
|
||||
child: SizedBox.square(
|
||||
dimension: 20,
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.white,
|
||||
strokeWidth: 2,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
|
||||
@@ -1177,9 +1177,8 @@ class _BulkOcrImportDialogState extends ConsumerState<BulkOcrImportDialog> {
|
||||
ElevatedButton.icon(
|
||||
onPressed: _isProcessing ? null : _processAll,
|
||||
icon: _isProcessing
|
||||
? SizedBox(
|
||||
width: 16,
|
||||
height: 16,
|
||||
? SizedBox.square(
|
||||
dimension: 16,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: isDark ? Colors.white : Colors.black))
|
||||
@@ -1217,9 +1216,8 @@ class _BulkOcrImportDialogState extends ConsumerState<BulkOcrImportDialog> {
|
||||
ElevatedButton.icon(
|
||||
onPressed: _isImporting ? null : _importAll,
|
||||
icon: _isImporting
|
||||
? SizedBox(
|
||||
width: 16,
|
||||
height: 16,
|
||||
? SizedBox.square(
|
||||
dimension: 16,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: isDark ? Colors.white : Colors.black))
|
||||
|
||||
@@ -708,9 +708,8 @@ class _EditStudentModalState extends ConsumerState<EditStudentModal> {
|
||||
final ocrButton = OutlinedButton.icon(
|
||||
onPressed: _isOcrScanning ? null : _handleScanEnrollmentFromSF,
|
||||
icon: _isOcrScanning
|
||||
? const SizedBox(
|
||||
width: 16,
|
||||
height: 16,
|
||||
? const SizedBox.square(
|
||||
dimension: 16,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(Icons.document_scanner, size: 18),
|
||||
|
||||
@@ -406,9 +406,8 @@ class _OcrEnrollmentValidationModalState
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: const BoxConstraints(),
|
||||
icon: _acceptingIndex == index
|
||||
? const SizedBox(
|
||||
width: 18,
|
||||
height: 18,
|
||||
? const SizedBox.square(
|
||||
dimension: 18,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(
|
||||
|
||||
@@ -29,12 +29,13 @@ class PrimaryButton extends StatelessWidget {
|
||||
elevation: 0,
|
||||
),
|
||||
child: isLoading
|
||||
? const SizedBox(
|
||||
height: 24,
|
||||
width: 24,
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.white,
|
||||
strokeWidth: 2.5,
|
||||
? const Center(
|
||||
child: SizedBox.square(
|
||||
dimension: 22,
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.white,
|
||||
strokeWidth: 2.5,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
|
||||
@@ -666,9 +666,8 @@ class _FileSavePreviewDialogState extends State<_FileSavePreviewDialog> {
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: _isSaving ? null : _save,
|
||||
icon: _isSaving
|
||||
? const SizedBox(
|
||||
width: 16,
|
||||
height: 16,
|
||||
? const SizedBox.square(
|
||||
dimension: 16,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: Colors.white,
|
||||
|
||||
Reference in new issue
Block a user