Fix widget build conflict
This commit is contained in:
@@ -18,7 +18,6 @@ class ActiveProxyFooter extends HookConsumerWidget {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final t = ref.watch(translationsProvider);
|
||||
final asyncState = ref.watch(activeProxyNotifierProvider);
|
||||
final stats = ref.watch(statsNotifierProvider).value;
|
||||
|
||||
return AnimatedVisibility(
|
||||
axis: Axis.vertical,
|
||||
@@ -77,27 +76,7 @@ class ActiveProxyFooter extends HookConsumerWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
Directionality(
|
||||
textDirection: TextDirection.values[
|
||||
(Directionality.of(context).index + 1) %
|
||||
TextDirection.values.length],
|
||||
child: Flexible(
|
||||
child: Column(
|
||||
children: [
|
||||
_InfoProp(
|
||||
icon: FluentIcons
|
||||
.arrow_bidirectional_up_down_20_regular,
|
||||
text: (stats?.downlinkTotal ?? 0).size(),
|
||||
),
|
||||
const Gap(8),
|
||||
_InfoProp(
|
||||
icon: FluentIcons.arrow_download_20_regular,
|
||||
text: (stats?.downlink ?? 0).speed(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const _StatsColumn(),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -107,6 +86,35 @@ class ActiveProxyFooter extends HookConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _StatsColumn extends HookConsumerWidget {
|
||||
const _StatsColumn();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final stats = ref.watch(statsNotifierProvider).value;
|
||||
|
||||
return Directionality(
|
||||
textDirection: TextDirection.values[
|
||||
(Directionality.of(context).index + 1) % TextDirection.values.length],
|
||||
child: Flexible(
|
||||
child: Column(
|
||||
children: [
|
||||
_InfoProp(
|
||||
icon: FluentIcons.arrow_bidirectional_up_down_20_regular,
|
||||
text: (stats?.downlinkTotal ?? 0).size(),
|
||||
),
|
||||
const Gap(8),
|
||||
_InfoProp(
|
||||
icon: FluentIcons.arrow_download_20_regular,
|
||||
text: (stats?.downlink ?? 0).speed(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _InfoProp extends StatelessWidget {
|
||||
const _InfoProp({
|
||||
required this.icon,
|
||||
|
||||
Reference in New Issue
Block a user