Skip to content

Commit 50d7e5d

Browse files
authored
Merge pull request #23 from VB10/feature/game_dashboard
feature/game dashboard
2 parents ca8f922 + de5895f commit 50d7e5d

25 files changed

+740
-11
lines changed

asset/lang/en-US.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@
3535
"findFriends":"Find Friends",
3636
"follow":"Follow",
3737
"following":"Following"
38+
},
39+
"game":{
40+
"title":"Unity Game",
41+
"newUpdate":"New Updated Games",
42+
"viewAll":"View All",
43+
"topDownload":"Top Downloads",
44+
"tabbar":{
45+
"tab1":"RACING",
46+
"tab2":"SIMULATION",
47+
"tab3":"CASUAL",
48+
"tab4":"CARTOONY",
49+
"tab5":"TOYS"
50+
}
3851
}
3952
}
4053
}

ios/Podfile.lock

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PODS:
22
- device_info (0.0.1):
33
- Flutter
44
- Flutter (1.0.0)
5+
- FMDB (2.7.5):
6+
- FMDB/standard (= 2.7.5)
7+
- FMDB/standard (2.7.5)
58
- path_provider (0.0.1):
69
- Flutter
710
- path_provider_linux (0.0.1):
@@ -22,6 +25,9 @@ PODS:
2225
- Flutter
2326
- shared_preferences_windows (0.0.1):
2427
- Flutter
28+
- sqflite (0.0.2):
29+
- Flutter
30+
- FMDB (>= 2.7.5)
2531
- url_launcher (0.0.1):
2632
- Flutter
2733
- url_launcher_linux (0.0.1):
@@ -46,12 +52,17 @@ DEPENDENCIES:
4652
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
4753
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
4854
- shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`)
55+
- sqflite (from `.symlinks/plugins/sqflite/ios`)
4956
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
5057
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
5158
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
5259
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
5360
- url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)
5461

62+
SPEC REPOS:
63+
trunk:
64+
- FMDB
65+
5566
EXTERNAL SOURCES:
5667
device_info:
5768
:path: ".symlinks/plugins/device_info/ios"
@@ -77,6 +88,8 @@ EXTERNAL SOURCES:
7788
:path: ".symlinks/plugins/shared_preferences_web/ios"
7889
shared_preferences_windows:
7990
:path: ".symlinks/plugins/shared_preferences_windows/ios"
91+
sqflite:
92+
:path: ".symlinks/plugins/sqflite/ios"
8093
url_launcher:
8194
:path: ".symlinks/plugins/url_launcher/ios"
8295
url_launcher_linux:
@@ -91,6 +104,7 @@ EXTERNAL SOURCES:
91104
SPEC CHECKSUMS:
92105
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
93106
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
107+
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
94108
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
95109
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
96110
path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
@@ -101,6 +115,7 @@ SPEC CHECKSUMS:
101115
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
102116
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
103117
shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae
118+
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
104119
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
105120
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
106121
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 51;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -339,7 +339,7 @@
339339
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
340340
GCC_WARN_UNUSED_FUNCTION = YES;
341341
GCC_WARN_UNUSED_VARIABLE = YES;
342-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
342+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
343343
MTL_ENABLE_DEBUG_INFO = NO;
344344
SDKROOT = iphoneos;
345345
SUPPORTED_PLATFORMS = iphoneos;
@@ -429,7 +429,7 @@
429429
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
430430
GCC_WARN_UNUSED_FUNCTION = YES;
431431
GCC_WARN_UNUSED_VARIABLE = YES;
432-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
432+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
433433
MTL_ENABLE_DEBUG_INFO = YES;
434434
ONLY_ACTIVE_ARCH = YES;
435435
SDKROOT = iphoneos;
@@ -478,7 +478,7 @@
478478
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
479479
GCC_WARN_UNUSED_FUNCTION = YES;
480480
GCC_WARN_UNUSED_VARIABLE = YES;
481-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
481+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
482482
MTL_ENABLE_DEBUG_INFO = NO;
483483
SDKROOT = iphoneos;
484484
SUPPORTED_PLATFORMS = iphoneos;

lib/core/init/lang/locale_keys.g.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ abstract class LocaleKeys {
3434
static const home_social_follow = 'home.social.follow';
3535
static const home_social_following = 'home.social.following';
3636
static const home_social = 'home.social';
37+
static const home_game_title = 'home.game.title';
38+
static const home_game_newUpdate = 'home.game.newUpdate';
39+
static const home_game_viewAll = 'home.game.viewAll';
40+
static const home_game_topDownload = 'home.game.topDownload';
41+
static const home_game_tabbar_tab1 = 'home.game.tabbar.tab1';
42+
static const home_game_tabbar_tab2 = 'home.game.tabbar.tab2';
43+
static const home_game_tabbar_tab3 = 'home.game.tabbar.tab3';
44+
static const home_game_tabbar_tab4 = 'home.game.tabbar.tab4';
45+
static const home_game_tabbar_tab5 = 'home.game.tabbar.tab5';
46+
static const home_game_tabbar = 'home.game.tabbar';
47+
static const home_game = 'home.game';
3748
static const home = 'home';
3849

3950
}

lib/core/init/theme/app_theme_light.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class AppThemeLight extends AppTheme with ILightTheme {
1818
fontFamily: ApplicationConstants.FONT_FAMILY,
1919
colorScheme: _appColorScheme,
2020
textTheme: textTheme(),
21-
appBarTheme: ThemeData.light().appBarTheme.copyWith(brightness: Brightness.light, iconTheme: IconThemeData(color: Colors.black87, size: 21)),
21+
appBarTheme: ThemeData.light().appBarTheme.copyWith(
22+
brightness: Brightness.light, color: Colors.transparent, elevation: 0, iconTheme: IconThemeData(color: Colors.black87, size: 21)),
2223
inputDecorationTheme: InputDecorationTheme(
2324
focusColor: Colors.black12,
2425
labelStyle: TextStyle(),
@@ -67,7 +68,7 @@ class AppThemeLight extends AppTheme with ILightTheme {
6768
onSecondary: Colors.black, //x
6869
onSurface: Colors.white30,
6970
onBackground: Colors.black12,
70-
onError: Color(0xffffc93c), //xx
71+
onError: Color(0xFFF9B916), //xx
7172
brightness: Brightness.light);
7273
}
7374
}

lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'core/init/navigation/navigation_route.dart';
99
import 'core/init/navigation/navigation_service.dart';
1010
import 'core/init/notifier/provider_list.dart';
1111
import 'core/init/notifier/theme_notifer.dart';
12-
import 'view/home/social/view/social_view.dart';
12+
import 'view/home/game/view/game_view.dart';
1313

1414
void main() {
1515
WidgetsFlutterBinding.ensureInitialized();
@@ -26,7 +26,7 @@ class MyApp extends StatelessWidget {
2626
return MaterialApp(
2727
debugShowCheckedModeBanner: false,
2828
theme: Provider.of<ThemeNotifier>(context, listen: false).currentTheme,
29-
home: SocialView(),
29+
home: GameView(),
3030
onGenerateRoute: NavigationRoute.instance.generateRoute,
3131
navigatorKey: NavigationService.instance.navigatorKey,
3232
);
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import 'package:easy_localization/easy_localization.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:kartal/kartal.dart';
4+
5+
import '../../../core/init/lang/locale_keys.g.dart';
6+
7+
class HeaderButton extends StatelessWidget {
8+
final String titleText;
9+
final VoidCallback onPressed;
10+
11+
const HeaderButton({Key key, this.titleText, this.onPressed}) : super(key: key);
12+
@override
13+
Widget build(BuildContext context) {
14+
return Padding(
15+
padding: context.horizontalPaddingLow,
16+
child: Row(
17+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
18+
children: [buildTextTitle(context), buildFlatButtonRight(context)],
19+
),
20+
);
21+
}
22+
23+
Text buildTextTitle(BuildContext context) {
24+
return Text(
25+
titleText.tr(),
26+
style: context.textTheme.headline6.copyWith(color: context.colorScheme.onError),
27+
);
28+
}
29+
30+
FlatButton buildFlatButtonRight(BuildContext context) {
31+
return FlatButton(
32+
padding: EdgeInsets.zero,
33+
onPressed: () {
34+
onPressed();
35+
},
36+
child: Wrap(
37+
crossAxisAlignment: WrapCrossAlignment.center,
38+
children: [
39+
Text(LocaleKeys.home_game_viewAll.tr(), style: context.textTheme.subtitle2.copyWith(color: context.colorScheme.onError)),
40+
Icon(Icons.arrow_right, color: context.colorScheme.onError)
41+
],
42+
));
43+
}
44+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import 'package:flutter/material.dart';
2+
3+
import '../../../core/extension/context_extension.dart';
4+
import '../../../view/home/game/model/game_model.dart';
5+
6+
class GameCard extends StatelessWidget {
7+
final GameModel model;
8+
final VoidCallback onPressed;
9+
10+
const GameCard({Key key, this.model, this.onPressed}) : super(key: key);
11+
@override
12+
Widget build(BuildContext context) {
13+
return Card(
14+
child: Padding(
15+
padding: context.paddingLow,
16+
child: Column(
17+
crossAxisAlignment: CrossAxisAlignment.start,
18+
children: [
19+
Expanded(
20+
child: Center(child: Image.network(model.image)),
21+
),
22+
Text(model.name),
23+
Text('\$ ${model.money}')
24+
],
25+
),
26+
),
27+
);
28+
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import 'package:flutter/material.dart';
2+
3+
import '../../../view/home/game/model/game_model.dart';
4+
import '../card/game_card.dart';
5+
6+
class GameGrid extends StatelessWidget {
7+
final List<GameModel> models;
8+
final void Function(GameModel item, int indx) onPressed;
9+
10+
const GameGrid({Key key, this.models, this.onPressed}) : super(key: key);
11+
@override
12+
Widget build(BuildContext context) {
13+
return GridView.builder(
14+
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
15+
crossAxisCount: 3,
16+
childAspectRatio: 0.8,
17+
),
18+
itemCount: 3,
19+
shrinkWrap: true,
20+
physics: NeverScrollableScrollPhysics(),
21+
itemBuilder: (context, index) => GameCard(
22+
model: models[index],
23+
onPressed: () {
24+
onPressed(models[index], index);
25+
},
26+
),
27+
);
28+
}
29+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import 'package:cached_network_image/cached_network_image.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:kartal/kartal.dart';
4+
5+
import '../../../view/home/game/model/slider_model.dart';
6+
7+
class GameSlider extends StatefulWidget {
8+
final List<SliderModel> sliderModel;
9+
10+
const GameSlider({Key key, this.sliderModel}) : super(key: key);
11+
12+
@override
13+
_GameSliderState createState() => _GameSliderState();
14+
}
15+
16+
class _GameSliderState extends State<GameSlider> {
17+
int _selectedValueIndex = 0;
18+
@override
19+
Widget build(BuildContext context) {
20+
return Column(
21+
children: [Expanded(flex: 10, child: buildPageView()), Expanded(child: buildListViewCirleIndicator())],
22+
);
23+
}
24+
25+
PageView buildPageView() {
26+
return PageView.builder(
27+
controller: PageController(viewportFraction: 0.8),
28+
onPageChanged: _changeValue,
29+
itemCount: widget.sliderModel.length,
30+
itemBuilder: (context, index) => buildCardImage(index),
31+
);
32+
}
33+
34+
void _changeValue(int index) {
35+
_selectedValueIndex = index;
36+
setState(() {});
37+
}
38+
39+
Widget buildCardImage(int index) => CachedNetworkImage(imageUrl: widget.sliderModel[index].image);
40+
41+
ListView buildListViewCirleIndicator() {
42+
return ListView.builder(
43+
itemCount: widget.sliderModel.length,
44+
shrinkWrap: true,
45+
scrollDirection: Axis.horizontal,
46+
itemBuilder: (context, index) => Padding(
47+
padding: EdgeInsets.all(context.dynamicWidth(0.01)),
48+
child: CircleAvatar(
49+
backgroundColor: _selectedValueIndex == index ? context.colorScheme.onError : context.colorScheme.onError.withOpacity(0.1),
50+
radius: 10,
51+
),
52+
),
53+
);
54+
}
55+
}

0 commit comments

Comments
 (0)