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
11 changes: 11 additions & 0 deletions asset/lang/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,16 @@
"forgotText":"Forgot Password",
"login":"Login",
"dontAccount":"Dont have account"
},
"home":{
"build":{
"tabbar":{
"tab1":"Latest",
"tab2":"Decorative",
"tab3":"Music",
"tab4":"Style"
},
"subTitle":"Recommended"
}
}
}
54 changes: 54 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
PODS:
- device_info (0.0.1):
- Flutter
- Flutter (1.0.0)
- path_provider (0.0.1):
- Flutter
- path_provider_linux (0.0.1):
- Flutter
- path_provider_macos (0.0.1):
- Flutter
- path_provider_windows (0.0.1):
- Flutter
- share (0.0.1):
- Flutter
- shared_preferences (0.0.1):
- Flutter
- shared_preferences_linux (0.0.1):
Expand All @@ -14,24 +22,51 @@ PODS:
- Flutter
- shared_preferences_windows (0.0.1):
- Flutter
- url_launcher (0.0.1):
- Flutter
- url_launcher_linux (0.0.1):
- Flutter
- url_launcher_macos (0.0.1):
- Flutter
- url_launcher_web (0.0.1):
- Flutter
- url_launcher_windows (0.0.1):
- Flutter

DEPENDENCIES:
- device_info (from `.symlinks/plugins/device_info/ios`)
- Flutter (from `Flutter`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
- path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
- path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`)
- share (from `.symlinks/plugins/share/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
- 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`)
- 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`)

EXTERNAL SOURCES:
device_info:
:path: ".symlinks/plugins/device_info/ios"
Flutter:
:path: Flutter
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
path_provider_linux:
:path: ".symlinks/plugins/path_provider_linux/ios"
path_provider_macos:
:path: ".symlinks/plugins/path_provider_macos/ios"
path_provider_windows:
:path: ".symlinks/plugins/path_provider_windows/ios"
share:
:path: ".symlinks/plugins/share/ios"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
shared_preferences_linux:
Expand All @@ -42,16 +77,35 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/shared_preferences_web/ios"
shared_preferences_windows:
:path: ".symlinks/plugins/shared_preferences_windows/ios"
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"
url_launcher_linux:
:path: ".symlinks/plugins/url_launcher_linux/ios"
url_launcher_macos:
:path: ".symlinks/plugins/url_launcher_macos/ios"
url_launcher_web:
:path: ".symlinks/plugins/url_launcher_web/ios"
url_launcher_windows:
:path: ".symlinks/plugins/url_launcher_windows/ios"

SPEC CHECKSUMS:
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5

PODFILE CHECKSUM: c34e2287a9ccaa606aeceab922830efb9a6ff69a

Expand Down
2 changes: 2 additions & 0 deletions lib/core/base/model/base_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import '../../init/cache/locale_manager.dart';
import '../../init/navigation/navigation_service.dart';
import '../../init/network/ICoreDio.dart';
import '../../init/network/network_manager.dart';
import '../../init/network/vexana_manager.dart';

abstract class BaseViewModel {
BuildContext context;

ICoreDio coreDio = NetworkManager.instance.coreDio;
VexanaManager vexanaManager = VexanaManager.instance;
LocaleManager localeManager = LocaleManager.instance;
NavigationService navigation = NavigationService.instance;

Expand Down
26 changes: 26 additions & 0 deletions lib/core/components/decoration/circle_decoration.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'package:flutter/material.dart';

class CircleDecoration extends Decoration {
final BoxPainter _painter;

CircleDecoration({@required Color color, @required double radius}) : _painter = _CirclePainter(color, radius);

@override
BoxPainter createBoxPainter([onChanged]) => _painter;
}

class _CirclePainter extends BoxPainter {
final Paint _paint;
final double radius;

_CirclePainter(Color color, this.radius)
: _paint = Paint()
..color = color
..isAntiAlias = true;

@override
void paint(Canvas canvas, Offset offset, ImageConfiguration cfg) {
final Offset circleOffset = offset + Offset(cfg.size.width / 2, cfg.size.height - radius - 5);
canvas.drawCircle(circleOffset, radius, _paint);
}
}
8 changes: 8 additions & 0 deletions lib/core/init/lang/locale_keys.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,13 @@ abstract class LocaleKeys {
static const login_login = 'login.login';
static const login_dontAccount = 'login.dontAccount';
static const login = 'login';
static const home_build_tabbar_tab1 = 'home.build.tabbar.tab1';
static const home_build_tabbar_tab2 = 'home.build.tabbar.tab2';
static const home_build_tabbar_tab3 = 'home.build.tabbar.tab3';
static const home_build_tabbar_tab4 = 'home.build.tabbar.tab4';
static const home_build_tabbar = 'home.build.tabbar';
static const home_build_subTitle = 'home.build.subTitle';
static const home_build = 'home.build';
static const home = 'home';

}
8 changes: 7 additions & 1 deletion lib/core/init/network/vexana_manager.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:vexana/vexana.dart';

class VexanaManager {
Expand All @@ -7,7 +9,11 @@ class VexanaManager {
return _instace;
}

static const String _iosBaseUrl = "http://localhost:3000/";
static const String _androidBaseUrl = "http://10.0.2.2:3000/";

VexanaManager._init();

INetworkManager networkManager = NetworkManager(isEnableLogger: true, options: BaseOptions(baseUrl: "http://localhost:3000/"));
INetworkManager networkManager =
NetworkManager(isEnableLogger: true, options: BaseOptions(baseUrl: Platform.isAndroid ? _androidBaseUrl : _iosBaseUrl));
}
16 changes: 11 additions & 5 deletions lib/core/init/theme/app_theme_light.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ 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)),
inputDecorationTheme: InputDecorationTheme(
focusColor: Colors.black12,
labelStyle: TextStyle(),
Expand All @@ -26,18 +27,23 @@ class AppThemeLight extends AppTheme with ILightTheme {
focusedBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.red))),
scaffoldBackgroundColor: Color(0xfff1f3f8),
floatingActionButtonTheme: ThemeData.light().floatingActionButtonTheme.copyWith(),
tabBarTheme: tabBarTheme(),
tabBarTheme: tabBarTheme,
);

TabBarTheme tabBarTheme() {
TabBarTheme get tabBarTheme {
return TabBarTheme(
labelPadding: insets.lowPaddingAll,
unselectedLabelStyle: textThemeLight.headline4.copyWith(color: colorSchemeLight.red),
labelColor: _appColorScheme.onSecondary,
labelStyle: textThemeLight.headline5,
unselectedLabelColor: _appColorScheme.onSecondary.withOpacity(0.2),
// unselectedLabelStyle: textThemeLight.headline4.copyWith(color: colorSchemeLight.red),
);
}

TextTheme textTheme() {
return TextTheme(headline1: textThemeLight.headline1, headline2: textThemeLight.headline2, overline: textThemeLight.headline3);
return ThemeData.light()
.textTheme
.copyWith(headline1: textThemeLight.headline1, headline2: textThemeLight.headline2, overline: textThemeLight.headline3);
}

ColorScheme get _appColorScheme {
Expand All @@ -46,7 +52,7 @@ class AppThemeLight extends AppTheme with ILightTheme {
primaryVariant: Colors.white, //xx
secondary: Colors.green,
secondaryVariant: colorSchemeLight.azure,
surface: Colors.blue,
surface: Colors.blue, //xx
background: Colors.white,
error: Colors.red[900],
onPrimary: Colors.greenAccent,
Expand Down
3 changes: 2 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:fluttermvvmtemplate/view/home/build/feed/view/build_feed_view.dart';
import 'package:provider/provider.dart';

import 'core/constants/app/app_constants.dart';
Expand All @@ -25,7 +26,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
theme: Provider.of<ThemeNotifier>(context, listen: false).currentTheme,
home: LoginView(),
home: BuildFeedView(),
onGenerateRoute: NavigationRoute.instance.generateRoute,
navigatorKey: NavigationService.instance.navigatorKey,
);
Expand Down
13 changes: 13 additions & 0 deletions lib/view/_product/_utilty/decoration_helper.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'package:flutter/material.dart';

import '../../../core/components/decoration/circle_decoration.dart';
import '../../../core/extension/context_extension.dart';

class DecorationHelper {
BuildContext context;
DecorationHelper({
this.context,
});

Decoration get circleDecoriaton => CircleDecoration(color: context.colors.surface, radius: 3);
}
10 changes: 10 additions & 0 deletions lib/view/_product/_utilty/service_helper.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:vexana/vexana.dart';

abstract class ServiceHelper {
void showMessage(GlobalKey<ScaffoldState> scaffoldKey, IErrorModel errorModel) {
if (scaffoldKey == null || errorModel == null) return;
scaffoldKey.currentState.showSnackBar(SnackBar(content: Text(errorModel.description ?? errorModel.statusCode.toString())));
}
}
50 changes: 50 additions & 0 deletions lib/view/_product/_widgets/card/build_user_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';

import '../../../home/build/feed/model/house_model.dart';

class BuildUserCard extends StatelessWidget {
final HouseModel model;
final bool isLiked;
final Function(String id) onPressedLikeId;

const BuildUserCard({Key key, @required this.model, this.onPressedLikeId, this.isLiked = false}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ListTile(
contentPadding: EdgeInsets.zero,
leading: CircleAvatar(backgroundImage: NetworkImage(model.user.image)),
title: Text(model.user.name),
subtitle: Text(model.user.date),
trailing: buildIconButton(),
),
context.emptySizedHeightBoxLow,
buildWrap(context)
],
);
}

Widget buildWrap(BuildContext context) {
return Column(
children: [
AutoSizeText(model.title, style: context.textTheme.headline6.copyWith(fontWeight: FontWeight.w600), maxLines: 1),
Text(model.description),
],
);
}

IconButton buildIconButton() {
return IconButton(
icon: Icon(
Icons.favorite,
color: isLiked ? Colors.pink : Colors.black12,
),
onPressed: () {
onPressedLikeId(model.id);
});
}
}
4 changes: 3 additions & 1 deletion lib/view/_product/enum/network_route_enum.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
enum NetworkRoutes { LOGIN }
enum NetworkRoutes { LOGIN, BUILD_HOME }

extension NetwrokRoutesString on NetworkRoutes {
String get rawValue {
switch (this) {
case NetworkRoutes.LOGIN:
return "login";
case NetworkRoutes.BUILD_HOME:
return "house";
default:
throw Exception("Routes Not FouND");
}
Expand Down
Loading