Wrap EnteLoadingWidget with RepaintBoundary to avoid unnecessary repaints
This commit is contained in:
@@ -22,10 +22,12 @@ class EnteLoadingWidget extends StatelessWidget {
|
||||
padding: EdgeInsets.all(padding),
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.square(size),
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: color ?? getEnteColorScheme(context).strokeBase,
|
||||
strokeCap: StrokeCap.round,
|
||||
child: RepaintBoundary(
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: color ?? getEnteColorScheme(context).strokeBase,
|
||||
strokeCap: StrokeCap.round,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -192,13 +192,11 @@ class _AddLocationSheetState extends State<AddLocationSheet> {
|
||||
builder: (context, int? value, _) {
|
||||
Widget widget;
|
||||
if (value == null) {
|
||||
widget = RepaintBoundary(
|
||||
child: EnteLoadingWidget(
|
||||
size: 14,
|
||||
color: colorScheme.strokeMuted,
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: 3,
|
||||
),
|
||||
widget = EnteLoadingWidget(
|
||||
size: 14,
|
||||
color: colorScheme.strokeMuted,
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: 3,
|
||||
);
|
||||
} else {
|
||||
widget = Column(
|
||||
|
||||
@@ -184,13 +184,11 @@ class _EditLocationSheetState extends State<EditLocationSheet> {
|
||||
builder: (context, int? value, _) {
|
||||
Widget widget;
|
||||
if (value == null) {
|
||||
widget = RepaintBoundary(
|
||||
child: EnteLoadingWidget(
|
||||
size: 14,
|
||||
color: colorScheme.strokeMuted,
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: 3,
|
||||
),
|
||||
widget = EnteLoadingWidget(
|
||||
size: 14,
|
||||
color: colorScheme.strokeMuted,
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: 3,
|
||||
);
|
||||
} else {
|
||||
widget = Column(
|
||||
|
||||
@@ -911,13 +911,9 @@ class _EmailSectionState extends State<_EmailSection> {
|
||||
"Error getting isMeAssigned",
|
||||
snapshot.error,
|
||||
);
|
||||
return const RepaintBoundary(
|
||||
child: EnteLoadingWidget(),
|
||||
);
|
||||
return const EnteLoadingWidget();
|
||||
} else {
|
||||
return const RepaintBoundary(
|
||||
child: EnteLoadingWidget(),
|
||||
);
|
||||
return const EnteLoadingWidget();
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user