Commit cff52a0f3c3b4f7e36441d30b9dcc1618cb78a48

Authored by xiaoyu
2 parents 68a4c50a e62c1a97

Merge remote-tracking branch 'origin/feat-wqf-payment' into xiaoyu_cocossteve

# Conflicts:
#	pubspec.yaml
android/app/build.gradle
... ... @@ -56,6 +56,12 @@ android {
56 56 }
57 57  
58 58 signingConfigs {
  59 + debug {
  60 + storeFile file("../certificate/wow_english")
  61 + storePassword "wow_english"
  62 + keyAlias "wow_english"
  63 + keyPassword "wow_english"
  64 + }
59 65 release {
60 66 storeFile file("../certificate/wow_english")
61 67 storePassword "wow_english"
... ...
assets/images/game_animal_4.png 0 → 100644

86 KB

assets/images/game_food_1.png 0 → 100644

88.8 KB

assets/images/game_halloween_2.png 0 → 100644

81.8 KB

assets/images/game_toy_3.png 0 → 100644

86.5 KB

lib/pages/games/bloc.dart
... ... @@ -15,20 +15,20 @@ class GamesBloc extends Bloc<GamesEvent, GamesState> {
15 15 final List<GameEntity> _games = [
16 16 GameEntity()
17 17 ..id = 1
18   - ..imageName = 'pic_module_game'.assetPng
19   - ..name = '游戏1',
  18 + ..imageName = 'game_food_1'.assetPng
  19 + ..name = 'Food',
20 20 GameEntity()
21 21 ..id = 2
22   - ..imageName = 'pic_module_game'.assetPng
23   - ..name = '游戏2',
  22 + ..imageName = 'game_halloween_2'.assetPng
  23 + ..name = 'Halloween',
24 24 GameEntity()
25 25 ..id = 3
26   - ..imageName = 'pic_module_game'.assetPng
27   - ..name = '游戏3',
  26 + ..imageName = 'game_toy_3'.assetPng
  27 + ..name = 'Toy',
28 28 GameEntity()
29 29 ..id = 4
30   - ..imageName = 'pic_module_game'.assetPng
31   - ..name = '游戏4'
  30 + ..imageName = 'game_animal_4'.assetPng
  31 + ..name = 'Animal'
32 32 ];
33 33  
34 34 List<GameEntity> get listData => _games;
... ...
lib/pages/games/game_entity.dart
1 1  
2 2  
3   -
  3 +/// 本地游戏实体
4 4 class GameEntity {
5 5  
6 6 late int id;
... ...
lib/pages/games/view.dart
... ... @@ -8,7 +8,6 @@ import &#39;package:wow_english/pages/games/state.dart&#39;;
8 8 import '../games/event.dart';
9 9 import 'bloc.dart';
10 10  
11   -
12 11 class GamesPage extends StatelessWidget {
13 12 const GamesPage({super.key});
14 13  
... ... @@ -39,17 +38,19 @@ class _GamesPageView extends StatelessWidget {
39 38 Widget _gamesView() =>
40 39 BlocBuilder<GamesBloc, GamesState>(builder: (context, state) {
41 40 final bloc = BlocProvider.of<GamesBloc>(context);
42   - //屏幕中间横着放四张图片一行展示(尺寸120*200),每张图片下方有行文字
43 41 return Container(
44   - margin: EdgeInsets.symmetric(horizontal: 50.0.w),
  42 + alignment: Alignment.center,
  43 + margin: EdgeInsets.symmetric(horizontal: 40.0.w),
45 44 child: GridView.builder(
46 45 padding: EdgeInsets.zero,
  46 + // 让 GridView 只占用所需的空间
  47 + shrinkWrap: true,
47 48 // physics: const NeverScrollableScrollPhysics(),
48 49 gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
49   - crossAxisCount: 3,
  50 + crossAxisCount: 4,
50 51 crossAxisSpacing: 10,
51 52 mainAxisSpacing: 10,
52   - childAspectRatio: 0.6,
  53 + childAspectRatio: 0.75,
53 54 ),
54 55 itemCount: bloc.listData.length,
55 56 itemBuilder: (BuildContext context, int index) {
... ... @@ -59,12 +60,17 @@ class _GamesPageView extends StatelessWidget {
59 60 bloc.add(GotoGamePageEvent(gameEntity.id));
60 61 },
61 62 child: Column(
  63 + mainAxisAlignment: MainAxisAlignment.center,
62 64 children: [
63   - Image.asset(gameEntity.imageName,
64   - width: 120, height: 200),
  65 + //图片增加圆角
  66 + ClipRRect(
  67 + borderRadius: BorderRadius.circular(10),
  68 + child: Image.asset(gameEntity.imageName,
  69 + width: 150, height: 150)),
  70 + 10.verticalSpace,
65 71 Text(gameEntity.name,
66 72 style: TextStyle(
67   - fontSize: 14.sp,
  73 + fontSize: 16.sp,
68 74 color: const Color(0xFF140C10)))
69 75 ],
70 76 ),
... ...
pubspec.yaml
... ... @@ -137,7 +137,7 @@ flutter:
137 137 - family: HannotateSC
138 138 fonts:
139 139 - asset: assets/fonts/HannotateSC-W5.ttf
140   -
  140 +
141 141 tobias:
142 142 url_scheme: ishowwoweng
143 143 ios:
... ...