Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ca8f922

Browse files
authored
Merge pull request #21 from VB10/feature/test-mockito
feature/test mockito
2 parents 794991c + 14d9afc commit ca8f922

28 files changed

+798
-76
lines changed

‎asset/lang/en-US.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727
"tab4":"Style"
2828
},
2929
"subTitle":"Recommended"
30+
},
31+
"social":{
32+
"cancel":"Cancel",
33+
"next":"Next",
34+
"search":"Search",
35+
"findFriends":"Find Friends",
36+
"follow":"Follow",
37+
"following":"Following"
3038
}
3139
}
3240
}

‎lib/core/extension/network_exntension.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ extension NetworkTypeExtension on HttpTypes {
44
String get rawValue {
55
switch (this) {
66
case HttpTypes.GET:
7-
return "GET";
7+
return 'GET';
88
case HttpTypes.POST:
9-
return "POST";
9+
return 'POST';
1010
default:
11-
throw "ERROR TYPE";
11+
throw 'ERROR TYPE';
1212
}
1313
}
1414
}

‎lib/core/init/lang/language_manager.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class LanguageManager {
99

1010
LanguageManager._init();
1111

12-
final enLocale = Locale("en", "US");
12+
final enLocale = Locale('en', 'US');
1313

1414
List<Locale> get supportedLocales => [enLocale];
1515
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ abstract class LocaleKeys {
2727
static const home_build_tabbar = 'home.build.tabbar';
2828
static const home_build_subTitle = 'home.build.subTitle';
2929
static const home_build = 'home.build';
30+
static const home_social_cancel = 'home.social.cancel';
31+
static const home_social_next = 'home.social.next';
32+
static const home_social_search = 'home.social.search';
33+
static const home_social_findFriends = 'home.social.findFriends';
34+
static const home_social_follow = 'home.social.follow';
35+
static const home_social_following = 'home.social.following';
36+
static const home_social = 'home.social';
3037
static const home = 'home';
3138

3239
}

‎lib/core/init/theme/app_theme_light.dart‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import 'light/light_theme_interface.dart';
77
class AppThemeLight extends AppTheme with ILightTheme {
88
static AppThemeLight _instance;
99
static AppThemeLight get instance {
10-
if (_instance == null) _instance = AppThemeLight._init();
11-
return _instance;
10+
return _instance ??= AppThemeLight._init();
1211
}
1312

1413
AppThemeLight._init();
1514

1615
// ThemeData get theme => redTheme;
16+
@override
1717
ThemeData get theme => ThemeData(
1818
fontFamily: ApplicationConstants.FONT_FAMILY,
1919
colorScheme: _appColorScheme,
@@ -22,11 +22,19 @@ class AppThemeLight extends AppTheme with ILightTheme {
2222
inputDecorationTheme: InputDecorationTheme(
2323
focusColor: Colors.black12,
2424
labelStyle: TextStyle(),
25-
enabledBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.red)),
26-
border: UnderlineInputBorder(borderSide: BorderSide(color: Colors.red)),
27-
focusedBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.red))),
25+
fillColor: Colors.white,
26+
contentPadding: EdgeInsets.zero,
27+
filled: true,
28+
enabledBorder: OutlineInputBorder(borderSide: BorderSide(width: 0.3)),
29+
// border: OutlineInputBorder(borderSide: BorderSide(width: 0.3)),
30+
focusedBorder: OutlineInputBorder()),
2831
scaffoldBackgroundColor: Color(0xfff1f3f8),
2932
floatingActionButtonTheme: ThemeData.light().floatingActionButtonTheme.copyWith(),
33+
buttonTheme: ThemeData.light().buttonTheme.copyWith(
34+
colorScheme: ColorScheme.light(
35+
onError: Color(0xffFF2D55),
36+
),
37+
),
3038
tabBarTheme: tabBarTheme,
3139
);
3240

@@ -53,7 +61,7 @@ class AppThemeLight extends AppTheme with ILightTheme {
5361
secondary: Colors.green,
5462
secondaryVariant: colorSchemeLight.azure,
5563
surface: Colors.blue, //xx
56-
background: Colors.white,
64+
background: Color(0xfff6f9fc), //xx
5765
error: Colors.red[900],
5866
onPrimary: Colors.greenAccent,
5967
onSecondary: Colors.black, //x

‎lib/main.dart‎

Lines changed: 3 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/build/feed/view/build_feed_view.dart';
12+
import 'view/home/social/view/social_view.dart';
1313

1414
void main() {
1515
WidgetsFlutterBinding.ensureInitialized();
@@ -24,8 +24,9 @@ class MyApp extends StatelessWidget {
2424
@override
2525
Widget build(BuildContext context) {
2626
return MaterialApp(
27+
debugShowCheckedModeBanner: false,
2728
theme: Provider.of<ThemeNotifier>(context, listen: false).currentTheme,
28-
home: BuildFeedView(),
29+
home: SocialView(),
2930
onGenerateRoute: NavigationRoute.instance.generateRoute,
3031
navigatorKey: NavigationService.instance.navigatorKey,
3132
);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class FriendQuery {
2+
final int limit;
3+
final String q;
4+
5+
FriendQuery({this.limit, this.q});
6+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
enum FriendQueryEnum { LIMIT, Q }
2+
3+
extension FriendQueryEnumString on FriendQueryEnum {
4+
String get rawValue {
5+
switch (this) {
6+
case FriendQueryEnum.LIMIT:
7+
return 'limit';
8+
case FriendQueryEnum.Q:
9+
return 'q';
10+
default:
11+
throw Exception('Routes Not FouND');
12+
}
13+
}
14+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import 'dart:async';
2+
3+
class ThrottleStringHelper {
4+
String _pastText;
5+
6+
final int _maxTimerValue = 5;
7+
int _timerValue = 0;
8+
ThrottleStringHelper() {
9+
_onSetMaxValue();
10+
}
11+
void onDelayTouch(String text, Function(String text) onComplete) {
12+
_pastText = text;
13+
if (_timerValue == _maxTimerValue) {
14+
Timer.periodic(Duration(milliseconds: 100), (timer) {
15+
_timerValue--;
16+
17+
if (_timerValue == 0) {
18+
onComplete(_pastText);
19+
timer.cancel();
20+
_onSetMaxValue();
21+
}
22+
});
23+
} else {
24+
_onSetMaxNearValue();
25+
}
26+
}
27+
28+
void _onSetMaxValue() {
29+
_timerValue = _maxTimerValue;
30+
}
31+
32+
void _onSetMaxNearValue() {
33+
_timerValue = _maxTimerValue - 1;
34+
}
35+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import 'package:animations/animations.dart';
2+
import 'package:flutter/material.dart';
3+
4+
import '../../../home/social/model/social_user_model.dart';
5+
import '../../../home/social/view/social_view_detial.dart';
6+
7+
class OpenContainerSocailWrapper extends StatelessWidget {
8+
final ContainerTransitionType _transitionType = ContainerTransitionType.fade;
9+
const OpenContainerSocailWrapper({
10+
this.closedBuilder,
11+
this.onClosed,
12+
this.socialUser,
13+
});
14+
15+
final OpenContainerBuilder closedBuilder;
16+
final ClosedCallback<bool> onClosed;
17+
final SocialUser socialUser;
18+
@override
19+
Widget build(BuildContext context) {
20+
return OpenContainer<bool>(
21+
transitionType: _transitionType,
22+
openBuilder: (BuildContext context, VoidCallback _) {
23+
return SocialUserViewDetail(
24+
socialUser: socialUser,
25+
);
26+
},
27+
onClosed: onClosed,
28+
tappable: false,
29+
closedBuilder: closedBuilder,
30+
);
31+
}
32+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /