|
|
@ -38,62 +38,65 @@ class GoodsvipView extends GetView<GoodsvipController> { |
|
|
), |
|
|
), |
|
|
centerTitle: true, |
|
|
centerTitle: true, |
|
|
), |
|
|
), |
|
|
body: Obx(() { |
|
|
body: SafeArea( |
|
|
final userTick = User.refreshTick.value; |
|
|
top: false, |
|
|
Widget content; |
|
|
child: Obx(() { |
|
|
if (controller.loading.value) { |
|
|
final userTick = User.refreshTick.value; |
|
|
content = const Center(child: CircularProgressIndicator()); |
|
|
Widget content; |
|
|
} else if (controller.error.isNotEmpty) { |
|
|
if (controller.loading.value) { |
|
|
content = Center(child: Text(controller.error.value)); |
|
|
content = const Center(child: CircularProgressIndicator()); |
|
|
} else { |
|
|
} else if (controller.error.isNotEmpty) { |
|
|
final Map<UsageType, List<DBGoods>> grouped = {}; |
|
|
content = Center(child: Text(controller.error.value)); |
|
|
for (final g in controller.items) { |
|
|
} else { |
|
|
grouped.putIfAbsent(g.usagetype, () => []).add(g); |
|
|
final Map<UsageType, List<DBGoods>> grouped = {}; |
|
|
} |
|
|
for (final g in controller.items) { |
|
|
final order = [UsageType.Vip]; |
|
|
grouped.putIfAbsent(g.usagetype, () => []).add(g); |
|
|
final children = <Widget>[]; |
|
|
} |
|
|
children.add(_buildFeaturesSection(isDarkMode)); |
|
|
final order = [UsageType.Vip]; |
|
|
children.add(SizedBox(height: 16.h)); |
|
|
final children = <Widget>[]; |
|
|
// children.add(_buildScenesSection(isDarkMode)); |
|
|
children.add(_buildFeaturesSection(isDarkMode)); |
|
|
// children.add(SizedBox(height: 16.h)); |
|
|
children.add(SizedBox(height: 16.h)); |
|
|
for (int i = 0; i < order.length; i++) { |
|
|
// children.add(_buildScenesSection(isDarkMode)); |
|
|
final t = order[i]; |
|
|
// children.add(SizedBox(height: 16.h)); |
|
|
final list = grouped[t]; |
|
|
for (int i = 0; i < order.length; i++) { |
|
|
if (list == null || list.isEmpty) continue; |
|
|
final t = order[i]; |
|
|
children.add(_buildTypeSection(t, list, isDarkMode)); |
|
|
final list = grouped[t]; |
|
|
if (i != order.length - 1) { |
|
|
if (list == null || list.isEmpty) continue; |
|
|
children.add(SizedBox(height: 16.h)); |
|
|
children.add(_buildTypeSection(t, list, isDarkMode)); |
|
|
children.add( |
|
|
if (i != order.length - 1) { |
|
|
Divider(color: isDarkMode ? Colors.white24 : Colors.black12)); |
|
|
children.add(SizedBox(height: 16.h)); |
|
|
children.add(SizedBox(height: 16.h)); |
|
|
children.add(Divider( |
|
|
|
|
|
color: isDarkMode ? Colors.white24 : Colors.black12)); |
|
|
|
|
|
children.add(SizedBox(height: 16.h)); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
children.add(GoodsFooterSection(isDarkMode: isDarkMode)); |
|
|
children.add(GoodsFooterSection(isDarkMode: isDarkMode)); |
|
|
content = ListView( |
|
|
content = ListView( |
|
|
key: ValueKey(userTick), |
|
|
key: ValueKey(userTick), |
|
|
padding: EdgeInsets.all(16.w), |
|
|
padding: EdgeInsets.all(16.w), |
|
|
children: children, |
|
|
children: children, |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
return Stack( |
|
|
return Stack( |
|
|
children: [ |
|
|
children: [ |
|
|
content, |
|
|
content, |
|
|
if (controller.isPaying.value) |
|
|
if (controller.isPaying.value) |
|
|
Positioned.fill( |
|
|
Positioned.fill( |
|
|
child: AbsorbPointer( |
|
|
child: AbsorbPointer( |
|
|
absorbing: true, |
|
|
absorbing: true, |
|
|
child: Container( |
|
|
child: Container( |
|
|
color: Colors.black.withOpacity(0.35), |
|
|
color: Colors.black.withOpacity(0.35), |
|
|
child: const Center( |
|
|
child: const Center( |
|
|
child: CircularProgressIndicator(), |
|
|
child: CircularProgressIndicator(), |
|
|
|
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
], |
|
|
], |
|
|
); |
|
|
); |
|
|
}), |
|
|
}), |
|
|
), |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|