屏幕适配
This commit is contained in:
@@ -1,22 +1,24 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
class AppLoadingView extends StatelessWidget {
|
||||
const AppLoadingView({super.key, this.message = '加载中', this.size = 24});
|
||||
const AppLoadingView({super.key, this.message = '加载中', this.size});
|
||||
|
||||
final String message;
|
||||
final double size;
|
||||
final double? size;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final effectiveSize = size ?? 24.r;
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SizedBox.square(
|
||||
dimension: size,
|
||||
child: const CircularProgressIndicator(strokeWidth: 2.4),
|
||||
dimension: effectiveSize,
|
||||
child: CircularProgressIndicator(strokeWidth: 2.4.r),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
SizedBox(height: 12.h),
|
||||
Text(
|
||||
message,
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
|
||||
Reference in New Issue
Block a user