Skip to content

Commit 480ff30

Browse files
authored
Merge pull request #15 from VB10/feature/feed-build
feature/feed build
2 parents 15abf88 + 86baabc commit 480ff30

21 files changed

+715
-9
lines changed

asset/lang/en-US.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,16 @@
1717
"forgotText":"Forgot Password",
1818
"login":"Login",
1919
"dontAccount":"Dont have account"
20+
},
21+
"home":{
22+
"build":{
23+
"tabbar":{
24+
"tab1":"Latest",
25+
"tab2":"Decorative",
26+
"tab3":"Music",
27+
"tab4":"Style"
28+
},
29+
"subTitle":"Recommended"
30+
}
2031
}
2132
}

ios/Podfile.lock

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
PODS:
2+
- device_info (0.0.1):
3+
- Flutter
24
- Flutter (1.0.0)
5+
- path_provider (0.0.1):
6+
- Flutter
37
- path_provider_linux (0.0.1):
48
- Flutter
9+
- path_provider_macos (0.0.1):
10+
- Flutter
511
- path_provider_windows (0.0.1):
612
- Flutter
13+
- share (0.0.1):
14+
- Flutter
715
- shared_preferences (0.0.1):
816
- Flutter
917
- shared_preferences_linux (0.0.1):
@@ -14,24 +22,51 @@ PODS:
1422
- Flutter
1523
- shared_preferences_windows (0.0.1):
1624
- Flutter
25+
- url_launcher (0.0.1):
26+
- Flutter
27+
- url_launcher_linux (0.0.1):
28+
- Flutter
29+
- url_launcher_macos (0.0.1):
30+
- Flutter
31+
- url_launcher_web (0.0.1):
32+
- Flutter
33+
- url_launcher_windows (0.0.1):
34+
- Flutter
1735

1836
DEPENDENCIES:
37+
- device_info (from `.symlinks/plugins/device_info/ios`)
1938
- Flutter (from `Flutter`)
39+
- path_provider (from `.symlinks/plugins/path_provider/ios`)
2040
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
41+
- path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
2142
- path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`)
43+
- share (from `.symlinks/plugins/share/ios`)
2244
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
2345
- shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
2446
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
2547
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
2648
- shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`)
49+
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
50+
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
51+
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
52+
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
53+
- url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)
2754

2855
EXTERNAL SOURCES:
56+
device_info:
57+
:path: ".symlinks/plugins/device_info/ios"
2958
Flutter:
3059
:path: Flutter
60+
path_provider:
61+
:path: ".symlinks/plugins/path_provider/ios"
3162
path_provider_linux:
3263
:path: ".symlinks/plugins/path_provider_linux/ios"
64+
path_provider_macos:
65+
:path: ".symlinks/plugins/path_provider_macos/ios"
3366
path_provider_windows:
3467
:path: ".symlinks/plugins/path_provider_windows/ios"
68+
share:
69+
:path: ".symlinks/plugins/share/ios"
3570
shared_preferences:
3671
:path: ".symlinks/plugins/shared_preferences/ios"
3772
shared_preferences_linux:
@@ -42,16 +77,35 @@ EXTERNAL SOURCES:
4277
:path: ".symlinks/plugins/shared_preferences_web/ios"
4378
shared_preferences_windows:
4479
:path: ".symlinks/plugins/shared_preferences_windows/ios"
80+
url_launcher:
81+
:path: ".symlinks/plugins/url_launcher/ios"
82+
url_launcher_linux:
83+
:path: ".symlinks/plugins/url_launcher_linux/ios"
84+
url_launcher_macos:
85+
:path: ".symlinks/plugins/url_launcher_macos/ios"
86+
url_launcher_web:
87+
:path: ".symlinks/plugins/url_launcher_web/ios"
88+
url_launcher_windows:
89+
:path: ".symlinks/plugins/url_launcher_windows/ios"
4590

4691
SPEC CHECKSUMS:
92+
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
4793
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
94+
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
4895
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
96+
path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
4997
path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b
98+
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
5099
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
51100
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
52101
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
53102
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
54103
shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae
104+
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
105+
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
106+
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
107+
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
108+
url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5
55109

56110
PODFILE CHECKSUM: c34e2287a9ccaa606aeceab922830efb9a6ff69a
57111

lib/core/base/model/base_view_model.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import '../../init/cache/locale_manager.dart';
44
import '../../init/navigation/navigation_service.dart';
55
import '../../init/network/ICoreDio.dart';
66
import '../../init/network/network_manager.dart';
7+
import '../../init/network/vexana_manager.dart';
78

89
abstract class BaseViewModel {
910
BuildContext context;
1011

1112
ICoreDio coreDio = NetworkManager.instance.coreDio;
13+
VexanaManager vexanaManager = VexanaManager.instance;
1214
LocaleManager localeManager = LocaleManager.instance;
1315
NavigationService navigation = NavigationService.instance;
1416

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import 'package:flutter/material.dart';
2+
3+
class CircleDecoration extends Decoration {
4+
final BoxPainter _painter;
5+
6+
CircleDecoration({@required Color color, @required double radius}) : _painter = _CirclePainter(color, radius);
7+
8+
@override
9+
BoxPainter createBoxPainter([onChanged]) => _painter;
10+
}
11+
12+
class _CirclePainter extends BoxPainter {
13+
final Paint _paint;
14+
final double radius;
15+
16+
_CirclePainter(Color color, this.radius)
17+
: _paint = Paint()
18+
..color = color
19+
..isAntiAlias = true;
20+
21+
@override
22+
void paint(Canvas canvas, Offset offset, ImageConfiguration cfg) {
23+
final Offset circleOffset = offset + Offset(cfg.size.width / 2, cfg.size.height - radius - 5);
24+
canvas.drawCircle(circleOffset, radius, _paint);
25+
}
26+
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,13 @@ abstract class LocaleKeys {
2020
static const login_login = 'login.login';
2121
static const login_dontAccount = 'login.dontAccount';
2222
static const login = 'login';
23+
static const home_build_tabbar_tab1 = 'home.build.tabbar.tab1';
24+
static const home_build_tabbar_tab2 = 'home.build.tabbar.tab2';
25+
static const home_build_tabbar_tab3 = 'home.build.tabbar.tab3';
26+
static const home_build_tabbar_tab4 = 'home.build.tabbar.tab4';
27+
static const home_build_tabbar = 'home.build.tabbar';
28+
static const home_build_subTitle = 'home.build.subTitle';
29+
static const home_build = 'home.build';
30+
static const home = 'home';
2331

2432
}

lib/core/init/network/vexana_manager.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:io';
2+
13
import 'package:vexana/vexana.dart';
24

35
class VexanaManager {
@@ -7,7 +9,11 @@ class VexanaManager {
79
return _instace;
810
}
911

12+
static const String _iosBaseUrl = "http://localhost:3000/";
13+
static const String _androidBaseUrl = "http://10.0.2.2:3000/";
14+
1015
VexanaManager._init();
1116

12-
INetworkManager networkManager = NetworkManager(isEnableLogger: true, options: BaseOptions(baseUrl: "http://localhost:3000/"));
17+
INetworkManager networkManager =
18+
NetworkManager(isEnableLogger: true, options: BaseOptions(baseUrl: Platform.isAndroid ? _androidBaseUrl : _iosBaseUrl));
1319
}

lib/core/init/theme/app_theme_light.dart

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ 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)),
2122
inputDecorationTheme: InputDecorationTheme(
2223
focusColor: Colors.black12,
2324
labelStyle: TextStyle(),
@@ -26,18 +27,23 @@ class AppThemeLight extends AppTheme with ILightTheme {
2627
focusedBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.red))),
2728
scaffoldBackgroundColor: Color(0xfff1f3f8),
2829
floatingActionButtonTheme: ThemeData.light().floatingActionButtonTheme.copyWith(),
29-
tabBarTheme: tabBarTheme(),
30+
tabBarTheme: tabBarTheme,
3031
);
3132

32-
TabBarTheme tabBarTheme() {
33+
TabBarTheme get tabBarTheme {
3334
return TabBarTheme(
3435
labelPadding: insets.lowPaddingAll,
35-
unselectedLabelStyle: textThemeLight.headline4.copyWith(color: colorSchemeLight.red),
36+
labelColor: _appColorScheme.onSecondary,
37+
labelStyle: textThemeLight.headline5,
38+
unselectedLabelColor: _appColorScheme.onSecondary.withOpacity(0.2),
39+
// unselectedLabelStyle: textThemeLight.headline4.copyWith(color: colorSchemeLight.red),
3640
);
3741
}
3842

3943
TextTheme textTheme() {
40-
return TextTheme(headline1: textThemeLight.headline1, headline2: textThemeLight.headline2, overline: textThemeLight.headline3);
44+
return ThemeData.light()
45+
.textTheme
46+
.copyWith(headline1: textThemeLight.headline1, headline2: textThemeLight.headline2, overline: textThemeLight.headline3);
4147
}
4248

4349
ColorScheme get _appColorScheme {
@@ -46,7 +52,7 @@ class AppThemeLight extends AppTheme with ILightTheme {
4652
primaryVariant: Colors.white, //xx
4753
secondary: Colors.green,
4854
secondaryVariant: colorSchemeLight.azure,
49-
surface: Colors.blue,
55+
surface: Colors.blue, //xx
5056
background: Colors.white,
5157
error: Colors.red[900],
5258
onPrimary: Colors.greenAccent,

lib/main.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:easy_localization/easy_localization.dart';
22
import 'package:flutter/material.dart';
3+
import 'package:fluttermvvmtemplate/view/home/build/feed/view/build_feed_view.dart';
34
import 'package:provider/provider.dart';
45

56
import 'core/constants/app/app_constants.dart';
@@ -25,7 +26,7 @@ class MyApp extends StatelessWidget {
2526
Widget build(BuildContext context) {
2627
return MaterialApp(
2728
theme: Provider.of<ThemeNotifier>(context, listen: false).currentTheme,
28-
home: LoginView(),
29+
home: BuildFeedView(),
2930
onGenerateRoute: NavigationRoute.instance.generateRoute,
3031
navigatorKey: NavigationService.instance.navigatorKey,
3132
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import 'package:flutter/material.dart';
2+
3+
import '../../../core/components/decoration/circle_decoration.dart';
4+
import '../../../core/extension/context_extension.dart';
5+
6+
class DecorationHelper {
7+
BuildContext context;
8+
DecorationHelper({
9+
this.context,
10+
});
11+
12+
Decoration get circleDecoriaton => CircleDecoration(color: context.colors.surface, radius: 3);
13+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import 'package:flutter/cupertino.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:vexana/vexana.dart';
4+
5+
abstract class ServiceHelper {
6+
void showMessage(GlobalKey<ScaffoldState> scaffoldKey, IErrorModel errorModel) {
7+
if (scaffoldKey == null || errorModel == null) return;
8+
scaffoldKey.currentState.showSnackBar(SnackBar(content: Text(errorModel.description ?? errorModel.statusCode.toString())));
9+
}
10+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import 'package:auto_size_text/auto_size_text.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:kartal/kartal.dart';
4+
5+
import '../../../home/build/feed/model/house_model.dart';
6+
7+
class BuildUserCard extends StatelessWidget {
8+
final HouseModel model;
9+
final bool isLiked;
10+
final Function(String id) onPressedLikeId;
11+
12+
const BuildUserCard({Key key, @required this.model, this.onPressedLikeId, this.isLiked = false}) : super(key: key);
13+
@override
14+
Widget build(BuildContext context) {
15+
return Column(
16+
crossAxisAlignment: CrossAxisAlignment.start,
17+
children: [
18+
ListTile(
19+
contentPadding: EdgeInsets.zero,
20+
leading: CircleAvatar(backgroundImage: NetworkImage(model.user.image)),
21+
title: Text(model.user.name),
22+
subtitle: Text(model.user.date),
23+
trailing: buildIconButton(),
24+
),
25+
context.emptySizedHeightBoxLow,
26+
buildWrap(context)
27+
],
28+
);
29+
}
30+
31+
Widget buildWrap(BuildContext context) {
32+
return Column(
33+
children: [
34+
AutoSizeText(model.title, style: context.textTheme.headline6.copyWith(fontWeight: FontWeight.w600), maxLines: 1),
35+
Text(model.description),
36+
],
37+
);
38+
}
39+
40+
IconButton buildIconButton() {
41+
return IconButton(
42+
icon: Icon(
43+
Icons.favorite,
44+
color: isLiked ? Colors.pink : Colors.black12,
45+
),
46+
onPressed: () {
47+
onPressedLikeId(model.id);
48+
});
49+
}
50+
}

lib/view/_product/enum/network_route_enum.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
enum NetworkRoutes { LOGIN }
1+
enum NetworkRoutes { LOGIN, BUILD_HOME }
22

33
extension NetwrokRoutesString on NetworkRoutes {
44
String get rawValue {
55
switch (this) {
66
case NetworkRoutes.LOGIN:
77
return "login";
8+
case NetworkRoutes.BUILD_HOME:
9+
return "house";
810
default:
911
throw Exception("Routes Not FouND");
1012
}

0 commit comments

Comments
 (0)