Commit 73b33eb7 authored by 关振斌's avatar 关振斌

ui

parent c08a5cd4
def localProperties = new Properties() def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties') def localPropertiesFile = rootProject.file('local.properties')
def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
if (localPropertiesFile.exists()) { if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader -> localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader) localProperties.load(reader)
...@@ -53,11 +58,23 @@ android { ...@@ -53,11 +58,23 @@ android {
versionName flutterVersionName versionName flutterVersionName
} }
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes { buildTypes {
release { release {
signingConfig signingConfigs.debug
// signingConfig signingConfigs.release //TODO
// TODO: Add your own signing config for the release build. // TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works. // Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug //
} }
} }
} }
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.chart"> package="com.example.chart">
<application <application
android:label="chart" android:label="哈哈GPT"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
<activity <activity
......
PODS: PODS:
- babstrap_settings_screen (0.0.1):
- Flutter
- DKImagePickerController/Core (4.3.4): - DKImagePickerController/Core (4.3.4):
- DKImagePickerController/ImageDataManager - DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource - DKImagePickerController/Resource
...@@ -68,6 +70,7 @@ PODS: ...@@ -68,6 +70,7 @@ PODS:
- Flutter - Flutter
DEPENDENCIES: DEPENDENCIES:
- babstrap_settings_screen (from `.symlinks/plugins/babstrap_settings_screen/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_icmp_ping (from `.symlinks/plugins/flutter_icmp_ping/ios`) - flutter_icmp_ping (from `.symlinks/plugins/flutter_icmp_ping/ios`)
...@@ -90,6 +93,8 @@ SPEC REPOS: ...@@ -90,6 +93,8 @@ SPEC REPOS:
- Toast - Toast
EXTERNAL SOURCES: EXTERNAL SOURCES:
babstrap_settings_screen:
:path: ".symlinks/plugins/babstrap_settings_screen/ios"
file_picker: file_picker:
:path: ".symlinks/plugins/file_picker/ios" :path: ".symlinks/plugins/file_picker/ios"
Flutter: Flutter:
...@@ -114,6 +119,7 @@ EXTERNAL SOURCES: ...@@ -114,6 +119,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios" :path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
babstrap_settings_screen: 535097da0fa521a47fef6f6678ff2b464ee15937
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: ce3938a0df3cc1ef404671531facef740d03f920 file_picker: ce3938a0df3cc1ef404671531facef740d03f920
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 50; objectVersion = 51;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
...@@ -76,7 +76,6 @@ ...@@ -76,7 +76,6 @@
7D6639346FF91128A24F59F3 /* Pods-Runner.release.xcconfig */, 7D6639346FF91128A24F59F3 /* Pods-Runner.release.xcconfig */,
46027BF48CA7E236D802579A /* Pods-Runner.profile.xcconfig */, 46027BF48CA7E236D802579A /* Pods-Runner.profile.xcconfig */,
); );
name = Pods;
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
...@@ -359,11 +358,13 @@ ...@@ -359,11 +358,13 @@
DEVELOPMENT_TEAM = Z99J24WADU; DEVELOPMENT_TEAM = Z99J24WADU;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "GPT大师傅";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.chart; MARKETING_VERSION = 3;
PRODUCT_BUNDLE_IDENTIFIER = com.wudi.app;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
...@@ -488,11 +489,13 @@ ...@@ -488,11 +489,13 @@
DEVELOPMENT_TEAM = Z99J24WADU; DEVELOPMENT_TEAM = Z99J24WADU;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "GPT大师傅";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.chart; MARKETING_VERSION = 3;
PRODUCT_BUNDLE_IDENTIFIER = com.wudi.app;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
...@@ -511,11 +514,13 @@ ...@@ -511,11 +514,13 @@
DEVELOPMENT_TEAM = Z99J24WADU; DEVELOPMENT_TEAM = Z99J24WADU;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "GPT大师傅";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.chart; MARKETING_VERSION = 3;
PRODUCT_BUNDLE_IDENTIFIER = com.wudi.app;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
......
...@@ -2,10 +2,14 @@ ...@@ -2,10 +2,14 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSPhotoLibraryUsageDescription</key>
<string>需要相册权限发送图片</string>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>Chart</string> <string>哈哈GPT</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
...@@ -24,6 +28,8 @@ ...@@ -24,6 +28,8 @@
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
...@@ -43,9 +49,5 @@ ...@@ -43,9 +49,5 @@
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false/> <false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict> </dict>
</plist> </plist>
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:ui';
class AppColors { class AppColors {
static const MaterialColor themeColor = Colors.amber; static const MaterialColor themeColor = Colors.amber;
static const MaterialColor themeColorGreen = Colors.green;
// greenColor
// 0xFFfbd033
// rgba(87, 197, 158, 1.00)
static const Color yellowColor = Color(0xFFfbd033); static const Color yellowColor = Color(0xFFfbd033);
static const Color greenColor = Color(0xFF57C59E);
static const Color grayColor = Color(0xFF2d2d2d); static const Color grayColor = Color(0xFF2d2d2d);
static const Color darkSurfaceColor = Color(0xff373737); static const Color darkSurfaceColor = Color(0xff373737);
static const Color listBgColor = Color.fromRGBO(246, 248, 247, 1.00);
//
static const Color color1 = Color(0xffFFCA8C);
static const Color color2 = Color(0xff5DF9D3);
static const Color color3 = Color(0xff85E4FD);
static const Color color4 = Color(0xffB8ACFF);
//
static const Color color5 = Color(0xffFEA741);
static const Color color6 = Color(0xff31DFB5);
static const Color color7 = Color(0xff45BAFB);
static const Color color8 = Color(0xff9182F9);
} }
// const List<Color> kCategoriesPrimaryColor = [
// Color(0xffFFCA8C),
// Color(0xff5DF9D3),
// Color(0xff85E4FD),
// Color(0xffB8ACFF)
// ];
// const List<Color> kCategoriesSecondryColor = [
// Color(0xffFEA741),
// Color(0xff31DFB5),
// Color(0xff45BAFB),
// Color(0xff9182F9)
// ];
// //调用的时候需要把hex改一下,比如#223344 needs change to 0xFF223344
// //即把#换成0xFF即可
// MaterialColor createMaterialColor(Color color) {
// List strengths = <double>[.05];
// Map swatch = <int, Color>{};
// final int r = color.red, g = color.green, b = color.blue;
// for (int i = 1; i < 10; i++) {
// strengths.add(0.1 * i);
// }
// strengths.forEach((strength) {
// final double ds = 0.5 - strength;
// swatch[(strength * 1000).round()] = Color.fromRGBO(
// r + ((ds < 0 ? r : (255 - r)) * ds).round(),
// g + ((ds < 0 ? g : (255 - g)) * ds).round(),
// b + ((ds < 0 ? b : (255 - b)) * ds).round(),
// 1,
// );
// });
// return MaterialColor(color.value, swatch);
// }
\ No newline at end of file
class AppUrls { class AppUrls {
static const String baseUrl = 'http://1.12.240.104:8081'; // 基础接口地址 static const String baseUrl = 'http://192.168.2.178:8083'; // 基础接口地址
static const String baseApiUrl = '$baseUrl'; // 基础接口地址 static const String baseApiUrl = '${baseUrl}/api'; // 基础接口地址
static const String login = '$baseApiUrl/passport/auth/login'; // static const String login = '$baseApiUrl/passport/auth/login';
static const String register = '$baseApiUrl/passport/auth/register'; // static const String register = '$baseApiUrl/passport/auth/register';
static const String getQuickLoginUrl = // static const String getQuickLoginUrl =
'$baseApiUrl/passport/auth/getQuickLoginUrl'; // '$baseApiUrl/passport/auth/getQuickLoginUrl';
static const String userSubscribe = '$baseApiUrl/user/getSubscribe'; // static const String userSubscribe = '$baseApiUrl/user/getSubscribe';
static const String plan = '$baseApiUrl/guest/plan/fetch'; // static const String plan = '$baseApiUrl/guest/plan/fetch';
static const String server = '$baseApiUrl/user/server/fetch'; // static const String server = '$baseApiUrl/user/server/fetch';
static const String userInfo = '$baseApiUrl/user/info'; // static const String userInfo = '$baseApiUrl/user/info';
static const String message = '$baseApiUrl/openAi/aiAnswer'; static const String message = '$baseApiUrl/openAi/aiAnswer';
// /api/hotSearch/getHotSearch
static const String getMessageList = '$baseApiUrl/hotSearch/getHotSearch';
static const String getUserIntegral = '$baseApiUrl/user/getUserIntegral';
static const String getSearchRecord =
'$baseApiUrl/searchRecord/getSearchRecord';
} }
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
import 'dart:convert'; import 'dart:convert';
List<PlanEntity> planEntityFromList(List data) => List<PlanEntity>.from(data.map((x) => PlanEntity.fromMap(x))); List<PlanEntity> planEntityFromList(List data) =>
List<PlanEntity>.from(data.map((x) => PlanEntity.fromMap(x)));
class PlanEntity { class PlanEntity {
PlanEntity({ PlanEntity({
...@@ -48,7 +49,8 @@ class PlanEntity { ...@@ -48,7 +49,8 @@ class PlanEntity {
final DateTime? createdAt; final DateTime? createdAt;
final DateTime? updatedAt; final DateTime? updatedAt;
factory PlanEntity.fromJson(String str) => PlanEntity.fromMap(json.decode(str)); factory PlanEntity.fromJson(String str) =>
PlanEntity.fromMap(json.decode(str));
String toJson() => json.encode(toMap()); String toJson() => json.encode(toMap());
...@@ -69,8 +71,12 @@ class PlanEntity { ...@@ -69,8 +71,12 @@ class PlanEntity {
threeYearPrice: json["three_year_price"], threeYearPrice: json["three_year_price"],
onetimePrice: json["onetime_price"], onetimePrice: json["onetime_price"],
resetPrice: json["reset_price"], resetPrice: json["reset_price"],
createdAt: json["created_at"] == null ? null : DateTime.fromMillisecondsSinceEpoch(json["created_at"] * 1000), createdAt: json["created_at"] == null
updatedAt: json["updated_at"] == null ? null : DateTime.fromMillisecondsSinceEpoch(json["updated_at"] * 1000), ? null
: DateTime.fromMillisecondsSinceEpoch(json["created_at"] * 1000),
updatedAt: json["updated_at"] == null
? null
: DateTime.fromMillisecondsSinceEpoch(json["updated_at"] * 1000),
); );
Map<String, dynamic> toMap() => { Map<String, dynamic> toMap() => {
...@@ -90,7 +96,41 @@ class PlanEntity { ...@@ -90,7 +96,41 @@ class PlanEntity {
"three_year_price": threeYearPrice, "three_year_price": threeYearPrice,
"onetime_price": onetimePrice, "onetime_price": onetimePrice,
"reset_price": resetPrice, "reset_price": resetPrice,
"created_at": createdAt == null ? null : createdAt!.millisecondsSinceEpoch ~/ 1000, "created_at": createdAt == null
"updated_at": updatedAt == null ? null : updatedAt!.millisecondsSinceEpoch ~/ 1000, ? null
: createdAt!.millisecondsSinceEpoch ~/ 1000,
"updated_at": updatedAt == null
? null
: updatedAt!.millisecondsSinceEpoch ~/ 1000,
}; };
} }
class MessageEntity {
MessageEntity({
required this.id,
required this.question,
required this.createTime,
required this.resp,
});
final int id;
final String question;
final String createTime;
final String resp;
factory MessageEntity.fromJson(String str) =>
MessageEntity.fromMap(json.decode(str));
String toJson() => json.encode(toMap());
factory MessageEntity.fromMap(Map<String, dynamic> json) => MessageEntity(
id: json["id"],
question: json["question"],
createTime: json["createTime"],
resp: json['resp']);
Map<String, dynamic> toMap() =>
{"id": id, "question": question, "createTime": createTime, "resp": resp};
}
List<MessageEntity> messageEntityFromList(List data) =>
List<MessageEntity>.from(data.map((x) => MessageEntity.fromMap(x)));
// To parse this JSON data, do
//
// final SearchRecordEntity = SearchRecordEntityFromMap(jsonString);
import 'dart:ffi';
import 'package:meta/meta.dart';
import 'dart:convert';
class SearchRecordEntity {
SearchRecordEntity({
required this.userId,
required this.answer,
required this.question,
required this.id,
required this.createTime,
});
final int id;
final String createTime;
final String userId;
final String answer;
final String question;
factory SearchRecordEntity.fromJson(String str) =>
SearchRecordEntity.fromMap(json.decode(str));
String toJson() => json.encode(toMap());
factory SearchRecordEntity.fromMap(Map<String, dynamic> json) =>
SearchRecordEntity(
id: json["id"],
createTime: json["createTime"],
userId: json['userId'],
answer: json['answer'],
question: json['question'],
);
Map<String, dynamic> toMap() => {
"id": id,
"createTime": createTime,
"question": question,
"answer": answer,
"userId": userId
};
}
List<SearchRecordEntity> searchRecordEntityFromList(List data) =>
List<SearchRecordEntity>.from(
data.map((x) => SearchRecordEntity.fromMap(x)));
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// //
// final userEntity = userEntityFromMap(jsonString); // final userEntity = userEntityFromMap(jsonString);
import 'dart:ffi';
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
import 'dart:convert'; import 'dart:convert';
...@@ -42,19 +44,26 @@ class UserEntity { ...@@ -42,19 +44,26 @@ class UserEntity {
final String uuid; final String uuid;
final String avatarUrl; final String avatarUrl;
factory UserEntity.fromJson(String str) => UserEntity.fromMap(json.decode(str)); factory UserEntity.fromJson(String str) =>
UserEntity.fromMap(json.decode(str));
String toJson() => json.encode(toMap()); String toJson() => json.encode(toMap());
factory UserEntity.fromMap(Map<String, dynamic> json) => UserEntity( factory UserEntity.fromMap(Map<String, dynamic> json) => UserEntity(
email: json["email"], email: json["email"],
transferEnable: json["transfer_enable"], transferEnable: json["transfer_enable"],
lastLoginAt: json["last_login_at"] == null ? null : DateTime.fromMillisecondsSinceEpoch(json["last_login_at"] * 1000), lastLoginAt: json["last_login_at"] == null
createdAt: json["created_at"] == null ? null : DateTime.fromMillisecondsSinceEpoch(json["created_at"] * 1000), ? null
: DateTime.fromMillisecondsSinceEpoch(json["last_login_at"] * 1000),
createdAt: json["created_at"] == null
? null
: DateTime.fromMillisecondsSinceEpoch(json["created_at"] * 1000),
banned: json["banned"], banned: json["banned"],
remindExpire: json["remind_expire"], remindExpire: json["remind_expire"],
remindTraffic: json["remind_traffic"], remindTraffic: json["remind_traffic"],
expiredAt: json["expired_at"] == null ? null : DateTime.fromMillisecondsSinceEpoch(json["expired_at"] * 1000), expiredAt: json["expired_at"] == null
? null
: DateTime.fromMillisecondsSinceEpoch(json["expired_at"] * 1000),
balance: json["balance"], balance: json["balance"],
commissionBalance: json["commission_balance"], commissionBalance: json["commission_balance"],
planId: json["plan_id"], planId: json["plan_id"],
...@@ -68,12 +77,18 @@ class UserEntity { ...@@ -68,12 +77,18 @@ class UserEntity {
Map<String, dynamic> toMap() => { Map<String, dynamic> toMap() => {
"email": email, "email": email,
"transfer_enable": transferEnable, "transfer_enable": transferEnable,
"last_login_at": lastLoginAt == null ? null : lastLoginAt!.millisecondsSinceEpoch ~/ 1000, "last_login_at": lastLoginAt == null
"created_at": createdAt == null ? null : createdAt!.millisecondsSinceEpoch ~/ 1000, ? null
: lastLoginAt!.millisecondsSinceEpoch ~/ 1000,
"created_at": createdAt == null
? null
: createdAt!.millisecondsSinceEpoch ~/ 1000,
"banned": banned, "banned": banned,
"remind_expire": remindExpire, "remind_expire": remindExpire,
"remind_traffic": remindTraffic, "remind_traffic": remindTraffic,
"expired_at": expiredAt == null ? null : expiredAt!.millisecondsSinceEpoch ~/ 1000, "expired_at": expiredAt == null
? null
: expiredAt!.millisecondsSinceEpoch ~/ 1000,
"balance": balance, "balance": balance,
"commission_balance": commissionBalance, "commission_balance": commissionBalance,
"plan_id": planId, "plan_id": planId,
...@@ -84,3 +99,22 @@ class UserEntity { ...@@ -84,3 +99,22 @@ class UserEntity {
"avatar_url": avatarUrl, "avatar_url": avatarUrl,
}; };
} }
class IntegralEntity {
IntegralEntity({required this.id, required this.username});
final int id;
final String username;
factory IntegralEntity.fromJson(String str) =>
IntegralEntity.fromMap(json.decode(str));
String toJson() => json.encode(toMap());
factory IntegralEntity.fromMap(Map<String, dynamic> json) => IntegralEntity(
id: json["id"],
username: json["username"],
);
Map<String, dynamic> toMap() => {"isd": id, "username": username};
}
...@@ -9,16 +9,22 @@ import 'package:chart/constant/app_colors.dart'; ...@@ -9,16 +9,22 @@ import 'package:chart/constant/app_colors.dart';
import 'package:chart/constant/app_strings.dart'; import 'package:chart/constant/app_strings.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; //国际化 import 'package:flutter_localizations/flutter_localizations.dart'; //国际化
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'dart:ui';
import 'models/user_model.dart';
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
var appModel = AppModel(); var appModel = AppModel();
// var userViewModel = UserModel(); var userViewModel = UserModel();
// var userSubscribeModel = UserSubscribeModel(); // var userSubscribeModel = UserSubscribeModel();
// var serverModel = ServerModel(); // var serverModel = ServerModel();
// var planModel = PlanModel(); // var planModel = PlanModel();
runApp(MultiProvider(providers: [ runApp(MultiProvider(providers: [
ChangeNotifierProvider<AppModel>.value(value: appModel), ChangeNotifierProvider<AppModel>.value(value: appModel),
// ChangeNotifierProvider<UserModel>.value(value: userViewModel), ChangeNotifierProvider<UserModel>.value(value: userViewModel),
// ChangeNotifierProvider<UserSubscribeModel>.value(value: userSubscribeModel), // ChangeNotifierProvider<UserSubscribeModel>.value(value: userSubscribeModel),
// ChangeNotifierProvider<ServerModel>.value(value: serverModel), // ChangeNotifierProvider<ServerModel>.value(value: serverModel),
// ChangeNotifierProvider<PlanModel>.value(value: planModel) // ChangeNotifierProvider<PlanModel>.value(value: planModel)
...@@ -48,8 +54,10 @@ class ChartApp extends StatelessWidget { ...@@ -48,8 +54,10 @@ class ChartApp extends StatelessWidget {
onGenerateRoute: Application.router?.generator, onGenerateRoute: Application.router?.generator,
localizationsDelegates: const [ localizationsDelegates: const [
// 本地化的代理类 // 本地化的代理类
RefreshLocalizations.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate //复制
], ],
supportedLocales: const [ supportedLocales: const [
Locale('en', 'US'), // 美国英语 Locale('en', 'US'), // 美国英语
...@@ -57,8 +65,33 @@ class ChartApp extends StatelessWidget { ...@@ -57,8 +65,33 @@ class ChartApp extends StatelessWidget {
//其它Locales //其它Locales
], ],
theme: ThemeData( theme: ThemeData(
primarySwatch: AppColors.themeColor, // Color(0xff9182F9)
primarySwatch: createMaterialColor(const Color(0xff9182F9)),
// AppColors.themeColorGreen,
visualDensity: VisualDensity.adaptivePlatformDensity), visualDensity: VisualDensity.adaptivePlatformDensity),
); );
} }
} }
//调用的时候需要把hex改一下,比如#223344 needs change to 0xFF223344
//即把#换成0xFF即可
MaterialColor createMaterialColor(Color color) {
List strengths = <double>[.05];
Map<int, Color> swatch = {};
final int r = color.red, g = color.green, b = color.blue;
for (int i = 1; i < 10; i++) {
strengths.add(0.1 * i);
}
strengths.forEach((strength) {
final double ds = 0.5 - strength;
swatch[(strength * 1000).round()] = Color.fromRGBO(
r + ((ds < 0 ? r : (255 - r)) * ds).round(),
g + ((ds < 0 ? g : (255 - g)) * ds).round(),
b + ((ds < 0 ? b : (255 - b)) * ds).round(),
1,
);
});
return MaterialColor(color.value, swatch);
}
...@@ -4,6 +4,8 @@ import 'package:chart/entity/user_entity.dart'; ...@@ -4,6 +4,8 @@ import 'package:chart/entity/user_entity.dart';
import 'package:chart/models/base_model.dart'; import 'package:chart/models/base_model.dart';
import 'package:chart/utils/navigator_util.dart'; import 'package:chart/utils/navigator_util.dart';
import 'package:chart/utils/shared_preferences_util.dart'; import 'package:chart/utils/shared_preferences_util.dart';
import "package:chart/service/user_service.dart";
// import '';
class UserModel extends BaseModel { class UserModel extends BaseModel {
late String _token; late String _token;
...@@ -11,12 +13,15 @@ class UserModel extends BaseModel { ...@@ -11,12 +13,15 @@ class UserModel extends BaseModel {
late UserEntity? _userEntity; late UserEntity? _userEntity;
late bool _isFirstOpen; late bool _isFirstOpen;
bool _isLogin = false; bool _isLogin = false;
late IntegralEntity? _integralEntity;
final UserService _userService = UserService();
String get token => _token; String get token => _token;
String get authData => _authData; String get authData => _authData;
UserEntity? get userEntity => _userEntity; UserEntity? get userEntity => _userEntity;
bool get isFirstOpen => _isFirstOpen; bool get isFirstOpen => _isFirstOpen;
bool get isLogin => _isLogin; bool get isLogin => _isLogin;
IntegralEntity? get integralEntity => _integralEntity;
Future<void> checkHasLogin(context, Function callback) async { Future<void> checkHasLogin(context, Function callback) async {
if (!isLogin) { if (!isLogin) {
...@@ -113,4 +118,9 @@ class UserModel extends BaseModel { ...@@ -113,4 +118,9 @@ class UserModel extends BaseModel {
_saveUserInfo(); _saveUserInfo();
} }
setIntegralInfo() async {
final integralEntity = await _userService.getUserIntegral();
_integralEntity = integralEntity;
}
} }
This diff is collapsed.
import 'package:flutter/material.dart';
// import '../size_confige.dart';
class DoctorAppBar extends StatelessWidget {
const DoctorAppBar({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
// height: 300,
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(left: 20, top: 60, right: 20, bottom: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Hi, 客户one",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w800,
fontSize: 20),
),
SizedBox(height: 30),
Text(
"欢迎使用哈哈GPT,你可以收获很多",
style: TextStyle(color: Colors.white, fontSize: 12),
),
],
),
Container(
height: 60,
width: 60,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
blurRadius: 3,
offset: Offset(0, 4),
color: Colors.black54,
)
],
color: Color(0xffA295FD),
borderRadius: BorderRadius.circular(5)),
child: ClipRRect(
borderRadius: BorderRadius.circular(5),
child: Image.asset("assets/images/doctor_1.png")),
)
],
),
),
);
}
}
This diff is collapsed.
import 'package:flutter/material.dart';
const kLightTextColor = Color(0xffB5C8E7);
const kHardTextColor = Color(0xff586191);
const kPrimaryDarkColor = Color(0xff46BDFA);
const kPrimarylightColor = Color(0xff77E2FE);
const kBackgroundColor = Color(0xffEFF2F7);
const List<Color> kCategoriesPrimaryColor = [
Color(0xffFFCA8C),
Color(0xff5DF9D3),
Color(0xff85E4FD),
Color(0xffB8ACFF)
];
const List<Color> kCategoriesSecondryColor = [
Color(0xffFEA741),
Color(0xff31DFB5),
Color(0xff45BAFB),
Color(0xff9182F9)
];
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:glass_kit/glass_kit.dart';
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'dart:math';
const List<Color> kCategoriesPrimaryColor = [
Color(0xffFFCA8C),
Color(0xff5DF9D3),
Color(0xff85E4FD),
Color(0xffB8ACFF)
];
const List<Color> kCategoriesSecondryColor = [
Color(0xffFEA741),
Color(0xff31DFB5),
Color(0xff45BAFB),
Color(0xff9182F9)
];
class Doctor {
final String name, speciality, image;
final int reviews;
final int reviewScore;
Doctor(
{required this.name,
required this.speciality,
required this.image,
required this.reviews,
required this.reviewScore});
}
final doctorsList = [
Doctor(
name: "通用型",
speciality: "通用聊天",
image: "assets/images/doctor_1.png",
reviews: 80,
reviewScore: 4),
Doctor(
name: "英汉互译",
speciality: "翻译高手",
image: "assets/images/doctor_2.png",
reviews: 67,
reviewScore: 5),
Doctor(
name: "面试官",
speciality: "谷歌面试官帮你面试",
image: "assets/images/doctor_3.png",
reviews: 19,
reviewScore: 4),
Doctor(
name: "知音",
speciality: "最懂你的女生",
image: "assets/images/doctor_2.png",
reviews: 19,
reviewScore: 5),
];
const kLightTextColor = Color(0xffB5C8E7);
const kHardTextColor = Color(0xff586191);
const kPrimaryDarkColor = Color(0xff46BDFA);
const kPrimarylightColor = Color(0xff77E2FE);
const kBackgroundColor = Color(0xffEFF2F7);
// import 'package:flutter_rating_bar/flutter_rating_bar.dart';
class ListPage extends StatefulWidget {
@override
ListPageState createState() => ListPageState();
}
class ListPageState extends State<ListPage> {
final controller = PageController(viewportFraction: 0.8, keepPage: true);
// final List<BankCardModel> cards = [
// BankCardModel('assets/images/bg_red_card.png', 'Hoang Cuu Long',
// '4221 5168 7464 2283', '08/20', 10000000),
// BankCardModel('assets/images/bg_blue_circle_card.png', 'Hoang Cuu Long',
// '4221 5168 7464 2283', '08/20', 10000000),
// BankCardModel('assets/images/bg_purple_card.png', 'Hoang Cuu Long',
// '4221 5168 7464 2283', '08/20', 10000000),
// BankCardModel('assets/images/bg_blue_card.png', 'Hoang Cuu Long',
// '4221 5168 7464 2283', '08/20', 10000000),
// ];
@override
Widget build(BuildContext context) {
// TODO: implement build
// final color = kCategoriesSecondryColor[
// (kCategoriesSecondryColor.length - index - 1)];
// final circleColor = kCategoriesPrimaryColor[
// (kCategoriesPrimaryColor.length - index - 1)];
// final cardWidth = getRelativeWidth(0.48);
return Container(
margin: const EdgeInsets.symmetric(vertical: 20.0),
height: 80.0,
child: ListView(
// This next line does the trick.
scrollDirection: Axis.horizontal,
children: List.generate(
4,
(index) => Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GlassmorphicContainer(
width: 200,
height: 180.0,
borderRadius: 16,
padding: EdgeInsets.only(bottom: 16),
blur: 14,
alignment: Alignment.bottomCenter,
border: 2,
linearGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF0FFFF).withOpacity(0.2),
Color(0xFF0FFFF).withOpacity(0.2),
],
),
borderGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF0FFFF).withOpacity(1),
Color(0xFFFFFFF),
Color(0xFF0FFFF).withOpacity(1),
],
),
child: Container(
height: 180.0,
width: 200.0,
constraints: BoxConstraints(minWidth: 41),
decoration: BoxDecoration(
// color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 14),
child: Row(
children: [
Container(
padding: EdgeInsets.all(14),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
kCategoriesPrimaryColor[index],
kCategoriesSecondryColor[index],
],
),
borderRadius: BorderRadius.circular(16)),
child: Icon(
Icons.headset_mic,
size: 20,
color: Colors.white,
),
),
SizedBox(width: 11),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"写文案",
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
SizedBox(height: 5),
Text(
" 例如述职报告等",
style: TextStyle(
color: Colors.white, fontSize: 12),
),
],
),
],
),
),
)),
SizedBox(width: 20)
],
),
),
),
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_chat_ui/flutter_chat_ui.dart';
// import 'package:line_icons/line_icons.dart';
// import './size_confige.dart';
class SearchField extends StatelessWidget {
SearchField({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
height: 200,
child: Center(
child: TextField(
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 20),
fillColor: Colors.white,
filled: true,
hintText: "Search Doctor",
hintStyle: TextStyle(
fontSize: 12,
color: Colors.blueGrey.withOpacity(0.9),
),
// prefixIcon:
// Icon(
// LineIcons.search,
// color: Colors.blueGrey.withOpacity(0.9),
// size: getRelativeWidth(0.065),
// ),
suffixIcon: Padding(
padding: EdgeInsets.symmetric(horizontal: 30),
child: Container(
width: 100,
height: 60,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Color(0xffFBA473), Color(0xffFA7A30)]),
borderRadius: BorderRadius.circular(25),
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Filter",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 20),
),
Icon(
Icons.filter_list,
color: Colors.white,
size: 20,
)
],
),
),
),
),
border: outlineBorder,
enabledBorder: outlineBorder,
focusedBorder: outlineBorder),
),
),
);
}
final outlineBorder = OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(30),
);
}
import 'package:flutter/material.dart';
class SizeConfig {
static double screenWidth = double.infinity;
static double screenHeight = 550;
static initSize(BuildContext context) {
final mediaQuery = MediaQuery.of(context);
screenWidth = mediaQuery.size.width;
screenHeight = mediaQuery.size.height;
}
}
double getRelativeHeight(double percentage) {
return percentage * SizeConfig.screenHeight;
}
double getRelativeWidth(double percentage) {
return percentage * SizeConfig.screenWidth;
}
This diff is collapsed.
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:card_swiper/card_swiper.dart';
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'dart:math';
const List<Color> kCategoriesPrimaryColor = [
Color(0xffFFCA8C),
Color(0xff5DF9D3),
Color(0xff85E4FD),
Color(0xffB8ACFF)
];
const List<Color> kCategoriesSecondryColor = [
Color(0xffFEA741),
Color(0xff31DFB5),
Color(0xff45BAFB),
Color(0xff9182F9)
];
class Doctor {
final String name, speciality, image;
final int reviews;
final int reviewScore;
Doctor(
{required this.name,
required this.speciality,
required this.image,
required this.reviews,
required this.reviewScore});
}
const kLightTextColor = Color(0xffB5C8E7);
const kHardTextColor = Color(0xff586191);
const kPrimaryDarkColor = Color(0xff46BDFA);
const kPrimarylightColor = Color(0xff77E2FE);
const kBackgroundColor = Color(0xffEFF2F7);
// import 'package:flutter_rating_bar/flutter_rating_bar.dart';
class SwiperColunmPage extends StatefulWidget {
@override
SwiperColunmPageState createState() => SwiperColunmPageState();
}
class SwiperColunmPageState extends State<SwiperColunmPage> {
final controller = PageController(viewportFraction: 0.8, keepPage: true);
@override
Widget build(BuildContext context) {
// TODO: implement build
return Container(
height: 200,
child: Swiper(
// scrollDirection: Axis.vertical,
autoplay: true,
itemBuilder: (BuildContext context, int index) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: Colors.black.withAlpha(0),
// Color.fromRGBO(69, 185, 251, 1.00),
// rgba(69, 185, 251, 1.00)
),
child: ClipRRect(
borderRadius: BorderRadius.circular(16),
child: Image.network(
"https://img14.360buyimg.com/babel/s700x360_jfs/t1/4099/12/2578/101668/5b971b4bE65ae279d/89dd1764797acfd9.jpg!q90!cc_350x180",
fit: BoxFit.cover,
),
));
},
viewportFraction: 0.8,
scale: 0.9,
// layout: SwiperLayout.CUSTOM,
// customLayoutOption: CustomLayoutOption(startIndex: -1, stateCount: 3)
// ..addRotate([-45.0 / 180, 0.0, 45.0 / 180])
// ..addTranslate(
// [Offset(-370.0, -40.0), Offset(0.0, 0.0), Offset(370.0, -40.0)]),
// itemWidth: 300.0,
// itemHeight: 200.0,
itemCount: 3,
pagination: SwiperPagination(),
control: null,
),
);
}
}
import 'package:chart/constant/app_colors.dart';
import 'package:flutter/material.dart';
// import 'package:chart/constant/app_colors.dart';
// import 'package:chart/constant/app_dimens.dart';
import 'package:chart/constant/app_images.dart';
// import 'package:chart/constant/app_strings.dart';
import 'package:chart/models/user_model.dart';
import 'package:responsive_grid_list/responsive_grid_list.dart';
import 'package:flutter/services.dart';
import 'package:flutter_chat_ui/flutter_chat_ui.dart';
import 'package:chart/pages/dashboard/components/banner.dart';
import 'package:chart/pages/dashboard/components/search.dart';
import 'package:chart/pages/dashboard/components/appbar.dart';
import 'package:chart/pages/dashboard/components/list.dart';
import 'package:chart/pages/dashboard/components/swiper.dart';
import 'package:chart/pages/dashboard/components/swiper_column.dart';
import 'package:flutter/cupertino.dart';
// import 'package:flutter/material.dart';
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
//
// import 'package:chart/utils/navigator_util.dart';
// import 'package:flutter_screenutil/flutter_screenutil.dart';
class DashBoardPage extends StatefulWidget {
const DashBoardPage({Key? key}) : super(key: key);
@override
DashBoardPageState createState() => DashBoardPageState();
}
class DashBoardPageState extends State<DashBoardPage> {
var guides = [AppImages.guide1, AppImages.guide2, AppImages.guide3];
var _showButton = false;
// final FocusNode focusNode = FocusNode();
@override
Widget build(BuildContext context) {
UserModel().setIsFirstOpen(false);
return Scaffold(
backgroundColor: Color(0xFFF4F4F4),
body: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/bg.png").image,
fit: BoxFit.cover),
),
child: SingleChildScrollView(
child: ConstrainedBox(
constraints: BoxConstraints(),
child: GestureDetector(
onTap: () {
// focusNode.unfocus();
SystemChannels.textInput.invokeMethod('TextInput.hide');
},
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
children: [
DoctorAppBar(),
SwiperPage(),
// SwiperColunmPage(),
BannerPage(),
ListPage(),
],
),
),
),
),
)),
);
}
void _handleCancel() {}
List<Container> _getListData() {
var tempList = [
"护肤品推荐",
"答题助手",
"朋友圈文案",
"专业翻译",
].map((obj) {
return Container(
// 子元素
decoration: BoxDecoration(
// 边框
border: Border.all(
// 颜色
color: Color.fromRGBO(233, 233, 233, 0.8),
// 边框宽度
width: 1.0)),
// 子元素
child: Column(
// 子元素
children: <Widget>[
// 图片
// Image.network(obj['imageUrl']),
// 图片与文字的间隔使用
const SizedBox(height: 12),
// 文字
Text(obj,
textAlign: TextAlign.center, style: TextStyle(fontSize: 18)),
],
),
);
});
return tempList.toList();
}
}
class viod {}
class DismissKeyboardDemo extends StatelessWidget {
final FocusNode focusNode = FocusNode();
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
focusNode.unfocus();
},
child: Container(
color: Colors.transparent,
alignment: Alignment.center,
child: TextField(
focusNode: focusNode,
),
),
);
}
}
// return Scaffold(
// appBar: AppBar(title: const Text('Demo')),
// body: ,
// );
...@@ -6,7 +6,7 @@ import 'package:chart/constant/app_strings.dart'; ...@@ -6,7 +6,7 @@ import 'package:chart/constant/app_strings.dart';
import 'package:chart/models/user_model.dart'; import 'package:chart/models/user_model.dart';
import 'package:chart/utils/navigator_util.dart'; import 'package:chart/utils/navigator_util.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:card_swiper/card_swiper.dart';
class GuidePage extends StatefulWidget { class GuidePage extends StatefulWidget {
const GuidePage({Key? key}) : super(key: key); const GuidePage({Key? key}) : super(key: key);
......
This diff is collapsed.
import 'package:chart/constant/app_colors.dart';
import 'package:chart/pages/dashboard/components/list.dart';
import 'package:flutter/material.dart';
// import 'package:chart/constant/app_colors.dart';
import 'package:chart/constant/app_dimens.dart';
import 'package:chart/constant/app_images.dart';
// import 'package:chart/constant/app_strings.dart';
import 'package:chart/models/user_model.dart';
import 'package:babstrap_settings_screen/babstrap_settings_screen.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:chart/service/square_service.dart';
import 'package:glassmorphism/glassmorphism.dart';
import '../../entity/square_entity.dart';
// import 'package:chart/utils/navigator_util.dart';
// import 'package:flutter_screenutil/flutter_screenutil.dart';
class SquarePage extends StatefulWidget {
const SquarePage({Key? key}) : super(key: key);
@override
SquarePageState createState() => SquarePageState();
}
class SquarePageState extends State<SquarePage> {
var guides = [AppImages.guide1, AppImages.guide2, AppImages.guide3];
var _showButton = false;
List<String> items = [];
int _current = 1;
int _total = 0;
int _size = 10;
bool _isDown = false;
List<SearchRecordEntity> _records = [];
RefreshController _refreshController =
RefreshController(initialRefresh: false);
void _onRefresh() async {
setState(() {
_current = 1;
});
await _getRecord(_current, _size);
// monitor network fetch
// await Future.delayed(Duration(milliseconds: 1000));
// if failed,use refreshFailed()
_refreshController.refreshCompleted();
}
_onLoading() async {
// if (_isDown) {
// print('131321');
// setState(() {
// _records = _records;
// });
// if (mounted) _refreshController.loadComplete();
// return;
// }
List<SearchRecordEntity>? records =
await SquareService().getSearchRecord(_current, _size);
// print("_curr $_current");
// setState(() {
// _current = _current + 1;
// });
// _getRecord(_current, _size);
// setState({
// _current = 2;
// });
// _getRecord(_current, _size);
// monitor network fetch
// await _getRecord(_current, _size);
// await Future.delayed(Duration(milliseconds: 1000));
// if failed,use loadFailed(),if no data return,use LoadNodata()
// _records.add();
records?.forEach((element) {
_records.add(element);
});
if (records!.length!! < 10) {
setState(() {
_isDown = true;
});
Fluttertoast.showToast(
msg: "已全部加载完毕",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: AppColors.color8,
textColor: Colors.white,
fontSize: 16.0);
}
if (mounted) {
setState(() {
_current = _current + 1;
});
}
_refreshController.loadComplete();
}
@override
void initState() {
// TODO: implement initState
super.initState();
_getRecord(_current, _size);
// MessageService().getMessage
// getSearchRecord
}
_getRecord(int page, int size) async {
List<SearchRecordEntity>? records =
await SquareService().getSearchRecord(page, size);
setState(() {
_records = records!;
_current = _current + 1;
});
// print("records11111$records");
// List<SearchRecordEntity>? li = (await SquareService()
// .getSearchRecord(1, 10)) as List<SearchRecordEntity>?;
// print('__________$li');
// int _current = 1;
// int _total = 0;
// int _size = 10;
// List<SearchRecordEntity> records = [];
// SearchRecordEntity.fromMap(result['data']
// print("--------------------------------li${li}");
// setState(() {
// // _current = li!.current;
// // _records = li.records;
// // _total = li.total;
// // _size = li.size;
// });
// print("lllllllll----$li");
// List<SearchRecordEntity> li = (await )
// as List<SearchRecordEntity>;
}
@override
Widget build(BuildContext context) {
UserModel().setIsFirstOpen(false);
return Scaffold(
// backgroundColor: Color(0xFFF4F4F4),
body: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/bg.png").image,
fit: BoxFit.cover),
),
// padding: EdgeInsets.only(top: 10),
child: SmartRefresher(
enablePullDown: true,
enablePullUp: _isDown ? false : true,
header: WaterDropHeader(),
controller: _refreshController,
onRefresh: _isDown ? null : _onRefresh,
onLoading: _onLoading,
child: ListView.builder(
// itemBuilder: (c, i) => Card(child: Center(child: Text(items[i]))),
itemBuilder: (c, i) => Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Container(
// color: Colors.black,
margin: EdgeInsets.only(top: 10),
padding: const EdgeInsets.symmetric(horizontal: 16),
// padding: EdgeInsets.all(16),
// flex: 1,
child: Column(children: [
SizedBox(height: 0),
glassCard(context, i, _records)
]),
)
// BigUserCard(
// // cardColor: Colors.red,
// userName: "Babacar Ndon222g",
// userProfilePic: AssetImage("assets/images/logo.png"),
// cardActionWidget: SettingsItem(
// icons: Icons.edit,
// iconStyle: IconStyle(
// withBackground: true,
// borderRadius: 50,
// backgroundColor: Colors.yellow[600],
// ),
// title: "${_records[i].question}",
// subtitle: _records[i].createTime,
// onTap: () {
// print("OK");
// },
// ),
// ),
),
itemExtent: 240.0,
itemCount: _records.length,
),
),
),
);
}
}
Widget glassCard(var context, int i, List<SearchRecordEntity> records) {
double textScaleFactor = MediaQuery.textScaleFactorOf(context);
return GlassmorphicFlexContainer(
// flex: 1,
borderRadius: 16,
padding: EdgeInsets.only(bottom: 16),
blur: 14,
alignment: Alignment.bottomCenter,
border: 2,
linearGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF0FFFF).withOpacity(0.2),
Color(0xFF0FFFF).withOpacity(0.2),
],
),
borderGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF0FFFF).withOpacity(1),
Color(0xFFFFFFF),
Color(0xFF0FFFF).withOpacity(1),
],
),
child: Column(key: UniqueKey(),
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// ignore: prefer_const_literals_to_create_immutables
children: [
// ignore: prefer_const_constructors
Container(
// color: Colors.red,
height: 50,
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 16),
child: Text(
"${records[i].question}",
style: const TextStyle(
color: Colors.white,
height: 2,
fontSize: 20,
fontWeight: FontWeight.w600),
)),
// ignore: prefer_const_constructors
Container(
// color: Colors.red,
padding: EdgeInsets.symmetric(horizontal: 16),
width: double.infinity,
height: 150,
child: SingleChildScrollView(
child: Text(
records[i].answer,
style: TextStyle(color: Colors.white, fontSize: 12
// height: 0.8
),
// height: 2,
// fontSize: 20,
maxLines: 7,
),
),
),
]));
}
import 'package:flutter/material.dart';
import 'package:babstrap_settings_screen/babstrap_settings_screen.dart';
class UserPage extends StatefulWidget {
@override
UserPageState createState() => UserPageState();
}
class UserPageState extends State<UserPage> {
// final List<BankCardModel> cards = [
// BankCardModel('assets/images/bg_red_card.png', 'Hoang Cuu Long',
// '4221 5168 7464 2283', '08/20', 10000000),
// BankCardModel('assets/images/bg_blue_circle_card.png', 'Hoang Cuu Long',
// '4221 5168 7464 2283', '08/20', 10000000),
// BankCardModel('assets/images/bg_purple_card.png', 'Hoang Cuu Long',
// '4221 5168 7464 2283', '08/20', 10000000),
// BankCardModel('assets/images/bg_blue_card.png', 'Hoang Cuu Long',
// '4221 5168 7464 2283', '08/20', 10000000),
// ];
@override
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
backgroundColor: Color(0xFFF4F4F4),
body: Padding(
padding: const EdgeInsets.all(10),
child: ListView(
children: [
// User card
BigUserCard(
// cardColor: Colors.red,
userName: "Babacar Ndong",
userProfilePic: AssetImage("assets/images/logo.png"),
cardActionWidget: SettingsItem(
icons: Icons.edit,
iconStyle: IconStyle(
withBackground: true,
borderRadius: 50,
backgroundColor: Colors.yellow[600],
),
title: "Modify",
subtitle: "Tap to change your data",
onTap: () {
print("OK");
},
),
),
SettingsGroup(
items: [
SettingsItem(
onTap: () {},
icons: Icons.exit_to_app_rounded,
iconStyle: IconStyle(),
title: 'Appearance',
subtitle: "Make Ziar'App yours",
),
SettingsItem(
onTap: () {},
icons: Icons.dark_mode_rounded,
iconStyle: IconStyle(
iconsColor: Colors.white,
withBackground: true,
backgroundColor: Colors.red,
),
title: 'Dark mode',
subtitle: "Automatic",
trailing: Switch.adaptive(
value: false,
onChanged: (value) {},
),
),
],
),
SettingsGroup(
items: [
SettingsItem(
onTap: () {},
icons: Icons.info_rounded,
iconStyle: IconStyle(
backgroundColor: Colors.purple,
),
title: 'About',
subtitle: "Learn more about Ziar'App",
),
],
),
// You can add a settings title
SettingsGroup(
settingsGroupTitle: "Account",
items: [
SettingsItem(
onTap: () {},
icons: Icons.exit_to_app_rounded,
title: "Sign Out",
),
SettingsItem(
onTap: () {},
icons: Icons.exit_to_app_rounded,
title: "Delete account",
titleStyle: TextStyle(
color: Colors.red,
fontWeight: FontWeight.bold,
),
),
],
),
],
),
),
);
}
}
...@@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; ...@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:chart/pages/home/home_page.dart'; import 'package:chart/pages/home/home_page.dart';
// import 'package:sail/pages/404/not_find_page.dart'; // import 'package:sail/pages/404/not_find_page.dart';
import 'package:chart/pages/login/login_page.dart'; import 'package:chart/pages/login/login_page.dart';
import 'package:chart/pages/chat/chat_page.dart';
// import 'package:sail/pages/plan/plan_page.dart'; // import 'package:sail/pages/plan/plan_page.dart';
// import 'package:sail/pages/server_list.dart'; // import 'package:sail/pages/server_list.dart';
// import 'package:sail/pages/webview_widget.dart'; // import 'package:sail/pages/webview_widget.dart';
...@@ -33,13 +34,11 @@ Handler homeHandler = Handler( ...@@ -33,13 +34,11 @@ Handler homeHandler = Handler(
// return const NotFindPage(); // return const NotFindPage();
// }); // });
// 聊天
Handler chatHandle = Handler(
/// 套餐页 handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) {
// Handler planHandle = Handler( return const ChatPage();
// handlerFunc: (BuildContext? context, Map<String, List<String>> parameters) { });
// return const PlanPage();
// });
/// 服务器节点页 /// 服务器节点页
// Handler serverListHandler = Handler( // Handler serverListHandler = Handler(
......
...@@ -8,6 +8,7 @@ class Routers { ...@@ -8,6 +8,7 @@ class Routers {
static String plan = "/plan"; static String plan = "/plan";
static String serverList = '/server-list'; static String serverList = '/server-list';
static String webView = "/web-view"; static String webView = "/web-view";
static String chat = "/chat";
static void configureRoutes(FluroRouter router) { static void configureRoutes(FluroRouter router) {
// router.notFoundHandler = notFindHandler; // router.notFoundHandler = notFindHandler;
...@@ -16,7 +17,7 @@ class Routers { ...@@ -16,7 +17,7 @@ class Routers {
router.define(login, handler: loginHandler); router.define(login, handler: loginHandler);
// router.define(plan, handler: planHandle); router.define(chat, handler: chatHandle);
// router.define(serverList, handler: serverListHandler); // router.define(serverList, handler: serverListHandler);
......
...@@ -22,14 +22,33 @@ import 'package:chart/utils/http_util.dart'; ...@@ -22,14 +22,33 @@ import 'package:chart/utils/http_util.dart';
// late final int timestamp; // late final int timestamp;
// } // }
class MessageSendParameter {
MessageSendParameter({
required this.message,
});
final String message;
Map<String, dynamic> toMap() => {
"message": message,
};
}
class MessageService { class MessageService {
// ?question=321321 // ?question=321321
// static const String message = '$baseApiUrl/openAi/aiAnswer'; // static const String message = '$baseApiUrl/openAi/aiAnswer';
Future<String>? getMessage(String message) { Future<String>? getMessage(Map<String, dynamic> parameters) {
// /getQuickLoginUrl({'redirect': "/plan/${widget.id}"})?
return HttpUtil.instance return HttpUtil.instance
?.get("${AppUrls.message}?question=$message") ?.post("${AppUrls.message}", parameters: parameters)
.then((result) { .then((result) {
return result['data']; return result['data'];
}); });
} }
Future<List<MessageEntity>>? getMessageList() {
return HttpUtil.instance?.get(AppUrls.getMessageList).then((result) {
// return result['data'];
return messageEntityFromList(result['data']);
});
}
} }
...@@ -3,16 +3,15 @@ import 'package:chart/entity/plan_entity.dart'; ...@@ -3,16 +3,15 @@ import 'package:chart/entity/plan_entity.dart';
import 'package:chart/utils/http_util.dart'; import 'package:chart/utils/http_util.dart';
class PlanService { class PlanService {
Future<List<PlanEntity>>? plan() { Future<List<PlanEntity>>? getMessage() {
return HttpUtil.instance?.get(AppUrls.plan).then((result) { return HttpUtil.instance?.get(AppUrls.message).then((result) {
return planEntityFromList(result['data']); return planEntityFromList(result['data']);
}); });
} }
Future<PlanEntity>? planDetail(int id) { Future<List<PlanEntity>>? getMessageList() {
return HttpUtil.instance return HttpUtil.instance?.get(AppUrls.getMessageList).then((result) {
?.get(AppUrls.plan, parameters: {'id': id}).then((result) { return planEntityFromList(result['data']);
return PlanEntity.fromMap(result['data']);
}); });
} }
} }
...@@ -4,8 +4,8 @@ import 'package:chart/utils/http_util.dart'; ...@@ -4,8 +4,8 @@ import 'package:chart/utils/http_util.dart';
class ServerService { class ServerService {
Future<List<ServerEntity>>? server() { Future<List<ServerEntity>>? server() {
return HttpUtil.instance?.get(AppUrls.server).then((result) { // return HttpUtil.instance?.get(AppUrls.server).then((result) {
return serverEntityFromList(result['data']); // return serverEntityFromList(result['data']);
}); // });
} }
} }
import 'package:chart/constant/app_urls.dart';
// import 'package:chart/entity/login_entity.dart';
import 'package:chart/entity/square_entity.dart';
// import 'package:chart/entity/user_subscribe_entity.dart';
import 'package:chart/utils/http_util.dart';
import '../pages/square/square_page.dart';
class SquareService {
// Future<LoginEntity>? login(Map<String, dynamic> parameters) {
// return HttpUtil.instance
// ?.post(AppUrls.login, parameters: parameters)
// .then((result) {
// return LoginEntity.fromMap(result['data']);
// });
// }
// Future<String>? getQuickLoginUrl(Map<String, dynamic> parameters) {
// return HttpUtil.instance
// ?.post(AppUrls.getQuickLoginUrl, parameters: parameters)
// .then((result) {
// return result['data'];
// });
// }
// Future<bool>? register(parameters) {
// return HttpUtil.instance
// ?.post(AppUrls.register, parameters: parameters)
// .then((result) {
// return result['data'];
// });
// }
// Future<UserSubscribeEntity>? userSubscribe() {
// return HttpUtil.instance?.get(AppUrls.userSubscribe).then((result) {
// return UserSubscribeEntity.fromMap(result['data']);
// });
// }
Future<List<SearchRecordEntity>>? getSearchRecord(int page, int size) {
return HttpUtil.instance
?.get('${AppUrls.getSearchRecord}/$page/$size')
.then((result) {
return searchRecordEntityFromList(result['data']['records']);
});
}
}
...@@ -5,39 +5,39 @@ import 'package:chart/entity/user_subscribe_entity.dart'; ...@@ -5,39 +5,39 @@ import 'package:chart/entity/user_subscribe_entity.dart';
import 'package:chart/utils/http_util.dart'; import 'package:chart/utils/http_util.dart';
class UserService { class UserService {
Future<LoginEntity>? login(Map<String, dynamic> parameters) { // Future<LoginEntity>? login(Map<String, dynamic> parameters) {
return HttpUtil.instance // return HttpUtil.instance
?.post(AppUrls.login, parameters: parameters) // ?.post(AppUrls.login, parameters: parameters)
.then((result) { // .then((result) {
return LoginEntity.fromMap(result['data']); // return LoginEntity.fromMap(result['data']);
}); // });
} // }
Future<String>? getQuickLoginUrl(Map<String, dynamic> parameters) { // Future<String>? getQuickLoginUrl(Map<String, dynamic> parameters) {
return HttpUtil.instance // return HttpUtil.instance
?.post(AppUrls.getQuickLoginUrl, parameters: parameters) // ?.post(AppUrls.getQuickLoginUrl, parameters: parameters)
.then((result) { // .then((result) {
return result['data']; // return result['data'];
}); // });
} // }
Future<bool>? register(parameters) { // Future<bool>? register(parameters) {
return HttpUtil.instance // return HttpUtil.instance
?.post(AppUrls.register, parameters: parameters) // ?.post(AppUrls.register, parameters: parameters)
.then((result) { // .then((result) {
return result['data']; // return result['data'];
}); // });
} // }
Future<UserSubscribeEntity>? userSubscribe() { // Future<UserSubscribeEntity>? userSubscribe() {
return HttpUtil.instance?.get(AppUrls.userSubscribe).then((result) { // return HttpUtil.instance?.get(AppUrls.userSubscribe).then((result) {
return UserSubscribeEntity.fromMap(result['data']); // return UserSubscribeEntity.fromMap(result['data']);
}); // });
} // }
Future<UserEntity>? info() { Future<IntegralEntity>? getUserIntegral() {
return HttpUtil.instance?.get(AppUrls.userInfo).then((result) { return HttpUtil.instance?.get(AppUrls.getUserIntegral).then((result) {
return UserEntity.fromMap(result['data']); return IntegralEntity.fromMap(result['data']);
}); });
} }
} }
import 'package:flutter/material.dart';
class BankCard extends StatelessWidget {
final BankCardModel card;
BankCard({required this.card});
@override
Widget build(BuildContext context) {
return Container(
height: 150.0,
width: 252.0,
decoration: BoxDecoration(
image:
DecorationImage(image: AssetImage(card.bgAsset), fit: BoxFit.cover),
),
child: Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 20.0, right: 16.0),
child: Text(
'BALANCE',
textAlign: TextAlign.right,
style: TextStyle(
color: Colors.white,
fontSize: 10.0,
fontWeight: FontWeight.bold),
),
),
Padding(
padding: const EdgeInsets.only(right: 16.0),
child: Text(
'\$ ${card.balance}',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
],
),
],
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 16.0),
child: Text(
card.accountNumber,
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.white,
fontSize: 16.0,
fontWeight: FontWeight.bold),
),
),
Padding(
padding: const EdgeInsets.only(left: 16.0, top: 4.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(
'VALID\nTHRU',
textAlign: TextAlign.left,
style: TextStyle(
color: card.bgAsset ==
'assets/images/bg_purple_card.png' ||
card.bgAsset ==
'assets/images/bg_blue_card.png'
? Colors.grey
: Colors.black,
fontSize: 10.0,
fontWeight: FontWeight.bold),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Text(
card.validDate,
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontWeight: FontWeight.bold),
),
)
],
),
),
Padding(
padding: const EdgeInsets.only(left: 16.0, top: 4.0),
child: Text(
card.name,
textAlign: TextAlign.left,
style: TextStyle(
color: card.bgAsset == 'assets/images/bg_purple_card.png' ||
card.bgAsset == 'assets/images/bg_blue_card.png'
? Colors.grey
: Color(0xFF253C70),
fontSize: 12.0,
fontWeight: FontWeight.bold,
),
),
),
],
))
],
),
);
}
}
class SmallBankCard extends StatelessWidget {
final BankCardModel card;
final double screenWidth;
SmallBankCard({required this.card, required this.screenWidth});
@override
Widget build(BuildContext context) {
final bool isLargeScreen = screenWidth > 320;
final double topPadding = isLargeScreen ? 14.0 : 24.0;
final EdgeInsets inset = EdgeInsets.only(left: 16.0, top: topPadding);
return Container(
decoration: BoxDecoration(
image:
DecorationImage(image: AssetImage(card.bgAsset), fit: BoxFit.cover),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Padding(
padding: inset,
child: Text(
card.accountNumber,
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.white,
fontSize: isLargeScreen ? 10.0 : 18.0,
fontWeight: FontWeight.bold),
),
),
Padding(
padding: const EdgeInsets.only(left: 16.0, top: 2.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(
'VALID\nTHRU',
textAlign: TextAlign.left,
style: TextStyle(
color: card.bgAsset ==
'assets/images/bg_purple_card.png' ||
card.bgAsset ==
'assets/images/bg_blue_card.png'
? Colors.grey
: Colors.black,
fontSize: isLargeScreen ? 6.0 : 12.0,
fontWeight: FontWeight.bold),
),
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 8.0),
child: Text(
card.validDate,
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.white,
fontSize: isLargeScreen ? 10.0 : 20.0,
fontWeight: FontWeight.bold),
),
)
],
),
),
Padding(
padding: const EdgeInsets.only(left: 16.0, top: 2.0),
child: Text(
card.name,
textAlign: TextAlign.left,
style: TextStyle(
color: card.bgAsset ==
'assets/images/bg_purple_card.png' ||
card.bgAsset ==
'assets/images/bg_blue_card.png'
? Colors.grey
: Color(0xFF253C70),
fontSize: isLargeScreen ? 9.0 : 13.0,
fontWeight: FontWeight.bold),
),
),
],
)),
],
),
),
GestureDetector(
child: Container(
child: Image.asset('assets/images/ico_delete_card.png'),
),
),
],
),
);
}
}
class BankCardModel {
final String bgAsset;
final int balance;
final String name;
final String validDate;
final String accountNumber;
BankCardModel(
this.bgAsset,
this.name,
this.accountNumber,
this.validDate,
this.balance,
);
}
...@@ -31,7 +31,7 @@ class HomeWidgetState extends State<HomeWidget> ...@@ -31,7 +31,7 @@ class HomeWidgetState extends State<HomeWidget>
void initState() { void initState() {
super.initState(); super.initState();
PlanService().plan()?.then((planEntityList) { PlanService().getMessage()?.then((planEntityList) {
setState(() { setState(() {
_planEntityList = planEntityList; _planEntityList = planEntityList;
}); });
......
...@@ -4,9 +4,14 @@ import 'package:chart/constant/app_colors.dart'; ...@@ -4,9 +4,14 @@ import 'package:chart/constant/app_colors.dart';
import 'package:chart/models/app_model.dart'; import 'package:chart/models/app_model.dart';
class SailAppBar extends AppBar { class SailAppBar extends AppBar {
SailAppBar({Key? key, required this.appTitle}) : super(key: key); SailAppBar({
Key? key,
required this.appTitle,
required this.backgroundColor,
}) : super(key: key);
final String appTitle; final String appTitle;
final Color backgroundColor;
@override @override
SailAppBarState createState() => SailAppBarState(); SailAppBarState createState() => SailAppBarState();
...@@ -26,9 +31,11 @@ class SailAppBarState extends State<SailAppBar> { ...@@ -26,9 +31,11 @@ class SailAppBarState extends State<SailAppBar> {
return AppBar( return AppBar(
title: Text( title: Text(
widget.appTitle, widget.appTitle,
style: const TextStyle(color: Colors.white), style: const TextStyle(
color: Color.fromRGBO(46, 47, 47, 1.00), fontSize: 16),
), ),
backgroundColor: Color.fromRGBO(30, 28, 57, 1), // rgba(246, 248, 247, 1.00)
backgroundColor: widget.backgroundColor,
// backgroundColor: // backgroundColor:
// _appModel.isOn ? AppColors.grayColor : AppColors.themeColor, // _appModel.isOn ? AppColors.grayColor : AppColors.themeColor,
// shape: const RoundedRectangleBorder( // shape: const RoundedRectangleBorder(
......
...@@ -29,11 +29,11 @@ class SlidingCardsViewState extends State<SlidingCardsView> { ...@@ -29,11 +29,11 @@ class SlidingCardsViewState extends State<SlidingCardsView> {
setState(() => pageOffset = pageController.page!); setState(() => pageOffset = pageController.page!);
}); });
PlanService().plan()?.then((planEntityList) { // PlanService().plan()?.then((planEntityList) {
setState(() { // setState(() {
_planEntityList = planEntityList; // _planEntityList = planEntityList;
}); // });
}); // });
} }
@override @override
...@@ -216,13 +216,14 @@ class CardContentState extends State<CardContent> { ...@@ -216,13 +216,14 @@ class CardContentState extends State<CardContent> {
borderRadius: BorderRadius.circular(32), borderRadius: BorderRadius.circular(32),
), ),
), ),
onPressed: () => _userModel.checkHasLogin( onPressed: () => {},
context, // onPressed: () => _userModel.checkHasLogin(
() => UserService().getQuickLoginUrl({ // context,
'redirect': "/plan/${widget.id}" // () => UserService().getQuickLoginUrl({
})?.then((value) { // 'redirect': "/plan/${widget.id}"
NavigatorUtil.goWebView(context, "配置订阅", value); // })?.then((value) {
})), // NavigatorUtil.goWebView(context, "配置订阅", value);
// })),
child: Transform.translate( child: Transform.translate(
offset: Offset(24 * widget.offset, 0), offset: Offset(24 * widget.offset, 0),
child: Text('购买', child: Text('购买',
......
...@@ -29,6 +29,13 @@ packages: ...@@ -29,6 +29,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.9.0" version: "2.9.0"
babstrap_settings_screen:
dependency: "direct main"
description:
name: babstrap_settings_screen
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
...@@ -43,6 +50,13 @@ packages: ...@@ -43,6 +50,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.1" version: "1.2.1"
card_swiper:
dependency: "direct main"
description:
name: card_swiper
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
characters: characters:
dependency: transitive dependency: transitive
description: description:
...@@ -99,6 +113,13 @@ packages: ...@@ -99,6 +113,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.5" version: "1.0.5"
curved_navigation_bar:
dependency: "direct main"
description:
name: curved_navigation_bar
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
diffutil_dart: diffutil_dart:
dependency: transitive dependency: transitive
description: description:
...@@ -235,13 +256,6 @@ packages: ...@@ -235,13 +256,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.2.0" version: "3.2.0"
flutter_page_indicator:
dependency: transitive
description:
name: flutter_page_indicator
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.3"
flutter_parsed_text: flutter_parsed_text:
dependency: transitive dependency: transitive
description: description:
...@@ -256,6 +270,13 @@ packages: ...@@ -256,6 +270,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.7" version: "2.0.7"
flutter_rating_bar:
dependency: "direct main"
description:
name: flutter_rating_bar
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.1"
flutter_screenutil: flutter_screenutil:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -270,13 +291,6 @@ packages: ...@@ -270,13 +291,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.0"
flutter_swiper:
dependency: "direct main"
description:
name: flutter_swiper
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
flutter_tags: flutter_tags:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -308,6 +322,20 @@ packages: ...@@ -308,6 +322,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "9.2.0" version: "9.2.0"
glass_kit:
dependency: "direct main"
description:
name: glass_kit
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
glassmorphism:
dependency: "direct main"
description:
name: glassmorphism
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
html: html:
dependency: transitive dependency: transitive
description: description:
...@@ -511,6 +539,13 @@ packages: ...@@ -511,6 +539,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.0" version: "3.1.0"
playing_cards:
dependency: "direct main"
description:
name: playing_cards
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.1+9"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
...@@ -532,6 +567,13 @@ packages: ...@@ -532,6 +567,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.5" version: "6.0.5"
pull_to_refresh:
dependency: "direct main"
description:
name: pull_to_refresh
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
quiver: quiver:
dependency: transitive dependency: transitive
description: description:
...@@ -539,6 +581,13 @@ packages: ...@@ -539,6 +581,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.2.1" version: "3.2.1"
responsive_grid_list:
dependency: "direct main"
description:
name: responsive_grid_list
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
scroll_to_index: scroll_to_index:
dependency: transitive dependency: transitive
description: description:
...@@ -600,6 +649,13 @@ packages: ...@@ -600,6 +649,13 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.99" version: "0.0.99"
smooth_page_indicator:
dependency: "direct main"
description:
name: smooth_page_indicator
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0+2"
source_span: source_span:
dependency: transitive dependency: transitive
description: description:
...@@ -642,13 +698,6 @@ packages: ...@@ -642,13 +698,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.12" version: "0.4.12"
transformer_page_view:
dependency: transitive
description:
name: transformer_page_view
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.6"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
......
...@@ -52,7 +52,6 @@ dependencies: ...@@ -52,7 +52,6 @@ dependencies:
webview_flutter: ^3.0.4 webview_flutter: ^3.0.4
provider: ^6.0.3 provider: ^6.0.3
flutter_screenutil: ^5.5.3+2 flutter_screenutil: ^5.5.3+2
flutter_swiper: ^1.1.6
flutter_login: ^3.2.0 flutter_login: ^3.2.0
flutter_easyrefresh: ^2.1.8 flutter_easyrefresh: ^2.1.8
intl: ^0.17.0 intl: ^0.17.0
...@@ -69,10 +68,20 @@ dependencies: ...@@ -69,10 +68,20 @@ dependencies:
image_picker: ^0.8.6 image_picker: ^0.8.6
mime: ^1.0.2 mime: ^1.0.2
open_filex: ^4.2.2 open_filex: ^4.2.2
pull_to_refresh: ^2.0.0
uuid: ^3.0.6 uuid: ^3.0.6
file_picker: ^5.2.2 file_picker: ^5.2.2
bubble: ^1.2.1 bubble: ^1.2.1
animated_text_kit: ^4.2.2 animated_text_kit: ^4.2.2
responsive_grid_list: ^1.3.1
babstrap_settings_screen: ^0.1.4
smooth_page_indicator: ^1.0.0+2
flutter_rating_bar: ^4.0.1
curved_navigation_bar: ^1.0.3
playing_cards: ^0.3.1+9
card_swiper: ^2.0.4
glass_kit: ^2.0.1
glassmorphism: ^3.0.0
# package:bubble/bubble.dart # package:bubble/bubble.dart
dev_dependencies: dev_dependencies:
......
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