Commit b5664acd authored by 杜欣's avatar 杜欣

Merge branch 'dev' into dx/message

# Conflicts:
#	ios/Runner/AppDelegate.m
#	lib/res/value/ALColors.dart
parents c7849c50 026a4810
......@@ -21,5 +21,14 @@
android:value="true" />
</activity>
<activity android:name=".Temp"/>
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.example.gmalpha_flutter"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
</manifest>
......@@ -64,6 +64,7 @@ class MainActivity : FlutterActivity() {
} else if (call.method == "INIT_PARAMS") {
val map = HashMap<String, String>()
map.put("buildConfig", "debug")
map.put("provider","com.example.gmalpha_flutter")
//HERE
// map.put("proxy", "172.30.9.84:6666");
result.success(map)
......
<?xml version="1.0" encoding="utf-8"?>
<paths>
<!--path:需要临时授权访问的路径(.代表所有路径)-->
<!--name:就是你给这个访问路径起个名字-->
<external-path name="InstructiveRide" path="."/>
</paths>
\ No newline at end of file
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#include <flutter_boost/FlutterBoostPlugin.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[GeneratedPluginRegistrant registerWithRegistry:self];
[self flutterMethod];
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
- (void)flutterMethod {
FlutterViewController* controller =
(FlutterViewController*)self.window.rootViewController;
FlutterMethodChannel* buryChannel = [FlutterMethodChannel
methodChannelWithName:@"flutter_bury_channel"
binaryMessenger:controller];
[buryChannel setMethodCallHandler:^(FlutterMethodCall* call,
FlutterResult result) {
NSLog(@" ME %@ argue %@",call.method,call.arguments);
if([call.method isEqualToString:@"FLUTTER_TO_H5"]){
NSLog(@"FLUTTER_TO_H5");
}else if([call.method isEqualToString:@"FLUTTER_TO_NATIVE"]){
NSLog(@"FLUTTER_TO_NATIVE");
}else if ([call.method isEqualToString:@"FLUTTER_BURIED"]){
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
//APPInfo
[dict setObject:@"alpha" forKey:@"app_name"];
[dict setObject:@"app_version_name" forKey:@"app_version_name"];
[dict setObject:@"channel" forKey:@"channel"];
[dict setObject:@"" forKey:@"current_city_id"];
[dict setObject:[[NSMutableDictionary alloc] initWithCapacity:0] forKey:@"user_type"];
[dict setObject:@"" forKey:@"grey_type"];
//DeviceInfo
[dict setObject:@"device_id" forKey:@"device_id"];
[dict setObject:@"Apple" forKey:@"manufacturer"];
[dict setObject:@"lng" forKey:@"lng"];
[dict setObject:@"lat" forKey:@"lat"];
[dict setObject:@"is_WiFi" forKey:@"is_WiFi"];
[dict setObject:@"ip" forKey:@"ip"];
[dict setObject:@"model" forKey:@"model"];
[dict setObject:@"sys_version" forKey:@"sys_version"];
[dict setObject:@"Apple" forKey:@"lng"];
[dict setObject:@"idfa" forKey:@"idfa"];
[dict setObject:@"idfv" forKey:@"idfv"];
[dict setObject:@"user_id" forKey:@"user_id"];
[dict setObject:@"" forKey:@"app_session_id"];
[dict setObject:@"create_at" forKey:@"create_at"];
[dict setObject:@"110" forKey:@"version"];
result(dict);
}else if([call.method isEqualToString:@"GET_NET_TYPE"]){
result(@"wifi");
}else if([call.method isEqualToString:@"INIT_PARAMS"]){
NSMutableDictionary * map=[[NSMutableDictionary alloc] init];
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
[dict setObject:@"sessionid=9odo0sov71x66ke9dlphibnq9i9gduxj;_gtid=3fbe9b78d2cb11e98bc1525400e82fab5270; _gm_token=db88861568285036" forKey:@"cookie"];
[dict setObject:@"debug" forKey:@"buildConfig"];
//HERE
// [dict setObject:@"172.30.9.84:6666" forKey:@"proxy"];
result(dict);
}
}];
}
@end
......@@ -5,7 +5,6 @@
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/ActivityReportModel/service/ActivityReportRepository.dart';
import 'package:gmalpha_flutter/ActivityReportModel/service/remote/entity/ActivityReportEntity.dart';
import 'package:gmalpha_flutter/commonModel/base/Temp.dart';
import 'package:gmalpha_flutter/commonModel/live/BaseModel.dart';
import 'package:gmalpha_flutter/commonModel/live/LiveData.dart';
import 'package:gmalpha_flutter/commonModel/net/DioUtil.dart';
......
......@@ -10,10 +10,8 @@ import 'package:gmalpha_flutter/ActivityReportModel/service/remote/entity/Activi
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/ActivityReportModel/page/ActivityReportModel.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseComponent.dart';
import 'package:gmalpha_flutter/commonModel/base/BasePage.dart';
import 'package:gmalpha_flutter/commonModel/base/Temp.dart';
import 'package:gmalpha_flutter/commonModel/ui/ALColors.dart';
import 'package:gmalpha_flutter/commonModel/GMBase.dart';
import 'package:gmalpha_flutter/res/GMRes.dart';
final _goldenColor = Color(0xFFB9A689);
ActivityReportState state;
......@@ -243,7 +241,8 @@ class TopCard extends StatelessWidget {
SizedBox(
height: ScreenUtil.instance.setHeight(8.5),
child: Container(
margin: EdgeInsets.only(top: ScreenUtil.instance.setHeight(.5)),
margin:
EdgeInsets.only(top: ScreenUtil.instance.setHeight(.5)),
color: ALColors.Color323232,
),
),
......@@ -412,8 +411,8 @@ class PictorialCard extends StatelessWidget {
children: <Widget>[
Container(
width: ScreenUtil.instance.setWidth(343),
padding:
EdgeInsets.only(bottom: ScreenUtil.instance.setHeight(11.0)),
padding: EdgeInsets.only(
bottom: ScreenUtil.instance.setHeight(11.0)),
child: Wrap(spacing: 6, children: list),
),
Container(
......@@ -574,7 +573,8 @@ class AnimationCharacterState extends State<AnimationCharacter>
if (percent < frist) {
double tempPercent = percent / frist;
nowValue = (target * tempPercent).ceil();
margin = ScreenUtil.instance.setWidth(10.0 + (25.8 * nowValue).ceil());
margin =
ScreenUtil.instance.setWidth(10.0 + (25.8 * nowValue).ceil());
if (index != nowValue) {
item['url'] = 'images/dark_grey_person.png';
} else {
......
......@@ -179,7 +179,7 @@ class AlbumModel extends BaseModel {
void onNext(BuildContext context) {
if (_selectList.isEmpty) {
Navigator.pop(context, "");
Navigator.pop(context, null);
} else {
Navigator.pop(context, _selectList);
}
......
......@@ -38,7 +38,7 @@ class AlbumState extends State<AlbumPage> {
return Scaffold(
appBar: AppBar(
leading: GestureDetector(
onTap: () => Navigator.pop(context, ""),
onTap: () => Navigator.pop(context, null),
child: Center(
child: Container(
padding: EdgeInsets.fromLTRB(16, 0, 0, 0),
......@@ -108,7 +108,6 @@ class AlbumState extends State<AlbumPage> {
void dispose() {
super.dispose();
_model.dispose();
}
mainView() {
......
/*
* @author lsy
* @date 2019-09-09
**/
\ No newline at end of file
......@@ -3,10 +3,7 @@
* @date 2019-09-30
**/
import 'package:gmalpha_flutter/BuriedLib/buried/SendTask.dart';
import 'package:gmalpha_flutter/BuriedLib/buried/constant/Constant.dart';
import 'package:gmalpha_flutter/BuriedLib/proto/burying.pbgrpc.dart';
import 'package:gmalpha_flutter/commonModel/app_module.dart';
import 'package:gmalpha_flutter/commonModel/cache/CacheManager.dart';
const BURIED_TAG = "BURIED";
......
......@@ -4,8 +4,7 @@
**/
import 'package:gmalpha_flutter/BuriedLib/buried/constant/Constant.dart';
import 'package:gmalpha_flutter/BuriedLib/proto/burying.pbgrpc.dart';
import 'package:gmalpha_flutter/commonModel/app_module.dart';
import 'package:gmalpha_flutter/commonModel/base/Temp.dart';
import 'package:gmalpha_flutter/commonModel/GMBase.dart';
import 'package:gmalpha_flutter/commonModel/cache/CacheManager.dart';
import 'package:gmalpha_flutter/commonModel/net/Api.dart';
import 'package:grpc/grpc.dart';
......
......@@ -3,12 +3,11 @@
* @date 2019-09-16
**/
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/PrestigeModel/service/PrestigeRepository.dart';
import 'package:gmalpha_flutter/PrestigeModel/service/remote/entity/PrestigeEntity.dart';
import 'package:gmalpha_flutter/commonModel/base/Temp.dart';
import 'package:gmalpha_flutter/commonModel/live/BaseModel.dart';
import 'package:gmalpha_flutter/commonModel/live/LiveData.dart';
import 'package:gmalpha_flutter/commonModel/net/DioUtil.dart';
import 'package:gmalpha_flutter/commonModel/toast/toast.dart';
class ReputationsModel extends BaseModel {
......@@ -22,8 +21,6 @@ class ReputationsModel extends BaseModel {
ReputationsModel(this.userId, this.userName, this.fromPage) {
prestigeLive = new LiveData();
titleLive = new LiveData();
print("lsy -->INIT!!!");
}
init(BuildContext context) {
......@@ -42,6 +39,10 @@ class ReputationsModel extends BaseModel {
void dispose() {
prestigeLive.dispost();
titleLive.dispost();
print("lsy -->DISPOST!!!");
}
void pop(BuildContext context, String pageName) {
RouterCenterImpl().findBuriedRouter()?.onClick(pageName, "return");
Navigator.pop(context);
}
}
......@@ -39,79 +39,84 @@ class ReputationsState extends BasePage<ReputationsPage> {
@override
Widget build(BuildContext context) {
screenWidth = MediaQuery.of(context).size.width;
return Scaffold(
appBar: AppBar(
title: StreamBuilder<String>(
stream: _model.titleLive.stream,
initialData: _model.titleLive.data,
builder: (context, data) {
if (data.data == null) {
return MyText(16, '我的专家声望', 0xff323232);
}
String titleWord = '${data.data}的专家声望';
if (titleWord.length > 10) {
titleWord = titleWord.substring(0, 10) + "...";
}
return MyText(16, titleWord, 0xff323232);
},
),
centerTitle: true,
leading: GestureDetector(
onTap: () {
RouterCenterImpl()
.findBuriedRouter()
?.onClick(pageName(), "return");
Navigator.pop(context, "");
},
// child: Image.asset("images/nav_back.png"),
child: Center(
child: SvgPicture.asset("images/left_arrow.svg",
color: Color(0xff323232)),
),
)),
body: StreamBuilder<PrestigeEntity>(
stream: _model.prestigeLive.stream,
initialData: _model.prestigeLive.data,
builder: (context, data) {
if (data.data == null) {
return loadingItem();
}
if (data.data.error != 0 || data.data.data == null) {
return errorItem(data.data.message);
}
return CustomScrollView(
slivers: <Widget>[
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
if (index == 0) {
return Container(
margin: EdgeInsets.fromLTRB(17, 24, 17, 0),
child: MyText(16.0, data.data.data.introduce[0].question,
0xff323232),
);
return WillPopScope(
child: Scaffold(
appBar: AppBar(
title: StreamBuilder<String>(
stream: _model.titleLive.stream,
initialData: _model.titleLive.data,
builder: (context, data) {
if (data.data == null) {
return MyText(16, '我的专家声望', 0xff323232);
}
if (index == 1) {
return Container(
margin: EdgeInsets.fromLTRB(19, 16, 19, 32),
child: Text(
data.data.data.introduce[0].answer,
style:
TextStyle(fontSize: 13, color: Color(0xff8E8E8E)),
));
String titleWord = '${data.data}的专家声望';
if (titleWord.length > 10) {
titleWord = titleWord.substring(0, 10) + "...";
}
if (index == data.data.data.reputations.length + 2) {
//bottom margin
return Container(
height: 20,
);
}
return listItem(data, index - 2);
}, childCount: data.data.data.reputations.length + 3)),
],
);
},
));
return MyText(16, titleWord, 0xff323232);
},
),
centerTitle: true,
leading: GestureDetector(
onTap: () {
_model.pop(context, pageName());
},
child: Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 22),
width: 30,
height: double.maxFinite,
child: SvgPicture.asset("images/left_arrow.svg",
color: Color(0xff323232)),
),
)),
body: StreamBuilder<PrestigeEntity>(
stream: _model.prestigeLive.stream,
initialData: _model.prestigeLive.data,
builder: (context, data) {
if (data.data == null) {
return loadingItem();
}
if (data.data.error != 0 || data.data.data == null) {
return errorItem(data.data.message);
}
return CustomScrollView(
slivers: <Widget>[
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
if (index == 0) {
return Container(
margin: EdgeInsets.fromLTRB(17, 24, 17, 0),
child: MyText(16.0,
data.data.data.introduce[0].question, 0xff323232),
);
}
if (index == 1) {
return Container(
margin: EdgeInsets.fromLTRB(19, 16, 19, 32),
child: Text(
data.data.data.introduce[0].answer,
style: TextStyle(
fontSize: 13, color: Color(0xff8E8E8E)),
));
}
if (index == data.data.data.reputations.length + 2) {
//bottom margin
return Container(
height: 20,
);
}
return listItem(data, index - 2);
}, childCount: data.data.data.reputations.length + 3)),
],
);
},
)),
onWillPop: () {
_model.pop(context, pageName());
},
);
}
Widget listItem(AsyncSnapshot<PrestigeEntity> data, int index) {
......
/*
* @author lsy
* @date 2019-09-16
**/
\ No newline at end of file
......@@ -5,9 +5,9 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseComponent.dart';
import 'package:gmalpha_flutter/commonModel/net/Api.dart';
import 'package:gmalpha_flutter/res/anim/Anim.dart';
import 'commonModel/GMBase.dart';
class TestPage extends StatelessWidget {
TestPage() {
......
/*
* @author lsy
* @date 2019-10-15
**/
library GMBase;
export 'base/AppBase.dart';
export 'base/BaseBuried.dart';
export 'base/BaseComponent.dart';
export 'base/BasePage.dart';
export 'base/BaseUtil.dart';
export 'live/BaseModel.dart';
export 'live/LiveData.dart';
export 'net/Api.dart';
export 'net/DioUtil.dart';
export 'net/Responce/SimpleResponce.dart';
export 'net/ALNetWork.dart';
import 'package:gmalpha_flutter/commonModel/base/Temp.dart';
import 'package:gmalpha_flutter/commonModel/sp/SpUtil.dart';
SpUtil spUtil=SpUtil.getInstance() as SpUtil;
......@@ -4,28 +4,57 @@
**/
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:gmalpha_flutter/res/GMRes.dart';
AppBar baseAppBar(
{String title, List<Widget> action, bool centerTitle, VoidCallback backClick}) {
{String title,
List<Widget> action,
bool centerTitle,
VoidCallback backClick}) {
return AppBar(
title: title == null ? Container() : baseText(title, 16, 0xff323232),
title: title == null ? Container() : baseText(title, 16, ALColors.Color323232),
centerTitle: centerTitle,
leading: GestureDetector(
onTap: backClick,
child: Center(
child: Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 22),
width: 30,
height: double.maxFinite,
child: SvgPicture.asset(
"images/left_arrow.svg",
color: Color(0xff323232),
)),
"images/left_arrow.svg",
color: Color(0xff323232),
)),
),
actions: action == null ? List<Widget>() : action,
);
}
Text baseText(String text, double fontSize, int color) {
Text baseText(String text, double fontSize, Color color) {
return Text(
text,
style: TextStyle(fontSize: fontSize, color: Color(color)),
style: TextStyle(fontSize: fontSize, color: color),
);
}
Widget baseDivide(double height, int padding, Color color) {
return Container(
height: height,
margin: EdgeInsets.only(
right: ScreenUtil.instance.setWidth(padding),
left: ScreenUtil.instance.setWidth(padding)),
child: Container(
color: color,
));
}
Widget loadingItem() {
//TODO
return Center(child: CircularProgressIndicator());
}
Widget netErrorItem() {}
//TODO
......@@ -5,8 +5,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/commonModel/base/Temp.dart';
import 'package:gmalpha_flutter/commonModel/cache/CacheManager.dart';
abstract class BasePage<T extends StatefulWidget> extends State<T> {
var startTime;
......
/*
* @author lsy
* @date 2019-09-24
**/
import 'package:flutter/material.dart';
abstract class BaseState<T extends StatefulWidget> extends State<T>{
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
}
\ No newline at end of file
......@@ -3,8 +3,14 @@
* @date 2019-10-14
**/
import 'dart:ui';
import 'package:flutter/material.dart';
double screenWidth = window.physicalSize.width;
double screenHeight = window.physicalSize.height;
void jumpToPage(Widget page, BuildContext context) {
Navigator.push(context, MaterialPageRoute(builder: ((context) {
return page;
......
/*
* @author lsy
* @date 2019-09-30
**/
import 'package:flutter/services.dart';
const platform = const MethodChannel('gengmei_flutter_native_channel');
class NativeChannel {
static void getNativeArguements() {
platform.invokeMethod("get_native_data").then((value) {
print("VALUE=-=");
});
}
}
......@@ -24,6 +24,7 @@ const String APP_HOST_DEV = "http://earth.alpha.newdev";
class Api {
static String BUILD_CONFIG;
static String PROVIDER_NAME;
static Api intance = new Api._();
......@@ -42,6 +43,7 @@ class Api {
return false;
}
BUILD_CONFIG = buildConfig;
PROVIDER_NAME = params["provider"];
String baseUrl = getBaseUrl(buildConfig) + "/";
if (baseUrl == null) {
return false;
......
import 'package:flutter/services.dart';
// flutter 埋点方案
class PhobosFlutter {
static const MethodChannel _channel =
const MethodChannel('phobos_flutter_plugin');
///
/// track
/// 灰度信息
///
/// @param GreyType 事件名.
///
/// 使用示例:
/// PhobosFlutter.getGreyType();
///
static Future<String> get getGreyType async {
return await _channel.invokeMethod('getGreyType');
}
///当前API
static Future<String> get getServerAPI async {
return await _channel.invokeMethod('getServerAPI');
}
/// signingType 包的类型
static Future<String> get getSigningType async {
return await _channel.invokeMethod('getServerAPI');
}
/// userId
static Future<String> get getUserId async {
return await _channel.invokeMethod('getUserId');
}
///
/// track
/// 事件追踪
///
/// @param eventName String 事件名.
/// @param properties Map<String,dynamic> 事件属性.
///
/// 使用示例:
/// PhobosFlutter.track('eventname',{'key1':'value1','key2':'value2'});
///
static void track(String eventName ,Map<String, dynamic> properties ) {
assert(eventName != null);
List<dynamic> params = [eventName,properties];
_channel.invokeMethod('track',params);
}
static void trackSendNow(String eventName ,Map<String, dynamic> properties ) {
assert(eventName != null);
List<dynamic> params = [eventName,properties];
_channel.invokeMethod('track',params);
}
}
\ No newline at end of file
//
// ALCommon
//
// gmalpha_flutter
// Created by lxrent on 2019/2/19.
// Copyright © 2019 Gengmei. All rights reserved.
//
import 'package:flutter/material.dart';
import 'ALColors.dart';
class ALAlphaButton extends FlatButton {
// factory ALAlphaButton
/// Create a simple text button.
const ALAlphaButton({
Key key,
@required VoidCallback onPressed,
ValueChanged<bool> onHighlightChanged,
ButtonTextTheme textTheme,
Color textColor,
Color disabledTextColor,
Color color,
Color disabledColor,
Color highlightColor,
Color splashColor,
double minWidth,
Brightness colorBrightness,
EdgeInsetsGeometry padding,
ShapeBorder shape,
Clip clipBehavior = Clip.none,
MaterialTapTargetSize materialTapTargetSize,
@required Widget child,
}) : super(
key: key,
onPressed: onPressed,
onHighlightChanged: onHighlightChanged,
textTheme: textTheme,
textColor: textColor,
disabledTextColor: disabledTextColor,
color: color,
disabledColor: disabledColor,
highlightColor: highlightColor,
splashColor: splashColor,
colorBrightness: colorBrightness,
padding: padding,
shape: shape,
clipBehavior: clipBehavior,
materialTapTargetSize: materialTapTargetSize,
child: child,
);
@override
Widget build(BuildContext context) {
// TODO: implement build
return FlatButton(
textTheme:textTheme,
padding: padding,
child: child,
onPressed: onPressed,
textColor: ALColors.Color323232,
highlightColor:ALColors.Color323232,
color: ALColors.ColorFFFFFF,
shape: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(0)),
borderSide: BorderSide(color: ALColors.Color323232)),
);
}
}
//
// ALDevice
//
// gm_alpha_flutter
// Created by lxrent on 2019/1/30.
// Copyright © 2019 Gengmei. All rights reserved.
//
import 'dart:ui';
class ALDevice {
ALDevice._();
static bool debug = !const bool.fromEnvironment("dart.vm.product");
static double width = window.physicalSize.width;
static double height = window.physicalSize.height;
}
\ No newline at end of file
......@@ -6,12 +6,11 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/Error_Page.dart';
import 'package:gmalpha_flutter/TestPage.dart';
import 'package:gmalpha_flutter/commonModel/app_module.dart';
import 'package:gmalpha_flutter/commonModel/base/Temp.dart';
import 'package:gmalpha_flutter/commonModel/cache/CacheManager.dart';
import 'package:gmalpha_flutter/commonModel/net/Api.dart';
import 'package:gmalpha_flutter/messageModel/home/message_home.dart';
import 'commonModel/GMBase.dart';
void main() {
initParams(() => runApp(MyApp()));
......@@ -106,5 +105,3 @@ class _MyAppState extends State<MyApp> {
print("PUSHED $pageName");
}
}
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/commonModel/ui/ALColors.dart';
import 'package:gmalpha_flutter/messageModel/model/message/message.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart';
class MessageNotificationItem extends StatelessWidget {
final NotificationItem notification;
......
/*
* @author lsy
* @date 2019-10-15
**/
library GMRes;
export 'anim/Anim.dart';
export 'value/ALColors.dart';
export 'value/ALFont.dart';
......@@ -11,7 +11,7 @@ class CustomRoute extends PageRouteBuilder{
CustomRoute(this.widget)
:super(
// 设置过度时间
transitionDuration:Duration(milliseconds: 500),
transitionDuration:Duration(milliseconds: 200),
// 构造器
pageBuilder:(
// 上下文和动画
......
......@@ -5,13 +5,13 @@ import 'dart:ui' show Color;
import 'package:flutter/painting.dart';
// 关于颜色的定义
// Color(0xFF323232);
// FF 表示透明度 323232 表示RGB颜色值
class ALColors {
ALColors._();
static const Color Color323232 = Color(0xFF323232);
static const Color Color464646 = Color(0xFF464646);
static const Color Color999999 = Color(0xFF999999);
......@@ -23,5 +23,4 @@ class ALColors {
static const Color ColorF4F3F8 = Color(0xFFf4f3f8);
static const Color Color282828 = Color(0xFF282828);
static const Color ColorE5E5E5 = Color(0xFFe5e5e5);
static const Color Color666666 = Color(0xFF666666);
}
\ No newline at end of file
}
/*
* @author lsy
* @date 2019-10-15
**/
const ST_SELECT_COUNTRY = "选择国家";
/*
* @author lsy
* @date 2019-09-04
**/
\ No newline at end of file
......@@ -11,10 +11,9 @@ import 'package:flutter_boost/flutter_boost.dart';
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseComponent.dart';
import 'package:gmalpha_flutter/commonModel/base/BasePage.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseState.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseUtil.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart';
import 'package:gmalpha_flutter/userModel/page/comment/CommentModel.dart';
import '../../../commonModel/ui/ALColors.dart';
import '../../../commonModel/ui/ALDevice.dart';
class CommentSuggestPage extends StatefulWidget {
var _model;
......@@ -105,7 +104,7 @@ class _CommentSuggestPageState extends BasePage<CommentSuggestPage> {
left: 30, right: 30, bottom: 30, top: 180),
// padding: EdgeInsets.all(0),
constraints:
BoxConstraints(minWidth: ALDevice.width, minHeight: 45),
BoxConstraints(minWidth: screenWidth, minHeight: 45),
child: FlatButton(
onPressed: () {
_model.confirmClick(
......
/*
* @author lsy
* @date 2019-10-16
**/
const STATIC_COUNTRY_JSON = """
{
"error": 0,
"message": "",
"extra": null,
"data": [
{
"title": "A",
"countries": [
{
"id": "America",
"name": "美国",
"language": "en"
},
{
"id": "Argentina",
"name": "阿根廷",
"language": "en"
},
{
"id": "Australia",
"name": "澳大利亚",
"language": "en"
}
]
},
{
"title": "B",
"countries": [
{
"id": "Belgium",
"name": "比利时",
"language": "en"
},
{
"id": "Brazil",
"name": "巴西",
"language": "en"
},
{
"id": "Brunei",
"name": "文莱",
"language": "en"
}
]
},
{
"title": "C",
"countries": [
{
"id": "Canada",
"name": "加拿大",
"language": "en"
},
{
"id": "china",
"name": "中国",
"language": "zh"
}
]
},
{
"title": "E",
"countries": [
{
"id": "Egypt",
"name": "埃及",
"language": "en"
},
{
"id": "England",
"name": "英国",
"language": "en"
}
]
},
{
"title": "F",
"countries": [
{
"id": "France",
"name": "法国",
"language": "fra"
}
]
},
{
"title": "H",
"countries": [
{
"id": "hanguo",
"name": "韩国",
"language": "kor"
}
]
},
{
"title": "I",
"countries": [
{
"id": "India",
"name": "印度",
"language": "en"
},
{
"id": "Indonesia",
"name": "印度尼西亚",
"language": "en"
},
{
"id": "Ireland",
"name": "爱尔兰",
"language": "en"
}
]
},
{
"title": "J",
"countries": [
{
"id": "Japan",
"name": "日本",
"language": "jp"
}
]
},
{
"title": "L",
"countries": [
{
"id": "Libya",
"name": "利比亚",
"language": "en"
}
]
},
{
"title": "M",
"countries": [
{
"id": "Malaysia",
"name": "马来西亚",
"language": "en"
},
{
"id": "Maldives",
"name": "马尔代夫",
"language": "en"
},
{
"id": "Mexico",
"name": "墨西哥",
"language": "en"
},
{
"id": "Morocco",
"name": "摩洛哥",
"language": "en"
}
]
},
{
"title": "N",
"countries": [
{
"id": "Netherlands",
"name": "荷兰",
"language": "en"
},
{
"id": "NewZealand",
"name": "新西兰",
"language": "en"
}
]
},
{
"title": "P",
"countries": [
{
"id": "Pakistan",
"name": "巴基斯坦",
"language": "en"
},
{
"id": "Paraguay",
"name": "巴拉圭",
"language": "en"
},
{
"id": "Portugal",
"name": "葡萄牙",
"language": "pt"
}
]
},
{
"title": "R",
"countries": [
{
"id": "Russia",
"name": "俄罗斯",
"language": "ru"
}
]
},
{
"title": "S",
"countries": [
{
"id": "singapore",
"name": "新加坡",
"language": "en"
},
{
"id": "Spain",
"name": "西班牙",
"language": "spa"
},
{
"id": "SriLanka",
"name": "斯里兰卡",
"language": "en"
}
]
},
{
"title": "T",
"countries": [
{
"id": "thailand",
"name": "泰国",
"language": "en"
}
]
},
{
"title": "U",
"countries": [
{
"id": "Uruguay",
"name": "乌拉圭",
"language": "en"
}
]
},
{
"title": "V",
"countries": [
{
"id": "Vietnam",
"name": "越南",
"language": "vie"
}
]
}
],
"user_type": {}
}
""";
/*
* @author lsy
* @date 2019-10-15
**/
import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:gmalpha_flutter/commonModel/GMBase.dart';
import 'package:gmalpha_flutter/commonModel/toast/toast.dart';
import 'package:gmalpha_flutter/userModel/page/country/CountryJson.dart';
import 'package:gmalpha_flutter/userModel/service/UserRepository.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/CountryBean.dart';
class CountryModel extends BaseModel {
LiveData<CountryBean> liveData = new LiveData();
final String refer;
String selectCity;
CountryModel(this.refer);
getCountries(BuildContext context) {
getStaticCountry().then((value) {
if (value != null) {
liveData.notifyView(value);
} else {
getCountryFromNet(context);
}
}).catchError((error) {
Toast.debugShow(context, error);
print(error);
});
}
getCountryFromNet(BuildContext context) {
UserRepository.getInstance().getCountries().listen((value) {
liveData.notifyView(value);
}).onError((error) {
Toast.debugShow(context, error);
print(error);
});
}
Future getStaticCountry() async {
return await CountryBean.fromJson(json.decode(STATIC_COUNTRY_JSON));
}
@override
void dispose() {
liveData.dispost();
}
}
/*
* @author lsy
* @date 2019-10-15
**/
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseComponent.dart';
import 'package:gmalpha_flutter/commonModel/base/BasePage.dart';
import 'package:gmalpha_flutter/res/GMRes.dart';
import 'package:gmalpha_flutter/userModel/page/country/CountryModel.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/CountryBean.dart';
class CountryPage extends StatefulWidget {
CountryModel _model;
CountryPage(String refer) {
_model = new CountryModel(refer);
}
@override
State<StatefulWidget> createState() => CountryState(_model);
}
class CountryState extends BasePage {
CountryModel _model;
CountryState(this._model);
ScrollController _scrollController = new ScrollController();
@override
void initState() {
super.initState();
_model.getCountries(context);
_scrollController.addListener(() {
print(
"lsyy ${_scrollController.positions} OFF ${_scrollController.offset}");
});
}
@override
Widget build(BuildContext context) {
ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
return Scaffold(
appBar: baseAppBar(
centerTitle: true,
title: "选择国家",
backClick: () {
Navigator.pop(context, _model.selectCity);
}),
body: StreamBuilder<CountryBean>(
stream: _model.liveData.stream,
initialData: _model.liveData.data,
builder: (con, data) {
if (data.data == null) {
return loadingItem();
} else {
return ListView.builder(
controller: _scrollController,
itemCount: data.data?.data?.length,
itemBuilder: (con, index) {
List<Widget> list = [];
list.add(headItem(data.data.data[index].title));
for (int i = 0;
i < data.data.data[index].countries.length;
i++) {
Countries countriy = data.data.data[index].countries[i];
list.add(countryItem(countriy));
}
return Column(
children: list,
);
});
}
},
),
);
}
headItem(String head) {
return Container(
color: Color(0x22000000),
alignment: Alignment.centerLeft,
height: ScreenUtil.instance.setHeight(25),
padding: EdgeInsets.only(
left: ScreenUtil.instance.setWidth(12),
),
child: baseText(head, 15, ALColors.Color323232),
);
}
countryItem(Countries country) {
return GestureDetector(
onTap: () {
Navigator.pop(context, country.name);
},
child: Container(
alignment: Alignment.centerLeft,
height: ScreenUtil.instance.setHeight(50),
margin: EdgeInsets.only(
left: ScreenUtil.instance.setWidth(12),
),
child: baseText(country.name, 15, ALColors.Color323232),
));
}
@override
void dispose() {
super.dispose();
_scrollController.dispose();
}
@override
String pageName() {
return "country_page";
}
@override
String referrer() {
return _model.refer;
}
}
......@@ -6,13 +6,16 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/commonModel/GMBase.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseUtil.dart';
import 'package:gmalpha_flutter/commonModel/live/BaseModel.dart';
import 'package:gmalpha_flutter/commonModel/net/Api.dart';
import 'package:gmalpha_flutter/commonModel/net/Responce/SimpleResponce.dart';
import 'package:gmalpha_flutter/commonModel/toast/toast.dart';
import 'package:gmalpha_flutter/userModel/service/UserRepository.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/UserEntity.user.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/UserResultBean.dart';
import 'package:gmalpha_flutter/userModel/util/JumpUtil.dart';
import '../../../commonModel/live/LiveData.dart';
......@@ -24,6 +27,7 @@ class UserSettingModel extends BaseModel {
final String userid;
final String refere;
String selectImgPath, defultName, defultCity;
UserSettingModel(this.userid, this.refere);
......@@ -36,6 +40,8 @@ class UserSettingModel extends BaseModel {
nameLive.notifyView(data?.data?.nickName);
cityLive.notifyView(data?.data?.countryInfo?.name);
headImgLive.notifyView(data?.data?.profilePic);
defultName = data?.data?.nickName;
defultCity = data?.data?.countryInfo?.name;
}).onError((error) {
print(error);
Toast.show(context, error);
......@@ -43,6 +49,7 @@ class UserSettingModel extends BaseModel {
} else {
UserEntityImpl().getnickName().listen((data) {
print("NICK $data");
defultName = data;
nameLive.notifyView(data);
}).onError((error) {
print(error);
......@@ -50,6 +57,7 @@ class UserSettingModel extends BaseModel {
});
UserEntityImpl().getcountryInfoName().listen((data) {
print("con $data");
defultCity = data;
cityLive.notifyView(data);
}).onError((error) {
print(error);
......@@ -66,6 +74,16 @@ class UserSettingModel extends BaseModel {
});
}
void detectUpdate() {
if (defultName != nameLive.data ||
defultCity != cityLive.data ||
selectImgPath != null) {
saveLive.notifyView(true);
} else {
saveLive.notifyView(false);
}
}
@override
void dispose() {
nameLive.dispost();
......@@ -73,4 +91,35 @@ class UserSettingModel extends BaseModel {
cityLive.dispost();
saveLive.dispost();
}
void jumpToCAM(BuildContext context, String pageName) {
clickEvent(pageName, "quit");
jumpToCamera(context, pageName, Api.PROVIDER_NAME, true, 1, null)
.then((value) {
if (value != null) {
selectImgPath = value[0];
headImgLive.notifyView(selectImgPath);
detectUpdate();
}
}).catchError((error) {
Toast.debugShow(context, error);
print(error);
});
}
void jumpToCTY(BuildContext context, String pageName) {
jumpToCountry(context, pageName).then((value) {
if (value != null) {
cityLive.notifyView(value);
detectUpdate();
}
}).catchError((error) {
Toast.debugShow(context, error);
print(error);
});
}
void quit(BuildContext context, String pageName) {
clickEvent(pageName, "quit");
}
}
......@@ -3,14 +3,18 @@
* @date 2019-09-04
**/
import 'dart:io';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:gmalpha_flutter/commonModel/GMBase.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseBuried.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseComponent.dart';
import 'package:gmalpha_flutter/commonModel/base/BasePage.dart';
import 'package:gmalpha_flutter/commonModel/net/Responce/SimpleResponce.dart';
import 'package:gmalpha_flutter/res/GMRes.dart';
import 'package:gmalpha_flutter/userModel/page/userSetting/UserSettingModel.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/TestUserEntity.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/UserEntity.dart';
......@@ -63,7 +67,7 @@ class UserState extends BasePage<UserSettingPage> {
padding: EdgeInsets.only(
right: ScreenUtil.instance.setWidth(30)),
child: Center(
child: baseText("保存", 14, 0xffC4C4C4),
child: baseText("保存", 14, ALColors.ColorC4C4C4),
),
);
} else {
......@@ -73,7 +77,7 @@ class UserState extends BasePage<UserSettingPage> {
padding: EdgeInsets.only(
right: ScreenUtil.instance.setWidth(30)),
child: Center(
child: baseText("保存", 14, 0xff323232),
child: baseText("保存", 14, ALColors.Color323232),
),
));
}
......@@ -86,18 +90,20 @@ class UserState extends BasePage<UserSettingPage> {
Container(
margin: EdgeInsets.fromLTRB(ScreenUtil.instance.setWidth(29),
ScreenUtil.instance.setWidth(25), 0, 0),
child: baseText("设置", 30, 0xff323232),
child: baseText("设置", 30, ALColors.Color323232),
),
Container(
width: ScreenUtil.instance.setWidth(127),
height: ScreenUtil.instance.setHeight(127),
height: ScreenUtil.instance.setWidth(127),
margin: EdgeInsets.fromLTRB(
ScreenUtil.instance.setWidth(26),
ScreenUtil.instance.setWidth(23),
0,
ScreenUtil.instance.setWidth(23)),
child: GestureDetector(
onTap: () {},
onTap: () {
_model.jumpToCAM(context, pageName());
},
child: Stack(
alignment: Alignment.bottomRight,
children: <Widget>[
......@@ -106,12 +112,26 @@ class UserState extends BasePage<UserSettingPage> {
initialData: _model.headImgLive.data,
builder: (con, data) {
if (data.data == null || data.data.isEmpty) {
return SvgPicture.asset("images/replace_head.svg");
// return SvgPicture.asset("images/replace_head.svg");
return Container();
} else {
return ClipOval(
child: CachedNetworkImage(
imageUrl: data.data,
));
startTime = DateTime.now().millisecondsSinceEpoch;
return Container(
alignment: Alignment.center,
width: ScreenUtil.instance.setWidth(127),
height: ScreenUtil.instance.setWidth(127),
child: ClipOval(
child: _model.selectImgPath == null
? CachedNetworkImage(
imageUrl: data.data,
)
: SizedBox(
height: double.maxFinite,
width: double.maxFinite,
child: Image.file(
File(data.data),
fit: BoxFit.cover,
))));
}
},
),
......@@ -131,14 +151,15 @@ class UserState extends BasePage<UserSettingPage> {
initialData: _model.nameLive.data,
builder: (con, data) {
return Center(
child: baseText(data.data ?? "", 13, 0xff323232),
child: baseText(data.data ?? "", 13, ALColors.Color323232),
);
},
),
false),
divideLine(),
baseItem(
() {},
baseDivide(1, 30, ALColors.ColorE4E4E4),
baseItem(() {
_model.jumpToCTY(context, pageName());
},
"国家",
StreamBuilder<String>(
stream: _model.cityLive.stream,
......@@ -147,18 +168,18 @@ class UserState extends BasePage<UserSettingPage> {
return Container(
margin: EdgeInsets.only(
right: ScreenUtil.instance.setWidth(19)),
child: baseText(data.data ?? "", 13, 0xff323232),
child: baseText(data.data ?? "", 13, ALColors.Color323232),
);
},
),
true),
divideLine(),
baseDivide(1, 30, ALColors.ColorE4E4E4),
baseItem(() {
jumpToComment(context, pageName());
}, "意见与建议", null, true),
divideLine(),
baseDivide(1, 30, ALColors.ColorE4E4E4),
baseItem(() {}, "隐私声明", null, true),
divideLine(),
baseDivide(1, 30, ALColors.ColorE4E4E4),
],
),
Expanded(
......@@ -172,8 +193,10 @@ class UserState extends BasePage<UserSettingPage> {
left: ScreenUtil.instance.setWidth(30),
right: ScreenUtil.instance.setWidth(30)),
child: OutlineButton(
onPressed: () {},
child: baseText("退出登入", 14, 0xff323232),
onPressed: () {
_model.quit(context, pageName());
},
child: baseText("退出登入", 14, ALColors.Color323232),
borderSide: new BorderSide(color: Color(0xff323232)),
),
)
......@@ -182,17 +205,6 @@ class UserState extends BasePage<UserSettingPage> {
);
}
divideLine() {
return Container(
height: 1,
margin: EdgeInsets.only(
right: ScreenUtil.instance.setWidth(30),
left: ScreenUtil.instance.setWidth(30)),
child: Container(
color: Color(0xffE4E4E4),
));
}
baseItem(VoidCallback ontap, String left, Widget center, bool needRight) {
return GestureDetector(
onTap: () => ontap(),
......@@ -201,11 +213,12 @@ class UserState extends BasePage<UserSettingPage> {
right: ScreenUtil.instance.setWidth(30),
left: ScreenUtil.instance.setWidth(30)),
height: 60,
width: double.maxFinite,
child: Row(
children: <Widget>[
baseText(left, 13, 0xff323232),
baseText(left, 13, ALColors.Color323232),
Expanded(
child: SizedBox(),
child: Text(""),
),
center ?? Container(),
needRight
......@@ -224,7 +237,7 @@ class UserState extends BasePage<UserSettingPage> {
@override
String pageName() {
return "TODO";
return "page_setting_up";
}
@override
......
......@@ -6,6 +6,7 @@ import 'package:gmalpha_flutter/commonModel/net/Responce/SimpleResponce.dart';
import 'package:gmalpha_flutter/userModel/service/local/UserLocal.dart';
import 'package:gmalpha_flutter/userModel/service/remote/UserRemote.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/CommentBean.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/CountryBean.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/TestUserEntity.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/UserEntity.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/UserEntity.user.dart';
......@@ -42,4 +43,8 @@ class UserRepository {
Observable<CommentBean> commentSuggest(String content, String phone) {
return _remote.commentSuggest(content, phone);
}
Observable<CountryBean> getCountries() {
return _remote.getCountrise();
}
}
......@@ -10,6 +10,8 @@ import 'package:gmalpha_flutter/userModel/service/remote/entity/UserEntity.dart'
import 'package:gmalpha_flutter/userModel/service/remote/entity/UserResultBean.dart';
import 'package:rxdart/rxdart.dart';
import 'entity/CountryBean.dart';
class UserRemote {
static UserRemote _userRemote;
......@@ -29,4 +31,8 @@ class UserRemote {
Observable<CommentBean> commentSuggest(String content, String phone) {
return UserApiImpl().comment(content, phone);
}
Observable<CountryBean> getCountrise() {
return UserApiImpl().getCountrys();
}
}
......@@ -8,6 +8,7 @@ import 'package:gmalpha_flutter/Annotations/anno/Query.dart';
import 'package:gmalpha_flutter/Annotations/anno/ServiceCenter.dart';
import 'package:gmalpha_flutter/commonModel/net/Responce/SimpleResponce.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/CommentBean.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/CountryBean.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/TestUserEntity.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/UserEntity.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/UserResultBean.dart';
......@@ -19,4 +20,7 @@ abstract class UserApi {
@Post("api/v1/suggestion")
CommentBean comment(@Query("content") String content, @Query("phone") String phone);
@Get("api/v1/countries")
CountryBean getCountrys();
}
......@@ -12,6 +12,7 @@ import 'package:rxdart/rxdart.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/UserResultBean.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/CommentBean.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/CountryBean.dart';
import 'package:gmalpha_flutter/commonModel/net/DioUtil.dart';
......@@ -48,4 +49,14 @@ class UserApiImpl {
}
});
}
Observable<CountryBean> getCountrys() {
return Observable.fromFuture(DioUtil().get('api/v1/countries'))
.map((value) {
if (value != null && value.statusCode == 200) {
Map map = json.decode(value.toString());
return CountryBean.fromJson(map);
}
});
}
}
/*
* @author lsy
* @date 2019-10-15
**/
class CountryBean {
int error;
String message;
Null extra;
List<Data> data;
UserType userType;
CountryBean({this.error, this.message, this.extra, this.data, this.userType});
CountryBean.fromJson(Map<String, dynamic> json) {
error = json['error'];
message = json['message'];
extra = json['extra'];
if (json['data'] != null) {
data = new List<Data>();
json['data'].forEach((v) {
data.add(new Data.fromJson(v));
});
}
userType = json['user_type'] != null
? new UserType.fromJson(json['user_type'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['error'] = this.error;
data['message'] = this.message;
data['extra'] = this.extra;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
if (this.userType != null) {
data['user_type'] = this.userType.toJson();
}
return data;
}
}
class Data {
String title;
List<Countries> countries;
Data({this.title, this.countries});
Data.fromJson(Map<String, dynamic> json) {
title = json['title'];
if (json['countries'] != null) {
countries = new List<Countries>();
json['countries'].forEach((v) {
countries.add(new Countries.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['title'] = this.title;
if (this.countries != null) {
data['countries'] = this.countries.map((v) => v.toJson()).toList();
}
return data;
}
}
class Countries {
String id;
String name;
String language;
Countries({this.id, this.name, this.language});
Countries.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
language = json['language'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['language'] = this.language;
return data;
}
}
class UserType {
UserType();
UserType.fromJson(Map<String, dynamic> json) {}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
return data;
}
}
......@@ -5,9 +5,23 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/res/anim/Anim.dart';
import 'package:gmalpha_flutter/userModel/page/comment/CommentSuggestPage.dart';
import 'package:gmalpha_flutter/userModel/page/country/CountryPage.dart';
void jumpToComment(BuildContext context, String refer) {
Navigator.push(context, new CustomRoute(CommentSuggestPage(refer)));
}
Future jumpToCamera(BuildContext context, String refer, String provider,
bool showCamera, int bigSelectImage, List<String> selectedImages) {
return Navigator.push(
context,
CustomRoute(RouterCenterImpl().findAlbumRouter()?.getAlbumPage(
provider, showCamera, bigSelectImage, selectedImages)));
}
Future jumpToCountry(BuildContext context, String refer) {
return Navigator.push(context, CustomRoute(CountryPage(refer)));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment