Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions asset/lang/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@
"findFriends":"Find Friends",
"follow":"Follow",
"following":"Following"
},
"game":{
"title":"Unity Game",
"newUpdate":"New Updated Games",
"viewAll":"View All",
"topDownload":"Top Downloads",
"tabbar":{
"tab1":"RACING",
"tab2":"SIMULATION",
"tab3":"CASUAL",
"tab4":"CARTOONY",
"tab5":"TOYS"
}
}
}
}
15 changes: 15 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ PODS:
- device_info (0.0.1):
- Flutter
- Flutter (1.0.0)
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- path_provider (0.0.1):
- Flutter
- path_provider_linux (0.0.1):
Expand All @@ -22,6 +25,9 @@ PODS:
- Flutter
- shared_preferences_windows (0.0.1):
- Flutter
- sqflite (0.0.2):
- Flutter
- FMDB (>= 2.7.5)
- url_launcher (0.0.1):
- Flutter
- url_launcher_linux (0.0.1):
Expand All @@ -46,12 +52,17 @@ DEPENDENCIES:
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
- shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
- url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)

SPEC REPOS:
trunk:
- FMDB

EXTERNAL SOURCES:
device_info:
:path: ".symlinks/plugins/device_info/ios"
Expand All @@ -77,6 +88,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/shared_preferences_web/ios"
shared_preferences_windows:
:path: ".symlinks/plugins/shared_preferences_windows/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"
url_launcher_linux:
Expand All @@ -91,6 +104,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
Expand All @@ -101,6 +115,7 @@ SPEC CHECKSUMS:
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
Expand Down
8 changes: 4 additions & 4 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 51;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -339,7 +339,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -429,7 +429,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -478,7 +478,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
11 changes: 11 additions & 0 deletions lib/core/init/lang/locale_keys.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ abstract class LocaleKeys {
static const home_social_follow = 'home.social.follow';
static const home_social_following = 'home.social.following';
static const home_social = 'home.social';
static const home_game_title = 'home.game.title';
static const home_game_newUpdate = 'home.game.newUpdate';
static const home_game_viewAll = 'home.game.viewAll';
static const home_game_topDownload = 'home.game.topDownload';
static const home_game_tabbar_tab1 = 'home.game.tabbar.tab1';
static const home_game_tabbar_tab2 = 'home.game.tabbar.tab2';
static const home_game_tabbar_tab3 = 'home.game.tabbar.tab3';
static const home_game_tabbar_tab4 = 'home.game.tabbar.tab4';
static const home_game_tabbar_tab5 = 'home.game.tabbar.tab5';
static const home_game_tabbar = 'home.game.tabbar';
static const home_game = 'home.game';
static const home = 'home';

}
5 changes: 3 additions & 2 deletions lib/core/init/theme/app_theme_light.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class AppThemeLight extends AppTheme with ILightTheme {
fontFamily: ApplicationConstants.FONT_FAMILY,
colorScheme: _appColorScheme,
textTheme: textTheme(),
appBarTheme: ThemeData.light().appBarTheme.copyWith(brightness: Brightness.light, iconTheme: IconThemeData(color: Colors.black87, size: 21)),
appBarTheme: ThemeData.light().appBarTheme.copyWith(
brightness: Brightness.light, color: Colors.transparent, elevation: 0, iconTheme: IconThemeData(color: Colors.black87, size: 21)),
inputDecorationTheme: InputDecorationTheme(
focusColor: Colors.black12,
labelStyle: TextStyle(),
Expand Down Expand Up @@ -67,7 +68,7 @@ class AppThemeLight extends AppTheme with ILightTheme {
onSecondary: Colors.black, //x
onSurface: Colors.white30,
onBackground: Colors.black12,
onError: Color(0xffffc93c), //xx
onError: Color(0xFFF9B916), //xx
brightness: Brightness.light);
}
}
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'core/init/navigation/navigation_route.dart';
import 'core/init/navigation/navigation_service.dart';
import 'core/init/notifier/provider_list.dart';
import 'core/init/notifier/theme_notifer.dart';
import 'view/home/social/view/social_view.dart';
import 'view/home/game/view/game_view.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
Expand All @@ -26,7 +26,7 @@ class MyApp extends StatelessWidget {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: Provider.of<ThemeNotifier>(context, listen: false).currentTheme,
home: SocialView(),
home: GameView(),
onGenerateRoute: NavigationRoute.instance.generateRoute,
navigatorKey: NavigationService.instance.navigatorKey,
);
Expand Down
44 changes: 44 additions & 0 deletions lib/product/widget/button/header_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';

import '../../../core/init/lang/locale_keys.g.dart';

class HeaderButton extends StatelessWidget {
final String titleText;
final VoidCallback onPressed;

const HeaderButton({Key key, this.titleText, this.onPressed}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: context.horizontalPaddingLow,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [buildTextTitle(context), buildFlatButtonRight(context)],
),
);
}

Text buildTextTitle(BuildContext context) {
return Text(
titleText.tr(),
style: context.textTheme.headline6.copyWith(color: context.colorScheme.onError),
);
}

FlatButton buildFlatButtonRight(BuildContext context) {
return FlatButton(
padding: EdgeInsets.zero,
onPressed: () {
onPressed();
},
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
children: [
Text(LocaleKeys.home_game_viewAll.tr(), style: context.textTheme.subtitle2.copyWith(color: context.colorScheme.onError)),
Icon(Icons.arrow_right, color: context.colorScheme.onError)
],
));
}
}
29 changes: 29 additions & 0 deletions lib/product/widget/card/game_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import 'package:flutter/material.dart';

import '../../../core/extension/context_extension.dart';
import '../../../view/home/game/model/game_model.dart';

class GameCard extends StatelessWidget {
final GameModel model;
final VoidCallback onPressed;

const GameCard({Key key, this.model, this.onPressed}) : super(key: key);
@override
Widget build(BuildContext context) {
return Card(
child: Padding(
padding: context.paddingLow,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Center(child: Image.network(model.image)),
),
Text(model.name),
Text('\$ ${model.money}')
],
),
),
);
}
}
29 changes: 29 additions & 0 deletions lib/product/widget/grid/game_grid_view.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import 'package:flutter/material.dart';

import '../../../view/home/game/model/game_model.dart';
import '../card/game_card.dart';

class GameGrid extends StatelessWidget {
final List<GameModel> models;
final void Function(GameModel item, int indx) onPressed;

const GameGrid({Key key, this.models, this.onPressed}) : super(key: key);
@override
Widget build(BuildContext context) {
return GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 0.8,
),
itemCount: 3,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => GameCard(
model: models[index],
onPressed: () {
onPressed(models[index], index);
},
),
);
}
}
55 changes: 55 additions & 0 deletions lib/product/widget/pageview/game_slider.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';

import '../../../view/home/game/model/slider_model.dart';

class GameSlider extends StatefulWidget {
final List<SliderModel> sliderModel;

const GameSlider({Key key, this.sliderModel}) : super(key: key);

@override
_GameSliderState createState() => _GameSliderState();
}

class _GameSliderState extends State<GameSlider> {
int _selectedValueIndex = 0;
@override
Widget build(BuildContext context) {
return Column(
children: [Expanded(flex: 10, child: buildPageView()), Expanded(child: buildListViewCirleIndicator())],
);
}

PageView buildPageView() {
return PageView.builder(
controller: PageController(viewportFraction: 0.8),
onPageChanged: _changeValue,
itemCount: widget.sliderModel.length,
itemBuilder: (context, index) => buildCardImage(index),
);
}

void _changeValue(int index) {
_selectedValueIndex = index;
setState(() {});
}

Widget buildCardImage(int index) => CachedNetworkImage(imageUrl: widget.sliderModel[index].image);

ListView buildListViewCirleIndicator() {
return ListView.builder(
itemCount: widget.sliderModel.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) => Padding(
padding: EdgeInsets.all(context.dynamicWidth(0.01)),
child: CircleAvatar(
backgroundColor: _selectedValueIndex == index ? context.colorScheme.onError : context.colorScheme.onError.withOpacity(0.1),
radius: 10,
),
),
);
}
}
8 changes: 7 additions & 1 deletion lib/view/_product/enum/network_route_enum.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enum NetworkRoutes { LOGIN, BUILD_HOME, FRIENDS }
enum NetworkRoutes { LOGIN, BUILD_HOME, FRIENDS, GAME, SLIDER }

extension NetwrokRoutesString on NetworkRoutes {
String get rawValue {
Expand All @@ -9,6 +9,12 @@ extension NetwrokRoutesString on NetworkRoutes {
return 'house';
case NetworkRoutes.FRIENDS:
return 'friends';

case NetworkRoutes.GAME:
return 'games';

case NetworkRoutes.SLIDER:
return 'slider';
default:
throw Exception('Routes Not FouND');
}
Expand Down
1 change: 1 addition & 0 deletions lib/view/home/game/model/game_enums.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enum GameEnum { NEW, TOP }
31 changes: 31 additions & 0 deletions lib/view/home/game/model/game_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:vexana/vexana.dart';

part 'game_model.g.dart';

@JsonSerializable()
class GameModel extends INetworkModel<GameModel> {
@JsonKey(name: '_id')
String sId;
String image;
String name;
int money;
int category;
GameModel({
this.sId,
this.image,
this.name,
this.money,
this.category,
});

@override
GameModel fromJson(Map<String, Object> json) {
return _$GameModelFromJson(json);
}

@override
Map<String, Object> toJson() {
return _$GameModelToJson(this);
}
}
Loading