diff --git a/circle_app/android/app/src/main/AndroidManifest.xml b/circle_app/android/app/src/main/AndroidManifest.xml index 59291fa..074b315 100644 --- a/circle_app/android/app/src/main/AndroidManifest.xml +++ b/circle_app/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ + AboutappLogic()); + } +} diff --git a/circle_app/lib/app/aboutapp/logic.dart b/circle_app/lib/app/aboutapp/logic.dart new file mode 100644 index 0000000..4ab86d9 --- /dev/null +++ b/circle_app/lib/app/aboutapp/logic.dart @@ -0,0 +1,7 @@ +import 'package:get/get.dart'; + +import 'state.dart'; + +class AboutappLogic extends GetxController { + final AboutappState state = AboutappState(); +} diff --git a/circle_app/lib/app/aboutapp/state.dart b/circle_app/lib/app/aboutapp/state.dart new file mode 100644 index 0000000..ef106da --- /dev/null +++ b/circle_app/lib/app/aboutapp/state.dart @@ -0,0 +1,5 @@ +class AboutappState { + AboutappState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/aboutapp/view.dart b/circle_app/lib/app/aboutapp/view.dart new file mode 100644 index 0000000..d243068 --- /dev/null +++ b/circle_app/lib/app/aboutapp/view.dart @@ -0,0 +1,172 @@ +import 'package:circle_app/util/util.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../components/my_app_bar.dart'; +import '../../router/app_routers.dart'; +import 'logic.dart'; +import 'package:url_launcher/url_launcher.dart'; + + +class AboutappPage extends StatelessWidget { + AboutappPage({Key? key}) : super(key: key); + + final logic = Get.find(); + final state = Get.find().state; + + + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar(centerTitle: '关于',), + body: Scaffold( + backgroundColor: Colors.transparent, // Replace with your desired color + body: Container( + margin: EdgeInsets.only(left: 11.sp,right: 11.sp), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + // Image.asset( + // getHomeImage("mine_circle"), // Replace with your image path + // width: double.infinity, + // height: double.infinity, + // fit: BoxFit.contain, + // ), + SizedBox(height: 20), + Text( + '圈子', + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 16, + ), + ), + SizedBox(height: 40), + Container( + width: double.infinity, + height: 0.4, + color: Color(0xFF2E2E3B), + ), + SizedBox(height: 20), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + _openBrowser(); + + }, + child: Row( + children: [ + Text( + '评价跨友', + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 16, + ), + ), + Spacer(), + + SizedBox(width: 8), + Image( + image: AssetImage(getHomeImage("icon_in")),width: 24.sp,height: 24.sp, + fit: BoxFit.fill, + ), + + ], + ), + ), + + SizedBox(height: 20), + Row( + children: [ + Text( + '用户协议', + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 16, + ), + ), + Spacer(), + Image( + image: AssetImage(getHomeImage("icon_in")),width: 24.sp,height: 24.sp, + fit: BoxFit.fill, + ), + ], + ), + SizedBox(height: 20), + Row( + children: [ + Text( + '隐私政策', + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 16, + ), + ), + Spacer(), + Image( + image: AssetImage(getHomeImage("icon_in")),width: 24.sp,height: 24.sp, + fit: BoxFit.fill, + ), + ], + ), + SizedBox(height: 20), + Row( + children: [ + Text( + '版本更新', + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 16, + ), + ), + Spacer(), + Container( + width: 6, + height: 5, + margin: EdgeInsets.only(top: 1, right: 8), + decoration: BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(3), + ), + ), + Text( + '1.0.0', + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 12, + ), + ), + SizedBox(width: 8), + Image( + image: AssetImage(getHomeImage("icon_in")),width: 24.sp,height: 24.sp, + fit: BoxFit.fill, + ), + ], + ), + ], + ),) + ),), + ); + } + String url = 'https://www.baidu.com'; // Replace with your desired URL + + void _openBrowser() async { + if (await canLaunch(url)) { + await launch(url); + } else { + throw 'Could not launch $url'; + } + } + +} diff --git a/circle_app/lib/app/account/binding.dart b/circle_app/lib/app/account/binding.dart new file mode 100644 index 0000000..7c726d5 --- /dev/null +++ b/circle_app/lib/app/account/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class AccountBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => AccountLogic()); + } +} diff --git a/circle_app/lib/app/account/logic.dart b/circle_app/lib/app/account/logic.dart new file mode 100644 index 0000000..4ceafc0 --- /dev/null +++ b/circle_app/lib/app/account/logic.dart @@ -0,0 +1,7 @@ +import 'package:get/get.dart'; + +import 'state.dart'; + +class AccountLogic extends GetxController { + final AccountState state = AccountState(); +} diff --git a/circle_app/lib/app/account/state.dart b/circle_app/lib/app/account/state.dart new file mode 100644 index 0000000..9cb151e --- /dev/null +++ b/circle_app/lib/app/account/state.dart @@ -0,0 +1,5 @@ +class AccountState { + AccountState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/account/view.dart b/circle_app/lib/app/account/view.dart new file mode 100644 index 0000000..37f40a0 --- /dev/null +++ b/circle_app/lib/app/account/view.dart @@ -0,0 +1,273 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../components/my_app_bar.dart'; +import '../../router/app_routers.dart'; +import '../../util/util.dart'; +import 'logic.dart'; + +class AccountPage extends StatelessWidget { + AccountPage({Key? key}) : super(key: key); + + final logic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: '设置', + ), + body: Scaffold( + backgroundColor: Colors.transparent, + body: SafeArea( + child: ListView( + padding: EdgeInsets.all(16.0), + children: [ + // Container( + // margin: EdgeInsets.only(top: 16.0), + // child: Row( + // children: [ + // Text( + // "消息提醒", + // style: TextStyle( + // color: Color(0xFFF7FAFA), + // fontSize: 16.0, + // ), + // ), + // Spacer(), + // Image.asset( + // getHomeImage("icon_in"), + // width: 24.0, + // height: 24.0, + // ), + // ], + // ), + // ), + + // Container( + // margin: EdgeInsets.only(top: 16.0), + // child: Row( + // children: [ + // Text( + // "换绑手机号", + // style: TextStyle( + // color: Color(0xFFF7FAFA), + // fontSize: 16.0, + // ), + // ), + // Spacer(), + // Text( + // "16677778888", + // style: TextStyle( + // color: Color(0xFFB7BECC), + // fontSize: 16.0, + // ), + // ), + // SizedBox(width: 8.0), + // Image.asset( + // getHomeImage("icon_in"), + // width: 24.0, + // height: 24.0, + // ), + // ], + // ), + // ), + // Container( + // margin: EdgeInsets.only(top: 16.0), + // child: Row( + // children: [ + // Text( + // "修改密码", + // style: TextStyle( + // color: Color(0xFFF7FAFA), + // fontSize: 16.0, + // ), + // ), + // Spacer(), + // Image.asset( + // getHomeImage("icon_in"), + // width: 24.0, + // height: 24.0, + // ), + // ], + // ), + // ), + // Container( + // margin: EdgeInsets.only(top: 16.0), + // child: Row( + // children: [ + // Text( + // "注销账号", + // style: TextStyle( + // color: Color(0xFFF7FAFA), + // fontSize: 16.0, + // ), + // ), + // Spacer(), + // Image.asset( + // getHomeImage("icon_in"), + // width: 24.0, + // height: 24.0, + // ), + // ], + // ), + // ), + Container( + margin: EdgeInsets.only(top: 0.0.sp, left: 16.0.sp), + child: Text( + "账号绑定", + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 16.0.sp, + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 16.0.sp), + child: Row( + children: [ + Text( + "已绑定手机号", + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 16.0.sp, + ), + ), + Spacer(), + Container( + alignment: Alignment.center, + width: 60.sp, + height: 28.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(14.0.sp), + border: Border.all( + width: 0.4.sp, + color: Colors.white, + ), + ), + child: GestureDetector( + onTap: (){ + Get.toNamed(AppRoutes.PhotoActivity); + }, + child:Text( + "换绑", + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 14.0.sp, + ), + )) ,) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 16.0.sp), + child: Row( + children: [ + Text( + "微信", + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 16.0.sp, + ), + ), + Spacer(), + Container( + alignment: Alignment.center, + width: 60.sp, + height: 28.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(14.0.sp), + border: Border.all( + width: 0.4.sp, + color: Colors.white, + ), + ), + child: Text( + "去绑定", + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 14.0.sp, + ), + )), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 16.0.sp), + child: Row( + children: [ + Text( + "邮箱", + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 16.0.sp, + ), + ), + Spacer(), + Container( + alignment: Alignment.center, + width: 60.sp, + height: 28.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(14.0.sp), + border: Border.all( + width: 0.4.sp, + color: Colors.white, + ), + ), + child: Text( + "去绑定", + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 14.0.sp, + ), + )), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 16.0.sp), + child: Text( + "温馨提示:完成账号绑定后,手机丢失或忘记密码也可以通过其他方式登录", + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 12.0.sp, + ), + ), + ), + Container( + margin: EdgeInsets.only( + top: 40.0.sp, left: 72.0.sp, right: 72.0.sp), + height: 42, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(21.0.sp), + color: Color(0xFF21BEAB), + ), + child: Center( + child: Text( + "退出登录", + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 16.0.sp, + ), + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/circle_app/lib/app/blacklist/binding.dart b/circle_app/lib/app/blacklist/binding.dart new file mode 100644 index 0000000..1904482 --- /dev/null +++ b/circle_app/lib/app/blacklist/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class BlacklistBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => BlacklistLogic()); + } +} diff --git a/circle_app/lib/app/blacklist/logic.dart b/circle_app/lib/app/blacklist/logic.dart new file mode 100644 index 0000000..114a54b --- /dev/null +++ b/circle_app/lib/app/blacklist/logic.dart @@ -0,0 +1,7 @@ +import 'package:get/get.dart'; + +import 'state.dart'; + +class BlacklistLogic extends GetxController { + final BlacklistState state = BlacklistState(); +} diff --git a/circle_app/lib/app/blacklist/state.dart b/circle_app/lib/app/blacklist/state.dart new file mode 100644 index 0000000..745d0fc --- /dev/null +++ b/circle_app/lib/app/blacklist/state.dart @@ -0,0 +1,5 @@ +class BlacklistState { + BlacklistState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/blacklist/view.dart b/circle_app/lib/app/blacklist/view.dart new file mode 100644 index 0000000..ea57c07 --- /dev/null +++ b/circle_app/lib/app/blacklist/view.dart @@ -0,0 +1,70 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import '../../components/my_app_bar.dart'; +import '../../util/util.dart'; +import 'logic.dart'; +import 'package:flutter/material.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; + +class BlacklistPage extends StatelessWidget { + BlacklistPage({Key? key}) : super(key: key); + + final logic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar(centerTitle: '黑名单',), + body: SafeArea( + child: SmartRefresher( + controller: _refreshController, + child: ListView.builder( + padding: EdgeInsets.all(16), + itemCount: itemCount, + itemBuilder: (context, index) { + return ListTile( + title: Text('Item $index'), + ); + }, + ), + onRefresh: _onRefresh, + onLoading: _onLoading, + ), + ),), + ); + } + + + + + + final RefreshController _refreshController = RefreshController(); + int itemCount = 20; + + void _onRefresh() async { + // Perform your refresh logic here + // For example, make an API call to fetch new data + await Future.delayed(Duration(seconds: 2)); + itemCount = 20; + _refreshController.refreshCompleted(); + } + + void _onLoading() async { + // Perform your loading logic here + // For example, make an API call to fetch more data + await Future.delayed(Duration(seconds: 2)); + itemCount += 10; + _refreshController.loadComplete(); + } + +} diff --git a/circle_app/lib/app/friendslist/binding.dart b/circle_app/lib/app/friendslist/binding.dart new file mode 100644 index 0000000..00536c9 --- /dev/null +++ b/circle_app/lib/app/friendslist/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class FriendslistBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => FriendslistLogic()); + } +} diff --git a/circle_app/lib/app/friendslist/logic.dart b/circle_app/lib/app/friendslist/logic.dart new file mode 100644 index 0000000..61ebfd1 --- /dev/null +++ b/circle_app/lib/app/friendslist/logic.dart @@ -0,0 +1,7 @@ +import 'package:get/get.dart'; + +import 'state.dart'; + +class FriendslistLogic extends GetxController { + final FriendslistState state = FriendslistState(); +} diff --git a/circle_app/lib/app/friendslist/state.dart b/circle_app/lib/app/friendslist/state.dart new file mode 100644 index 0000000..5c2bd6a --- /dev/null +++ b/circle_app/lib/app/friendslist/state.dart @@ -0,0 +1,5 @@ +class FriendslistState { + FriendslistState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/friendslist/view.dart b/circle_app/lib/app/friendslist/view.dart new file mode 100644 index 0000000..50e0f17 --- /dev/null +++ b/circle_app/lib/app/friendslist/view.dart @@ -0,0 +1,82 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; + +import '../../components/my_app_bar.dart'; +import '../../util/util.dart'; +import 'logic.dart'; + +class FriendslistPage extends StatelessWidget { + FriendslistPage({Key? key}) : super(key: key); + + final logic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + final type = Get.arguments as String; + + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar(centerTitle: _getTitleName(type),), + body: SafeArea( + child: SmartRefresher( + controller: _refreshController, + child: ListView.builder( + padding: EdgeInsets.all(16), + itemCount: itemCount, + itemBuilder: (context, index) { + return ListTile( + title: Text('Item $index'), + ); + }, + ), + onRefresh: _onRefresh, + onLoading: _onLoading, + ), + ),), + ); + } + + + + String _getTitleName(String type) { + switch (type) { + case "0": + return "我喜欢的"; + case "1": + return "喜欢我的"; + case "2": + return "最近访客"; + default: + return ""; + } + } + + + final RefreshController _refreshController = RefreshController(); + int itemCount = 20; + + void _onRefresh() async { + // Perform your refresh logic here + // For example, make an API call to fetch new data + await Future.delayed(Duration(seconds: 2)); + itemCount = 20; + _refreshController.refreshCompleted(); + } + + void _onLoading() async { + // Perform your loading logic here + // For example, make an API call to fetch more data + await Future.delayed(Duration(seconds: 2)); + itemCount += 10; + _refreshController.loadComplete(); + } +} diff --git a/circle_app/lib/app/help/binding.dart b/circle_app/lib/app/help/binding.dart new file mode 100644 index 0000000..215b641 --- /dev/null +++ b/circle_app/lib/app/help/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class HelpBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => HelpLogic()); + } +} diff --git a/circle_app/lib/app/help/logic.dart b/circle_app/lib/app/help/logic.dart new file mode 100644 index 0000000..b4c3f7c --- /dev/null +++ b/circle_app/lib/app/help/logic.dart @@ -0,0 +1,7 @@ +import 'package:get/get.dart'; + +import 'state.dart'; + +class HelpLogic extends GetxController { + final HelpState state = HelpState(); +} diff --git a/circle_app/lib/app/help/state.dart b/circle_app/lib/app/help/state.dart new file mode 100644 index 0000000..abaed48 --- /dev/null +++ b/circle_app/lib/app/help/state.dart @@ -0,0 +1,5 @@ +class HelpState { + HelpState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/help/view.dart b/circle_app/lib/app/help/view.dart new file mode 100644 index 0000000..cfc9271 --- /dev/null +++ b/circle_app/lib/app/help/view.dart @@ -0,0 +1,145 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../components/my_app_bar.dart'; +import '../../util/util.dart'; +import 'logic.dart'; + +class HelpPage extends StatelessWidget { + HelpPage({Key? key}) : super(key: key); + + final logic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: '帮助与反馈', + ), + body: SafeArea( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(top: 30.sp), + child: Center( + child: Text( + '04-10 19:50', + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 12.sp, + ), + ), + ), + ), + SizedBox(height: 16.sp), + Padding( + padding: EdgeInsets.only(left: 16.sp,right: 16.sp), + child: Row( + children: [ + Image.asset(getMineImage("im_feedback"),width: 32.sp,height: 32.sp,), + SizedBox(width: 8.sp), + Expanded( + child: Container( + height: 200, + padding: EdgeInsets.all(16), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.sp), + color: Color(0xFF2E2E3B), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '猜你想问', + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 14.sp, + ), + ), + SizedBox(height: 10.sp), + Expanded( + child: ListView.builder( + itemCount: /* Replace with your item count */ 0, + itemBuilder: (context, index) { + return /* Replace with your list item widget */; + }, + ), + ), + ], + ), + ), + ), + ], + ), + ), + Spacer(), + Padding( + padding: EdgeInsets.only(bottom: 30.sp), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TextButton.icon( + onPressed: () { + // Handle feedback button press + }, + icon: Image.asset(getMineImage("im_feedback_write"),width: 14.sp,height: 14.sp,), + label: Text( + '意见反馈', + style: TextStyle( + color: Colors.white, + fontSize: 14, + ), + ), + style: TextButton.styleFrom( + backgroundColor: Color(0xFF21BEAB), + padding: EdgeInsets.symmetric(horizontal: 16.sp, vertical: 4.sp), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20.sp), + ), + ), + ), + SizedBox(width: 10), + TextButton.icon( + onPressed: () { + // Handle contact service button press + }, + icon: Image.asset(getMineImage("im_service"),width: 14.sp,height: 14.sp,), + label: Text( + '联系客服', + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + ), + ), + style: TextButton.styleFrom( + backgroundColor: Color(0xFF21BEAB), + padding: EdgeInsets.symmetric(horizontal: 16.sp, vertical: 4.sp), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20.sp), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + } + + + +} diff --git a/circle_app/lib/app/home/view.dart b/circle_app/lib/app/home/view.dart index 9785199..eea85b7 100644 --- a/circle_app/lib/app/home/view.dart +++ b/circle_app/lib/app/home/view.dart @@ -1,9 +1,10 @@ -import 'package:circle_app/router/app_routers.dart'; +import 'package:circle_app/app/minefragment/view.dart'; import 'package:circle_app/util/util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import '../../router/app_routers.dart'; import 'logic.dart'; class HomePage extends StatelessWidget { @@ -15,7 +16,7 @@ class HomePage extends StatelessWidget { final List _tabs = [ Container(), Container(), - Container(), + MinefragmentPage(), ]; @override @@ -23,7 +24,7 @@ class HomePage extends StatelessWidget { return GetBuilder(builder: (HomeLogic controller) { return GestureDetector( onTap: () { - Get.toNamed(AppRoutes.Complete_materialPage); + // Get.toNamed(AppRoutes.Complete_materialPage); }, child: Scaffold( // backgroundColor: Color.fromRGBO(244, 245, 245, 1.0), diff --git a/circle_app/lib/app/minefragment/binding.dart b/circle_app/lib/app/minefragment/binding.dart new file mode 100644 index 0000000..ff37c98 --- /dev/null +++ b/circle_app/lib/app/minefragment/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class MinefragmentBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => MinefragmentLogic()); + } +} diff --git a/circle_app/lib/app/minefragment/logic.dart b/circle_app/lib/app/minefragment/logic.dart new file mode 100644 index 0000000..31ed51a --- /dev/null +++ b/circle_app/lib/app/minefragment/logic.dart @@ -0,0 +1,11 @@ +import 'package:get/get.dart'; + +import '../../router/app_routers.dart'; +import 'state.dart'; + +class MinefragmentLogic extends GetxController { + final MinefragmentState state = MinefragmentState(); + jumpSetUp(){ + Get.toNamed(AppRoutes.SetUpActivity); + } +} diff --git a/circle_app/lib/app/minefragment/state.dart b/circle_app/lib/app/minefragment/state.dart new file mode 100644 index 0000000..edf2a40 --- /dev/null +++ b/circle_app/lib/app/minefragment/state.dart @@ -0,0 +1,7 @@ +class MinefragmentState { + var hearUrl = "http://pics5.baidu.com/feed/622762d0f703918f751ba5e950ce8d915beec4c1.jpeg?token=ed435fd18c71cf7ca7a011acb70460f7"; + MinefragmentState() { + ///Initialize variables + } + +} diff --git a/circle_app/lib/app/minefragment/view.dart b/circle_app/lib/app/minefragment/view.dart new file mode 100644 index 0000000..54313e7 --- /dev/null +++ b/circle_app/lib/app/minefragment/view.dart @@ -0,0 +1,464 @@ +import 'package:circle_app/router/app_routers.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../util/util.dart'; +import 'logic.dart'; + +class MinefragmentPage extends StatelessWidget { + MinefragmentPage({Key? key}) : super(key: key); + + // final logic = Get.lazyPut(() => MinefragmentLogic()); + + // final state = Get.find().state; + + @override + Widget build(BuildContext context) { + double statusBarHeight = MediaQuery.of(context).padding.top; + return Scaffold( + body: Container( + width: Get.width, + height: Get.height, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Padding( + padding: EdgeInsets.only( + top: 20.0 + statusBarHeight, + left: 11.sp, + right: 11.sp, + ), + child: Column( + children: [ + _buildAvatarRow(), + _FriendsRow(), + Container( + child: Image( + image: AssetImage(getHomeImage("icon_vip")), + fit: BoxFit.fill, + ), + ), + _CircleLiveView(), + ], + ), + ), + ), + ); + } + + Widget _CircleLiveView() { + return Container( + child: Column( + children: [_CircleItemView(), _HelpItemView(), _SetUpItemView()], + ), + ); + } + + Widget _SetUpItemView() { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Get.toNamed(AppRoutes.SetUpActivity); + // controller.state.hearUrl + + }, + child: Container( + // color: Colors.red, + margin: EdgeInsets.only(top: 18), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Image( + image: AssetImage(getHomeImage("mine_setup")), + width: 24, + height: 24, + ), + SizedBox(width: 10), + Text( + "设置", + style: TextStyle(color: Colors.white), + ), + ], + ), + Row( + children: [ + Image( + image: AssetImage(getHomeImage("icon_in")), + width: 24, + height: 24, + ), + ], + ) + ], + ), + ), + ); + } + + Widget _HelpItemView() { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Get.toNamed(AppRoutes.HelpActivity); + // controller.state.hearUrl + + }, + child: Container( + margin: EdgeInsets.only(top: 18), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Image( + image: AssetImage(getHomeImage("mine_help")), + width: 24, + height: 24, + ), + SizedBox(width: 10), + Text( + "帮助与反馈", + style: TextStyle(color: Colors.white), + ), + ], + ), + Row( + children: [ + Image( + image: AssetImage(getHomeImage("icon_in")), + width: 24, + height: 24, + ), + ], + ) + ], + ), + ), + ); + } + + Widget _CircleItemView() { + return Container( + margin: EdgeInsets.only(top: 18), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Image( + image: AssetImage(getHomeImage("mine_circle")), + width: 24, + height: 24, + ), + SizedBox(width: 10), + Text( + "我的圈子", + style: TextStyle(color: Colors.white), + ), + ], + ), + Row( + children: [ + Text( + "加入了3个圈子", + style: TextStyle(color: Colors.white30), + ), + Image( + image: AssetImage(getHomeImage("icon_in")), + width: 24, + height: 24, + ), + ], + ) + ], + ), + ); + } + + Widget _FriendsRow() { + return Center( + child: Container( + width: Get.width, + height: 85, + margin: EdgeInsets.only(left: 30, right: 30), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + print("我喜欢的"); + Get.toNamed(AppRoutes.FriendsActivity,arguments: "0"); + }, + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "0", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.bold), + ), + SizedBox(height: 4.sp), + Text( + "我喜欢的", + style: TextStyle( + shadows: [ + Shadow( + color: Color(0x99FF00F8), + offset: Offset(2, 2), + blurRadius: 3, + ), + ], + color: Color.fromARGB(255, 247, 250, 250), + fontSize: 16.sp, + fontWeight: FontWeight.bold), + ), + ], + ), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + print("喜欢我的"); + Get.toNamed(AppRoutes.FriendsActivity,arguments: "1"); + }, + child: Stack( + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Container( + child: Text( + "0", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.bold), + ), + ), + ], + ), + SizedBox( + height: 4.sp, + width: 80.sp, + ), + Text( + "喜欢我的", + style: TextStyle( + shadows: [ + Shadow( + color: Color(0x99FF00F8), + offset: Offset(2, 2), + blurRadius: 3, + ), + ], + color: Color.fromARGB(255, 247, 250, 250), + fontSize: 16.sp, + fontWeight: FontWeight.bold), + ), + ], + ), + Positioned( + right: 0.sp, + top: 15.sp, + child: Text( + "+123", + style: TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)), + ), + ) + ], + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + print("最近来访"); + Get.toNamed(AppRoutes.FriendsActivity,arguments: "2"); + }, + child: Stack( + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Container( + child: Text( + "0", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.bold), + ), + ), + ], + ), + Container( + height: 4.sp, + width: 80.sp, + ), + Text( + "最近来访", + style: TextStyle( + shadows: [ + Shadow( + color: Color(0x99FF00F8), + offset: Offset(2, 2), + blurRadius: 3, + ), + ], + color: Color.fromARGB(255, 247, 250, 250), + fontSize: 16.sp, + fontWeight: FontWeight.bold), + ), + ], + ), + Positioned( + right: 0.sp, + top: 15.sp, + child: Text( + "+123", + style: TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)), + ), + ) + ], + ), + ), + + + ], + ), + ), + ); + } + + Widget _buildAvatarRow() { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Get.toNamed(AppRoutes.UserInfoActivity,arguments: ""); + }, + child: Container( + width: Get.width, + height: 65, + child: Row( + children: [ + Center( + child: _buildAvatar1(), + ), + Expanded( + child: Container( + padding: EdgeInsets.only(left: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildNameRow(), + SizedBox(height: 6.sp), + _buildInfoRow(), + ], + ), + ), + ), + ], + ), + ), + ); + } + + Widget _buildAvatar1() { + return ClipOval( + child: GestureDetector( + onTap: () { + // controller.state.hearUrl = + // 'https://book.flutterchina.club/assets/img/logo.png'; + // controller.update(); + }, + child: Image.network( + 'https://book.flutterchina.club/assets/img/logo.png', + width: 65, + height: 65, + ), + ), + ); + + } + + Widget _buildNameRow() { + return Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "name", + style: TextStyle( + color: Color.fromRGBO(247, 250, 250, 1.0), + fontSize: 16, + ), + ), + Row( + children: [ + Text( + "进入主页", + style: TextStyle( + color: Color.fromRGBO(247, 250, 250, 1.0), + fontSize: 16, + ), + ), + Image( + image: AssetImage(getHomeImage("icon_in")), + width: 44, + height: 18, + ), + ], + ), + ], + ), + ); + } + + Widget _buildInfoRow() { + return Row( + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: LinearGradient( + colors: [ + Color.fromRGBO(141, 255, 248, 1.0), + Color.fromRGBO(181, 211, 255, 1.0), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only(top: 2, bottom: 2, left: 10, right: 10), + child: Text( + "男,33,CD", + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ), + ), + SizedBox(width: 6), + Image( + image: AssetImage(getBaseImage("vip")), + width: 44, + height: 18, + ), + ], + ); + } +} diff --git a/circle_app/lib/app/photoinfo/binding.dart b/circle_app/lib/app/photoinfo/binding.dart new file mode 100644 index 0000000..97222be --- /dev/null +++ b/circle_app/lib/app/photoinfo/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class PhotoinfoBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => PhotoinfoLogic()); + } +} diff --git a/circle_app/lib/app/photoinfo/logic.dart b/circle_app/lib/app/photoinfo/logic.dart new file mode 100644 index 0000000..512353f --- /dev/null +++ b/circle_app/lib/app/photoinfo/logic.dart @@ -0,0 +1,7 @@ +import 'package:get/get.dart'; + +import 'state.dart'; + +class PhotoinfoLogic extends GetxController { + final PhotoinfoState state = PhotoinfoState(); +} diff --git a/circle_app/lib/app/photoinfo/state.dart b/circle_app/lib/app/photoinfo/state.dart new file mode 100644 index 0000000..5bb4356 --- /dev/null +++ b/circle_app/lib/app/photoinfo/state.dart @@ -0,0 +1,5 @@ +class PhotoinfoState { + PhotoinfoState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/photoinfo/view.dart b/circle_app/lib/app/photoinfo/view.dart new file mode 100644 index 0000000..f71a461 --- /dev/null +++ b/circle_app/lib/app/photoinfo/view.dart @@ -0,0 +1,286 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../components/my_app_bar.dart'; +import '../../util/util.dart'; +import 'logic.dart'; + +class PhotoinfoPage extends StatelessWidget { + PhotoinfoPage({Key? key}) : super(key: key); + + final logic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: '换绑手机号', + ), + body: Scaffold( + backgroundColor: Colors.transparent, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + left: 16.0.sp, + top: 16.0.sp, + right: 16.0.sp, + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.0.sp), + color: Color(0xff282733), + ), + height: 40.0.sp, + child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 16.0.sp, right: 10.sp), + child: Text( + "+86", + style: TextStyle( + color: Colors.white, + fontSize: 14.0.sp, + ), + )), + Expanded( + child: Container( + height: 32.sp, + alignment: Alignment.center, + child: TextField( + textAlignVertical: TextAlignVertical.center, + decoration: InputDecoration( + hintText: "请输入已绑定手机号", + hintStyle: TextStyle( + color: Colors.grey.shade300, + fontSize: 14.0, + ), + border: InputBorder.none, + ), + style: TextStyle( + color: Colors.white, + fontSize: 14.0, + height: 1.0, + ), + ), + ), + ) + ], + ), + ), + Container( + margin: EdgeInsets.fromLTRB(16.0, 20.0, 16.0, 0.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.0), + color: Color(0xff282733), + ), + height: 40.0, + child: Row( + children: [ + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 10.0.sp, right: 10.sp), + child: Image( + image: AssetImage(getMineImage("im_lock")), + width: 24.sp, + height: 24.sp, + ), + ), + Expanded( + child: Container( + height: 32.sp, + alignment: Alignment.center, + child: TextField( + textAlignVertical: TextAlignVertical.center, + decoration: InputDecoration( + hintText: "请输入密码", + hintStyle: TextStyle( + color: Colors.grey.shade300, + fontSize: 14.0, + ), + border: InputBorder.none, + ), + style: TextStyle( + color: Colors.white, + fontSize: 14.0, + height: 1.0, + ), + ), + ), + ) + ], + ), + ), + Container( + margin: + EdgeInsets.fromLTRB(16.0.sp, 20.0.sp, 16.0.sp, 0.0.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.0.sp), + color: Color(0xff282733), + ), + height: 40.0.sp, + child: Row( + children: [ + Padding( + padding: EdgeInsets.only(left: 16.0.sp,right: 10.sp), + child: Center( + child: Text( + "+86", + style: TextStyle( + color: Colors.white, + fontSize: 14.0.sp, + ), + ), + )), + Expanded( + child: Container( + height: 32.sp, + alignment: Alignment.center, + child: TextField( + textAlignVertical: TextAlignVertical.center, + decoration: InputDecoration( + hintText: "请输入新手机号", + hintStyle: TextStyle( + color: Colors.grey.shade300, + fontSize: 14.0, + ), + border: InputBorder.none, + ), + style: TextStyle( + color: Colors.white, + fontSize: 14.0, + height: 1.0, + ), + ), + ), + ) + ], + ), + ), + Row( + children: [ + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.fromLTRB( + 16.0.sp, 20.0.sp, 8.0.sp, 0.0.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.0.sp), + color: Color(0xff282733), + ), + height: 40.0.sp, + child: Row( + children: [ + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 10.0.sp, right: 10.sp), + child: Image( + image: AssetImage(getMineImage("im_shield")), + width: 24.sp, + height: 24.sp, + ), + ), + Expanded( + child: Container( + height: 32.sp, + alignment: Alignment.center, + child: TextField( + textAlignVertical: TextAlignVertical.center, + decoration: InputDecoration( + hintText: "请输入验证码", + hintStyle: TextStyle( + color: Colors.grey.shade300, + fontSize: 14.0, + ), + border: InputBorder.none, + ), + style: TextStyle( + color: Colors.white, + fontSize: 14.0, + height: 1.0, + ), + ), + ), + ) + ], + ), + ), + ), + Expanded( + flex: 2, + child: Container( + margin: EdgeInsets.fromLTRB( + 8.0.sp, 20.0.sp, 16.0.sp, 0.0.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.0.sp), + color: Color(0xff282733), + ), + height: 40.0.sp, + child: Center( + child: Text( + "获取验证码", + style: TextStyle( + color: Colors.grey.shade400, + fontSize: 14.0.sp, + ), + ), + ), + ), + ), + ], + ), + Padding( + padding: + EdgeInsets.fromLTRB(20.0.sp, 20.0.sp, 20.0.sp, 0.0.sp), + child: Text( + "温馨提示:换绑成功后,将退出软件使用新手机号重新登录,旧手机号无法登录此账号,但可以重新注册。", + style: TextStyle( + color: Colors.grey.shade400, + fontSize: 12.0.sp, + ), + ), + ), + GestureDetector( + onTap: () { + // Perform action on button press + }, + child: Container( + margin: + EdgeInsets.fromLTRB(72.0.sp, 40.0.sp, 72.0.sp, 0.0.sp), + height: 42.0.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(21.0.sp), + color: Colors.blue, + ), + child: Center( + child: Text( + "确定", + style: TextStyle( + color: Colors.white, + fontSize: 16.0.sp, + ), + ), + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/circle_app/lib/app/setup/binding.dart b/circle_app/lib/app/setup/binding.dart new file mode 100644 index 0000000..2d9b295 --- /dev/null +++ b/circle_app/lib/app/setup/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class SetupBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => SetupLogic()); + } +} diff --git a/circle_app/lib/app/setup/logic.dart b/circle_app/lib/app/setup/logic.dart new file mode 100644 index 0000000..b64326f --- /dev/null +++ b/circle_app/lib/app/setup/logic.dart @@ -0,0 +1,7 @@ +import 'package:get/get.dart'; + +import 'state.dart'; + +class SetupLogic extends GetxController { + final SetupState state = SetupState(); +} diff --git a/circle_app/lib/app/setup/state.dart b/circle_app/lib/app/setup/state.dart new file mode 100644 index 0000000..a1ffa82 --- /dev/null +++ b/circle_app/lib/app/setup/state.dart @@ -0,0 +1,5 @@ +class SetupState { + SetupState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/setup/view.dart b/circle_app/lib/app/setup/view.dart new file mode 100644 index 0000000..a5eac2c --- /dev/null +++ b/circle_app/lib/app/setup/view.dart @@ -0,0 +1,156 @@ +import 'package:circle_app/components/my_app_bar.dart'; +import 'package:circle_app/util/util.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../router/app_routers.dart'; +import 'logic.dart'; + + +class SetupPage extends StatelessWidget { + SetupPage({Key? key}) : super(key: key); + + final logic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar(centerTitle: '设置',), + body: SafeArea( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + // GestureDetector( + // onTap: () { + // + // }, + // child: Image.asset( + // getNavigatorImage("back"), // 将 @mipmap/icon_back 替换为相应的图像路径 + // width: 24, // 将 @dimen/dp_24 替换为相应的值 + // height: 24, // 将 @dimen/dp_24 替换为相应的值 + // ), + // ), + // Spacer(), + // Text( + // '设置', + // style: TextStyle( + // color: Color(0xFFF7FAFA), // 将 #fff7fafa 替换为相应的颜色值 + // fontSize: 18.sp, // 将 18sp 替换为相应的值 + // ), + // ), + // Spacer(), + ], + ), + SizedBox(height: 16.sp), // 将 @dimen/dp_16 替换为相应的值 + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Get.toNamed(AppRoutes.AccountActivity); + // controller.state.hearUrl + + }, + child: _buildItemRow('账号中心', getHomeImage("icon_in")), + ), + + SizedBox(height: 16.sp), + // _buildItemRow('隐私设置', getHomeImage("icon_in")), + // SizedBox(height: 16.sp), + // _buildItemRow('聊天设置', getHomeImage("icon_in")), + // SizedBox(height: 16.sp), + + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Get.toNamed(AppRoutes.BlackActivity); + }, + child: _buildItemRow('黑名单', getHomeImage("icon_in")), + ), + SizedBox(height: 16.sp), + // _buildItemRow('系统权限管理', getHomeImage("icon_in")), + // SizedBox(height: 16.sp), + _buildCacheItemRow('清除缓存', getHomeImage("icon_in")), + SizedBox(height: 16.sp), + + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Get.toNamed(AppRoutes.AboutAppActivity); + }, + child: _buildItemRow('关于圈子', getHomeImage("icon_in")), + ), + ], + ), + ),), + ); + } + + Widget _buildItemRow(String text, String imagePath) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 16.sp), // 将 @dimen/dp_16 替换为相应的值 + child: Row( + children: [ + Text( + text, + style: TextStyle( + color: Color(0xFFF7FAFA), // 将 #fff7fafa 替换为相应的颜色值 + fontSize: 16.sp, // 将 16sp 替换为相应的值 + ), + ), + Spacer(), + Image.asset( + imagePath, + width: 20.sp, // 将相应的值替换为图像的宽度 + height: 20.sp, // 将相应的值替换为图像的高度 + ), + ], + ), + ); + } + + Widget _buildCacheItemRow(String text, String imagePath) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 16.sp), // 将 @dimen/dp_16 替换为相应的值 + child: Row( + children: [ + Text( + text, + style: TextStyle( + color: Color(0xFFF7FAFA), // 将 #fff7fafa 替换为相应的颜色值 + fontSize: 16.sp, // 将 16sp 替换为相应的值 + ), + ), + Spacer(), + Text( + 'XXX', // 将 'XXX' 替换为相应的缓存大小值 + style: TextStyle( + color: Color(0xFFB7BECC), // 将 #ffb7becc 替换为相应的颜色值 + fontSize: 14.sp, // 将 14sp 替换为相应的值 + ), + ), + SizedBox(width: 8.sp), // 将 @dimen/dp_8 替换为相应的值 + Image.asset( + imagePath, + width: 20.sp, // 将相应的值替换为图像的宽度 + height: 20.sp, // 将相应的值替换为图像的高度 + ), + ], + ), + ); + } + + + + +} \ No newline at end of file diff --git a/circle_app/lib/app/userinfo/binding.dart b/circle_app/lib/app/userinfo/binding.dart new file mode 100644 index 0000000..fbf0755 --- /dev/null +++ b/circle_app/lib/app/userinfo/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class UserinfoBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => UserinfoLogic()); + } +} diff --git a/circle_app/lib/app/userinfo/logic.dart b/circle_app/lib/app/userinfo/logic.dart new file mode 100644 index 0000000..18bf7e3 --- /dev/null +++ b/circle_app/lib/app/userinfo/logic.dart @@ -0,0 +1,23 @@ +import 'package:get/get.dart'; +import 'package:image_picker/image_picker.dart'; + +import 'state.dart'; + +class UserinfoLogic extends GetxController { + final UserinfoState state = UserinfoState(); + final ImagePicker _picker = ImagePicker(); + Future getImageFile() async { + try { + final XFile? pickedFile = await _picker.pickImage( + source: ImageSource.gallery, + ); + // setState(() { + // _setImageFileListFromFile(pickedFile); + // }); + } catch (e) { + // setState(() { + // _pickImageError = e; + // }); + } + } +} diff --git a/circle_app/lib/app/userinfo/state.dart b/circle_app/lib/app/userinfo/state.dart new file mode 100644 index 0000000..dfcd77c --- /dev/null +++ b/circle_app/lib/app/userinfo/state.dart @@ -0,0 +1,5 @@ +class UserinfoState { + UserinfoState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/userinfo/view.dart b/circle_app/lib/app/userinfo/view.dart new file mode 100644 index 0000000..0a8ed3b --- /dev/null +++ b/circle_app/lib/app/userinfo/view.dart @@ -0,0 +1,532 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../components/my_app_bar.dart'; +import '../../util/util.dart'; +import 'logic.dart'; + +class UserinfoPage extends StatefulWidget { + @override + _MyTabbedScreenState createState() => _MyTabbedScreenState(); +} + +class _MyTabbedScreenState extends State + with SingleTickerProviderStateMixin { + late TabController _tabController; + + get data => null; + + @override + void initState() { + // TODO: implement initState + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } + + final logic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + var userId = Get.arguments ?? ""; + return GetBuilder(builder: (UserinfoLogic controller) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: '个人主页', + ), + body: Stack( + children: [ + Container( + child: buildContent(controller), + ), + Positioned( + bottom: 27.sp, + width: Get.width, + child: _MeInfoButton(userId), + ) + ], + ), + )); + }); + } + + Widget _MeInfoButton(String userId) { + if (userId == "1") { + return GestureDetector( + onTap: () { + showToast("完善资料"); + }, + child: Center( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, bottom: 10.sp, left: 55.sp, right: 55.sp), + child: Text( + "完善个人形象照", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ), + ); + } else { + return Container( + margin: EdgeInsets.only(left: 18.sp, right: 18.sp), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + showToast("鼓掌"); + _showBottomSheet(context); + }, + child: Image( + image: AssetImage(getMineImage("icon_like")), + width: 40.sp, + height: 40.sp, + ), + ), + GestureDetector( + onTap: () { + showToast("喜欢"); + }, + child: Container( + // height: 40, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17.sp), + gradient: LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, bottom: 10.sp, left: 52.sp, right: 52.sp), + child: Text( + "喜欢", + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + ), + ), + ), + ), + GestureDetector( + onTap: () { + showToast("私聊"); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17.sp), + gradient: LinearGradient( + colors: [ + Color(0x26FFFFFF), + Color(0x26FFFFFF), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, bottom: 10.sp, left: 52.sp, right: 52.sp), + child: Text( + "私聊", + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + ), + ), + ), + ) + ], + ), + ); + } + } + + Widget buildContent(UserinfoLogic controller) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 19.sp, vertical: 14.sp), + child: Column( + children: [ + Row( + children: [ + _headView(), + Flexible( + child: buildUserContainer(), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Text( + "name", + style: TextStyle( + color: Color.fromRGBO(247, 250, 250, 1.0), + fontSize: 16, + ), + ), + SizedBox(width: 10.sp), + _buildInfoRow(), + ], + ), + Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5.sp), + width: 10.sp, + height: 10.sp, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Color(0xFF00FFF4), + ), + ), + Text( + "在线·深圳", + style: TextStyle(color: Color(0xFF00FFF4)), + ) + ], + ), + ], + ), + Container( + // margin: EdgeInsets.only(top: 18.sp, bottom: 18.sp), + height: 59.sp, + child: ListView.builder( + itemCount: 8, + // 替换为实际的 item 数量 + scrollDirection: Axis.horizontal, + // 设置为水平方向 + padding: EdgeInsets.symmetric( vertical: 18.sp), + // 替换为实际的边距值 + itemBuilder: (context, index) { + return Container( + margin: EdgeInsets.only(right: 11.sp), // 替换为实际的 item 间距 + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.0), // 设置圆角半径 + border: Border.all( + color: Color(0xFF392D53), // 边框颜色 + width: 1.0, // 边框宽度 + ), + color: Color(0xFF392D53), + ), + child: Padding( + padding: EdgeInsets.only(top: 2.sp,bottom: 2.sp,left: 15.sp,right: 15.sp), + child: Center( + child: Text( + "圆角背景边框", + style: TextStyle( + fontSize: 11.0, + color: Colors.white, + ), + ),),), + ),// 替换为实际的列表项小部件 + ); + }, + ), + ), + Container( + alignment: Alignment.centerLeft, + height: 27.sp, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + TabBar( + isScrollable: true, + controller: _tabController, + indicatorColor: Color(0xFF00FFF4), + indicatorWeight: 2.sp, + labelColor: Color(0xFF00FFF4), + unselectedLabelColor: Color(0xB3FFFFFF), + indicatorSize: TabBarIndicatorSize.label, + tabs: [ + Tab( + text: "形象照", + ), + Tab(text: "喊话") + ], + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 2.sp, bottom: 2.sp, left: 12.sp, right: 12.sp), + child: Text( + "完成", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ], + )), + Container( + margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp), + child: Text( + "1314位圈友感兴趣,其中10位已催您更新", + style: TextStyle(color: Colors.white30), + )), + Expanded( + child: Container( + // color: Colors.blue, + child: TabBarView( + controller: _tabController, + children: [ + _imageAdapter(controller), + Text("喊话"), + ], + ), + )) + ], + ), + ); + } + + Widget _imageAdapter(UserinfoLogic controller) { + return GridView.builder( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, // 每行显示的项目数量 + ), + itemCount: 20, // 项目的总数量,包括固定图片和接口获取的项目 + itemBuilder: (BuildContext context, int index) { + if (index == 0) { + // 第一个项目,显示固定的图片 + return GestureDetector( + onTap: () { + controller.getImageFile(); + }, + child: Container( + margin: EdgeInsets.all(5.sp), + child: Image( + image: AssetImage(getMineImage("icon_img_add")), + ), + ), + ); + } else { + // 后续项目,根据接口获取数据 + // 假设通过接口获取到的数据存储在一个名为 data 的列表中 + // var itemData = data[index - 1]; // 减去第一个固定图片的索引 + return Container( + margin: EdgeInsets.all(5.sp), + child: Center( + child: _buildImageItem( + 'https://book.flutterchina.club/assets/img/logo.png'), + ), + ); + } + }, + ); + } + + Widget _buildInfoRow() { + return Row( + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: LinearGradient( + colors: [ + Color.fromRGBO(141, 255, 248, 1.0), + Color.fromRGBO(181, 211, 255, 1.0), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only(top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp), + child: Text( + "男,33,CD", + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ), + ), + SizedBox(width: 6.sp), + Image( + image: AssetImage(getBaseImage("vip")), + width: 44.sp, + height: 18.sp, + ), + ], + ); + } + + Widget buildUserContainer() { + return Container( + margin: EdgeInsets.symmetric(horizontal: 1.sp, vertical: 14.sp), + height: 58.sp, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getMineImage("icon_user_content")), + fit: BoxFit.fill, + ), + ), + child: Container( + margin: EdgeInsets.only(left: 24.sp), + child: Center( + child: Text( + '动物是灵性的动物是灵性的动物是灵性的动物是灵性的动物是灵性的动物是灵性的动物是灵性的,不同于植物。 你若孤独, 它陪伴你。在阳光的午后,蜷缩在你的...', + maxLines: 2, + style: TextStyle(color: Colors.white), + overflow: TextOverflow.ellipsis, + ), + ), + ), + ); + } + + Widget _headView() { + return Stack( + alignment: Alignment.center, + children: [ + Container( + width: 68.sp, + height: 68.sp, + decoration: BoxDecoration( + shape: BoxShape.circle, + gradient: LinearGradient( + colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + SizedBox( + width: 66.sp, + height: 66.sp, + child: _buildAvatar1(), + ) + ], + ); + } + + Widget _buildAvatar1() { + return ClipOval( + child: GestureDetector( + onTap: () {}, + child: Image.network( + 'https://book.flutterchina.club/assets/img/logo.png', + width: 66.sp, + height: 66.sp, + ), + ), + ); + } + + Widget _buildImageItem(String url) { + return Stack( + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(0.0), + child: GestureDetector( + onTap: () { + showToast("点击了图片"); + }, + child: Image.network( + url, + ), + ), + ), + Positioned( + top: 0, + right: 0, + child: GestureDetector( + onTap: () { + showToast("删除"); + }, + child: Image( + image: AssetImage(getMineImage("icon_img_del")), + width: 20.sp, + height: 20.sp, + ), + )) + ], + ); + } + + + + + void _showBottomSheet(BuildContext context) { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (BuildContext context) { + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(16.0), + topRight: Radius.circular(16.0), + ), + gradient: LinearGradient( + colors: [ + Color(0xFF4A3E5D), + Color(0xFF344143), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + + height: 118.0, + width: double.infinity, + child: Text( + '顶部圆角容器', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 20.0, + color: Colors.white, + ), + ), + ); + + }, + ); + } + +} diff --git a/circle_app/lib/router/app_pages.dart b/circle_app/lib/router/app_pages.dart index f6b7a0f..2bb4d52 100644 --- a/circle_app/lib/router/app_pages.dart +++ b/circle_app/lib/router/app_pages.dart @@ -1,9 +1,27 @@ +import 'package:circle_app/app/aboutapp/binding.dart'; +import 'package:circle_app/app/aboutapp/view.dart'; +import 'package:circle_app/app/account/binding.dart'; +import 'package:circle_app/app/account/view.dart'; +import 'package:circle_app/app/blacklist/binding.dart'; +import 'package:circle_app/app/friendslist/binding.dart'; +import 'package:circle_app/app/friendslist/view.dart'; +import 'package:circle_app/app/help/binding.dart'; +import 'package:circle_app/app/help/view.dart'; import 'package:circle_app/app/home/binding.dart'; import 'package:circle_app/app/home/view.dart'; +import 'package:circle_app/app/minefragment/binding.dart'; +import 'package:circle_app/app/minefragment/view.dart'; +import 'package:circle_app/app/photoinfo/binding.dart'; +import 'package:circle_app/app/photoinfo/view.dart'; +import 'package:circle_app/app/setup/binding.dart'; +import 'package:circle_app/app/setup/view.dart'; import 'package:circle_app/app/login/complete_material/binding.dart'; import 'package:circle_app/app/login/complete_material/view.dart'; +import 'package:circle_app/app/userinfo/binding.dart'; +import 'package:circle_app/app/userinfo/view.dart'; import 'package:get/get_navigation/src/routes/get_route.dart'; +import '../app/blacklist/view.dart'; import 'app_routers.dart'; class AppPages { @@ -20,5 +38,50 @@ class AppPages { binding: Complete_materialBinding(), ), + GetPage( + name: AppRoutes.MineFragment, + page: () => MinefragmentPage(), + binding: MinefragmentBinding(), + ), + GetPage( + name: AppRoutes.SetUpActivity, + page: () => SetupPage(), + binding: SetupBinding(), + ), + GetPage( + name: AppRoutes.AccountActivity, + page: () => AccountPage(), + binding: AccountBinding(), + ), + GetPage( + name: AppRoutes.PhotoActivity, + page: () => PhotoinfoPage(), + binding: PhotoinfoBinding(), + ), + GetPage( + name: AppRoutes.AboutAppActivity, + page: () => AboutappPage(), + binding: AboutappBinding(), + ), + GetPage( + name: AppRoutes.BlackActivity, + page: () => BlacklistPage(), + binding: BlacklistBinding(), + ), + GetPage( + name: AppRoutes.HelpActivity, + page: () => HelpPage(), + binding: HelpBinding(), + ), + GetPage( + name: AppRoutes.FriendsActivity, + page: () => FriendslistPage(), + binding: FriendslistBinding(), + ), + GetPage( + name: AppRoutes.UserInfoActivity, + page: () => UserinfoPage(), + binding: UserinfoBinding(), + ), ]; } diff --git a/circle_app/lib/router/app_routers.dart b/circle_app/lib/router/app_routers.dart index bc34428..5d3c8c8 100644 --- a/circle_app/lib/router/app_routers.dart +++ b/circle_app/lib/router/app_routers.dart @@ -1,4 +1,13 @@ abstract class AppRoutes { static const Home = '/home'; static const Complete_materialPage = '/Complete_materialPage'; + static const MineFragment = '/home/minefragment'; + static const SetUpActivity = '/user/SetUpActivity'; + static const AccountActivity = '/user/AccountActivity'; + static const PhotoActivity = '/user/PhotoActivity'; + static const AboutAppActivity = '/user/AboutAppActivity'; + static const BlackActivity = '/user/BlackActivity'; + static const HelpActivity = '/user/HelpActivity'; + static const FriendsActivity = '/user/FriendsActivity'; + static const UserInfoActivity = '/user/UserInfoActivity'; } \ No newline at end of file diff --git a/circle_app/lib/util/util.dart b/circle_app/lib/util/util.dart index 3e142ec..35b4cd8 100644 --- a/circle_app/lib/util/util.dart +++ b/circle_app/lib/util/util.dart @@ -29,6 +29,10 @@ String getMsgImage(String image) { return '${Values.msg_images}${image}.png'; } +String getNavigatorImage(String image) { + return '${Values.navigator_images}${image}.png'; +} + String getTabbarImage(String image) { return '${Values.tabbar_images}${image}.png'; } diff --git a/circle_app/lib/view/hometab/binding.dart b/circle_app/lib/view/hometab/binding.dart new file mode 100644 index 0000000..5c218fc --- /dev/null +++ b/circle_app/lib/view/hometab/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class HometabBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => HometabLogic()); + } +} diff --git a/circle_app/lib/view/hometab/logic.dart b/circle_app/lib/view/hometab/logic.dart new file mode 100644 index 0000000..4bdb73c --- /dev/null +++ b/circle_app/lib/view/hometab/logic.dart @@ -0,0 +1,7 @@ +import 'package:get/get.dart'; + +import 'state.dart'; + +class HometabLogic extends GetxController { + final HometabState state = HometabState(); +} diff --git a/circle_app/lib/view/hometab/state.dart b/circle_app/lib/view/hometab/state.dart new file mode 100644 index 0000000..20f8d24 --- /dev/null +++ b/circle_app/lib/view/hometab/state.dart @@ -0,0 +1,5 @@ +class HometabState { + HometabState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/view/hometab/view.dart b/circle_app/lib/view/hometab/view.dart new file mode 100644 index 0000000..35d5fea --- /dev/null +++ b/circle_app/lib/view/hometab/view.dart @@ -0,0 +1,51 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:circle_app/app/minefragment/view.dart'; + +import 'logic.dart'; + +class HometabPage extends StatefulWidget { + HometabPage({Key? key}) : super(key: key); + + // final logic = Get.find(); + // final state = Get.find().state; + + @override + _TabsState createState() => _TabsState(); + } + class _TabsState extends State{ + int _currentIndex = 0; + List _pageList = [ + MinefragmentPage(), + MinefragmentPage(), + MinefragmentPage(), + ]; + @override + Widget build(BuildContext context) { + // TODO: implement build + return Scaffold( + + body: this._pageList[this._currentIndex], + bottomNavigationBar: BottomNavigationBar( + currentIndex: this._currentIndex, + onTap: (int index){ + setState(() { + this._currentIndex = index; + }); + }, + iconSize: 30, + fixedColor: Colors.red, + type: BottomNavigationBarType.fixed, + items: [ + BottomNavigationBarItem(icon: Icon(Icons.home),label: ''), + BottomNavigationBarItem(icon: Icon(Icons.home), label: ''), + BottomNavigationBarItem(icon: Icon(Icons.home), label: ''), + ], + ), + + ); + + + } + } + diff --git a/circle_app/pubspec.yaml b/circle_app/pubspec.yaml index 434ab4c..23355f6 100644 --- a/circle_app/pubspec.yaml +++ b/circle_app/pubspec.yaml @@ -39,6 +39,12 @@ dependencies: flutter_screenutil: ^5.6.0 image_picker: ^0.8.6 fluttertoast: ^8.1.0 + # 清除缓存 + flutter_cache_manager: ^3.2.0 + # 跳转web + url_launcher: ^6.0.0 + # 下拉刷新 + pull_to_refresh: ^2.0.0 dev_dependencies: flutter_test: @@ -70,6 +76,7 @@ flutter: - assets/images/login/ - assets/images/navigator/ - assets/images/tabbar/ + - assets/images/mine/ # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see