mirror of
https://github.com/openfoodfacts/smooth-app.git
synced 2025-08-26 11:16:45 +08:00
use adaptive progress Indicator (#2831)
This commit is contained in:
@ -80,6 +80,6 @@ abstract class AbstractCache extends StatelessWidget {
|
|||||||
Widget getCircularProgressIndicator() => SizedBox(
|
Widget getCircularProgressIndicator() => SizedBox(
|
||||||
width: width ?? height,
|
width: width ?? height,
|
||||||
height: height ?? width,
|
height: height ?? width,
|
||||||
child: const CircularProgressIndicator(),
|
child: const CircularProgressIndicator.adaptive(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ class SmoothProductCardLoading extends StatelessWidget {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 12.0,
|
height: 12.0,
|
||||||
),
|
),
|
||||||
const CircularProgressIndicator()
|
const CircularProgressIndicator.adaptive()
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -104,7 +104,7 @@ class LoadingDialog<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
leading: const CircularProgressIndicator(),
|
leading: const CircularProgressIndicator.adaptive(),
|
||||||
title: Text(title),
|
title: Text(title),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -51,7 +51,7 @@ class SmoothProductImage extends StatelessWidget {
|
|||||||
progress == null
|
progress == null
|
||||||
? child
|
? child
|
||||||
: Center(
|
: Center(
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator.adaptive(
|
||||||
strokeWidth: 2.5,
|
strokeWidth: 2.5,
|
||||||
valueColor: const AlwaysStoppedAnimation<Color>(
|
valueColor: const AlwaysStoppedAnimation<Color>(
|
||||||
Colors.white,
|
Colors.white,
|
||||||
|
@ -30,7 +30,7 @@ class AllUserProductList extends StatelessWidget {
|
|||||||
if (snapshot.data != null) {
|
if (snapshot.data != null) {
|
||||||
return _AllUserProductListLoaded(snapshot.data!);
|
return _AllUserProductListLoaded(snapshot.data!);
|
||||||
}
|
}
|
||||||
return const Center(child: CircularProgressIndicator());
|
return const Center(child: CircularProgressIndicator.adaptive());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ class _CountrySelectorState extends State<CountrySelector> {
|
|||||||
if (snapshot.hasError) {
|
if (snapshot.hasError) {
|
||||||
return Text('Fatal Error: ${snapshot.error}');
|
return Text('Fatal Error: ${snapshot.error}');
|
||||||
} else if (snapshot.connectionState != ConnectionState.done) {
|
} else if (snapshot.connectionState != ConnectionState.done) {
|
||||||
return const CircularProgressIndicator();
|
return const CircularProgressIndicator.adaptive();
|
||||||
}
|
}
|
||||||
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
|
@ -73,7 +73,7 @@ class _KnowledgePanelPageTemplateState
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (snapshot.connectionState != ConnectionState.done) {
|
if (snapshot.connectionState != ConnectionState.done) {
|
||||||
return const Center(child: CircularProgressIndicator());
|
return const Center(child: CircularProgressIndicator.adaptive());
|
||||||
}
|
}
|
||||||
final Widget knowledgePanelWidget = KnowledgePanelWidget(
|
final Widget knowledgePanelWidget = KnowledgePanelWidget(
|
||||||
panelElement: KnowledgePanelWidget.getPanelElement(
|
panelElement: KnowledgePanelWidget.getPanelElement(
|
||||||
|
@ -51,7 +51,7 @@ class _PreferencesPageState extends State<PreferencesPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (snapshot.connectionState != ConnectionState.done) {
|
if (snapshot.connectionState != ConnectionState.done) {
|
||||||
return const Center(child: CircularProgressIndicator());
|
return const Center(child: CircularProgressIndicator.adaptive());
|
||||||
}
|
}
|
||||||
return _Helper(_product, widget.backgroundColor);
|
return _Helper(_product, widget.backgroundColor);
|
||||||
},
|
},
|
||||||
|
@ -99,13 +99,13 @@ class _PersonalizedRankingPageState extends State<PersonalizedRankingPage>
|
|||||||
}
|
}
|
||||||
if (_model.loadingStatus == LoadingStatus.LOADING) {
|
if (_model.loadingStatus == LoadingStatus.LOADING) {
|
||||||
return Center(
|
return Center(
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator.adaptive(
|
||||||
value: _model.getLoadingProgress() ?? 1,
|
value: _model.getLoadingProgress() ?? 1,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (_model.loadingStatus != LoadingStatus.LOADED) {
|
if (_model.loadingStatus != LoadingStatus.LOADED) {
|
||||||
return const Center(child: CircularProgressIndicator());
|
return const Center(child: CircularProgressIndicator.adaptive());
|
||||||
}
|
}
|
||||||
AnalyticsHelper.trackPersonalizedRanking(widget.barcodes.length);
|
AnalyticsHelper.trackPersonalizedRanking(widget.barcodes.length);
|
||||||
MatchedProductStatusV2? status;
|
MatchedProductStatusV2? status;
|
||||||
|
@ -269,7 +269,7 @@ class UserPreferencesContribute extends AbstractUserPreferences {
|
|||||||
|
|
||||||
return const Padding(
|
return const Padding(
|
||||||
padding: EdgeInsets.all(LARGE_SPACE),
|
padding: EdgeInsets.all(LARGE_SPACE),
|
||||||
child: CircularProgressIndicator(),
|
child: CircularProgressIndicator.adaptive(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -95,7 +95,7 @@ class _ProductQueryPageState extends State<ProductQueryPage>
|
|||||||
return _getEmptyScreen(
|
return _getEmptyScreen(
|
||||||
screenSize,
|
screenSize,
|
||||||
themeData,
|
themeData,
|
||||||
const CircularProgressIndicator(),
|
const CircularProgressIndicator.adaptive(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -169,7 +169,7 @@ class _EditOcrPageState extends State<EditOcrPage> {
|
|||||||
if (_updatingImage) {
|
if (_updatingImage) {
|
||||||
children.add(
|
children.add(
|
||||||
const Center(
|
const Center(
|
||||||
child: CircularProgressIndicator(),
|
child: CircularProgressIndicator.adaptive(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -43,7 +43,7 @@ class _ScanPageState extends State<ScanPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (_model == null) {
|
if (_model == null) {
|
||||||
return const Center(child: CircularProgressIndicator());
|
return const Center(child: CircularProgressIndicator.adaptive());
|
||||||
}
|
}
|
||||||
|
|
||||||
return SmoothScaffold(
|
return SmoothScaffold(
|
||||||
|
@ -135,7 +135,7 @@ class _ForgotPasswordPageState extends State<ForgotPasswordPage>
|
|||||||
),
|
),
|
||||||
const Spacer(flex: 4),
|
const Spacer(flex: 4),
|
||||||
if (_runningQuery)
|
if (_runningQuery)
|
||||||
const CircularProgressIndicator()
|
const CircularProgressIndicator.adaptive()
|
||||||
else
|
else
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
@ -201,7 +201,7 @@ class _LoginPageState extends State<LoginPage> with TraceableClientMixin {
|
|||||||
|
|
||||||
//Sign in button
|
//Sign in button
|
||||||
if (_runningQuery)
|
if (_runningQuery)
|
||||||
const CircularProgressIndicator()
|
const CircularProgressIndicator.adaptive()
|
||||||
else
|
else
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () => _login(context),
|
onPressed: () => _login(context),
|
||||||
|
Reference in New Issue
Block a user