Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aff2afd5b0 | ||
|
|
27efd05038 | ||
|
|
c87a6756db | ||
|
|
f4c5369792 | ||
|
|
8687bbb86a | ||
|
|
1a35899c41 | ||
|
|
8ebc6e1928 | ||
|
|
e9505b37d1 |
@ -30,11 +30,18 @@ android {
|
|||||||
versionName = flutter.versionName
|
versionName = flutter.versionName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile file('/home/ubuntu/banxiang-release.jks')
|
||||||
|
storePassword 'banxiang2026'
|
||||||
|
keyAlias 'banxiang'
|
||||||
|
keyPassword 'banxiang2026'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
// TODO: Add your own signing config for the release build.
|
signingConfig = signingConfigs.release
|
||||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
|
||||||
signingConfig = signingConfigs.debug
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
45
lib/screens/about_screen.dart
Normal file
45
lib/screens/about_screen.dart
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class AboutScreen extends StatelessWidget {
|
||||||
|
const AboutScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('关于'),
|
||||||
|
),
|
||||||
|
body: const Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'伴享',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 28,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 16),
|
||||||
|
Text(
|
||||||
|
'当前版本: 1.1.9+11',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 16),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 32),
|
||||||
|
child: Text(
|
||||||
|
'伴享 — 专为银发族打造的社交平台',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(fontSize: 16),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,10 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||||
import 'publish_screen.dart';
|
|
||||||
import 'activity_detail_screen.dart';
|
import 'activity_detail_screen.dart';
|
||||||
import 'friends_screen.dart';
|
|
||||||
import 'messages_screen.dart';
|
|
||||||
import 'profile_screen.dart';
|
|
||||||
|
|
||||||
class ActivityListScreen extends StatefulWidget {
|
class ActivityListScreen extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
@ -12,8 +8,6 @@ class ActivityListScreen extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ActivityListScreenState extends State<ActivityListScreen> {
|
class _ActivityListScreenState extends State<ActivityListScreen> {
|
||||||
int _selectedIndex = 0;
|
|
||||||
final _feedKey = GlobalKey<RefreshIndicatorState>();
|
|
||||||
String? _selectedTime;
|
String? _selectedTime;
|
||||||
|
|
||||||
// 模拟活动数据
|
// 模拟活动数据
|
||||||
@ -82,46 +76,13 @@ class _ActivityListScreenState extends State<ActivityListScreen> {
|
|||||||
await Future.delayed(const Duration(milliseconds: 200));
|
await Future.delayed(const Duration(milliseconds: 200));
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onItemTapped(int index) {
|
|
||||||
if (index == 0 && _selectedIndex == 0) {
|
|
||||||
_feedKey.currentState?.show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (index == 2) {
|
|
||||||
// 中间按钮 - 跳转到发布页面
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) => PublishScreen()),
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (index == 1) {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) => const FriendsScreen()),
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (index == 3 || index == 4) {
|
|
||||||
if (_selectedIndex != index) {
|
|
||||||
setState(() {
|
|
||||||
_selectedIndex = index;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (_selectedIndex != index) {
|
|
||||||
setState(() {
|
|
||||||
_selectedIndex = index;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Container(
|
||||||
backgroundColor: const Color(0xFFFFF8F0),
|
color: const Color(0xFFFFF8F0),
|
||||||
appBar: AppBar(
|
child: Column(
|
||||||
|
children: [
|
||||||
|
AppBar(
|
||||||
title: Text('伴享', style: TextStyle(fontWeight: FontWeight.bold)),
|
title: Text('伴享', style: TextStyle(fontWeight: FontWeight.bold)),
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
actions: [
|
actions: [
|
||||||
@ -135,28 +96,15 @@ class _ActivityListScreenState extends State<ActivityListScreen> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: _buildBody(),
|
Expanded(child: _buildFeed()),
|
||||||
bottomNavigationBar: _buildBottomNavigationBar(),
|
],
|
||||||
floatingActionButton: _buildFloatingActionButton(),
|
),
|
||||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBody() {
|
|
||||||
switch (_selectedIndex) {
|
|
||||||
case 3:
|
|
||||||
return const MessagesScreen();
|
|
||||||
case 4:
|
|
||||||
return const ProfileScreen();
|
|
||||||
default:
|
|
||||||
return _buildFeed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildFeed() {
|
Widget _buildFeed() {
|
||||||
final filteredActivities = _getFilteredActivities();
|
final filteredActivities = _getFilteredActivities();
|
||||||
return RefreshIndicator(
|
return RefreshIndicator(
|
||||||
key: _feedKey,
|
|
||||||
onRefresh: _refreshActivities,
|
onRefresh: _refreshActivities,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
@ -375,91 +323,4 @@ class _ActivityListScreenState extends State<ActivityListScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBottomNavigationBar() {
|
|
||||||
return Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.black.withOpacity(0.05),
|
|
||||||
blurRadius: 10,
|
|
||||||
offset: Offset(0, -2),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: SafeArea(
|
|
||||||
child: Container(
|
|
||||||
height: 60,
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
_buildNavItem(0, Icons.home, '首页'),
|
|
||||||
_buildNavItem(1, Icons.people, '好友'),
|
|
||||||
SizedBox(width: 60), // 中间按钮占位
|
|
||||||
_buildNavItem(3, Icons.message, '消息'),
|
|
||||||
_buildNavItem(4, Icons.person, '我的'),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildNavItem(int index, IconData icon, String label) {
|
|
||||||
final isSelected = _selectedIndex == index;
|
|
||||||
return Expanded(
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () => _onItemTapped(index),
|
|
||||||
behavior: HitTestBehavior.opaque,
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
icon,
|
|
||||||
color: isSelected ? Color(0xFFFF6B35) : Color(0xFF999999),
|
|
||||||
size: 24,
|
|
||||||
),
|
|
||||||
SizedBox(height: 4),
|
|
||||||
Text(
|
|
||||||
label,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 11,
|
|
||||||
color: isSelected ? Color(0xFFFF6B35) : Color(0xFF999999),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildFloatingActionButton() {
|
|
||||||
return Container(
|
|
||||||
width: 56,
|
|
||||||
height: 56,
|
|
||||||
margin: EdgeInsets.only(top: 30),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
gradient: LinearGradient(
|
|
||||||
colors: [Color(0xFFFF6B35), Color(0xFFFFB84D)],
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Color(0xFFFF6B35).withOpacity(0.4),
|
|
||||||
blurRadius: 12,
|
|
||||||
offset: Offset(0, 4),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Material(
|
|
||||||
color: Colors.transparent,
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () => _onItemTapped(2),
|
|
||||||
customBorder: CircleBorder(),
|
|
||||||
child: Icon(Icons.add, color: Colors.white, size: 28),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'home_screen.dart';
|
import 'activity_list_screen.dart';
|
||||||
|
import 'friends_screen.dart';
|
||||||
import 'services_screen.dart';
|
import 'services_screen.dart';
|
||||||
import 'ai_chat_screen.dart';
|
import 'ai_chat_screen.dart';
|
||||||
import 'messages_screen.dart';
|
import 'messages_screen.dart';
|
||||||
import 'profile_screen.dart';
|
import 'profile_screen.dart';
|
||||||
|
import 'create_activity_screen.dart';
|
||||||
|
|
||||||
class MainScreen extends StatefulWidget {
|
class MainScreen extends StatefulWidget {
|
||||||
const MainScreen({super.key});
|
const MainScreen({super.key});
|
||||||
@ -14,8 +16,9 @@ class MainScreen extends StatefulWidget {
|
|||||||
class _MainScreenState extends State<MainScreen> {
|
class _MainScreenState extends State<MainScreen> {
|
||||||
int _currentIndex = 0;
|
int _currentIndex = 0;
|
||||||
|
|
||||||
final _screens = const [
|
final _screens = [
|
||||||
HomeScreen(),
|
ActivityListScreen(),
|
||||||
|
FriendsScreen(),
|
||||||
ServicesScreen(),
|
ServicesScreen(),
|
||||||
AiChatScreen(),
|
AiChatScreen(),
|
||||||
MessagesScreen(),
|
MessagesScreen(),
|
||||||
@ -26,11 +29,17 @@ class _MainScreenState extends State<MainScreen> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: IndexedStack(index: _currentIndex, children: _screens),
|
body: IndexedStack(index: _currentIndex, children: _screens),
|
||||||
|
floatingActionButton: _buildGlobalFab(),
|
||||||
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||||
bottomNavigationBar: BottomNavigationBar(
|
bottomNavigationBar: BottomNavigationBar(
|
||||||
|
type: BottomNavigationBarType.fixed,
|
||||||
currentIndex: _currentIndex,
|
currentIndex: _currentIndex,
|
||||||
onTap: (i) => setState(() => _currentIndex = i),
|
onTap: (i) => setState(() => _currentIndex = i),
|
||||||
|
selectedItemColor: const Color(0xFFFF6B35),
|
||||||
|
unselectedItemColor: const Color(0xFF999999),
|
||||||
items: const [
|
items: const [
|
||||||
BottomNavigationBarItem(icon: Icon(Icons.home_outlined), activeIcon: Icon(Icons.home), label: '首页'),
|
BottomNavigationBarItem(icon: Icon(Icons.home_outlined), activeIcon: Icon(Icons.home), label: '首页'),
|
||||||
|
BottomNavigationBarItem(icon: Icon(Icons.people_outline), activeIcon: Icon(Icons.people), label: '好友'),
|
||||||
BottomNavigationBarItem(icon: Icon(Icons.grid_view_outlined), activeIcon: Icon(Icons.grid_view), label: '服务'),
|
BottomNavigationBarItem(icon: Icon(Icons.grid_view_outlined), activeIcon: Icon(Icons.grid_view), label: '服务'),
|
||||||
BottomNavigationBarItem(icon: Icon(Icons.smart_toy_outlined), activeIcon: Icon(Icons.smart_toy), label: 'AI管家'),
|
BottomNavigationBarItem(icon: Icon(Icons.smart_toy_outlined), activeIcon: Icon(Icons.smart_toy), label: 'AI管家'),
|
||||||
BottomNavigationBarItem(icon: Icon(Icons.message_outlined), activeIcon: Icon(Icons.message), label: '消息'),
|
BottomNavigationBarItem(icon: Icon(Icons.message_outlined), activeIcon: Icon(Icons.message), label: '消息'),
|
||||||
@ -39,4 +48,40 @@ class _MainScreenState extends State<MainScreen> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildGlobalFab() {
|
||||||
|
return Container(
|
||||||
|
width: 56,
|
||||||
|
height: 56,
|
||||||
|
margin: const EdgeInsets.only(top: 30),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
gradient: const LinearGradient(
|
||||||
|
colors: [Color(0xFFFF6B35), Color(0xFFFFB84D)],
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: const Color(0xFFFF6B35).withOpacity(0.35),
|
||||||
|
blurRadius: 12,
|
||||||
|
offset: const Offset(0, 4),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (_) => CreateActivityScreen()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
customBorder: const CircleBorder(),
|
||||||
|
child: const Icon(Icons.add, color: Colors.white, size: 28),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'dart:io';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
|
import 'about_screen.dart';
|
||||||
import 'profile_setup_screen.dart';
|
import 'profile_setup_screen.dart';
|
||||||
|
|
||||||
class ProfileScreen extends StatefulWidget {
|
class ProfileScreen extends StatefulWidget {
|
||||||
@ -127,6 +128,17 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
// 关于入口
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.info_outline),
|
||||||
|
title: const Text('关于'),
|
||||||
|
trailing: const Icon(Icons.chevron_right),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(builder: (_) => const AboutScreen()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(24, 0, 24, 24),
|
padding: const EdgeInsets.fromLTRB(24, 0, 24, 24),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
name: banxiang_app
|
name: banxiang_app
|
||||||
description: 伴享
|
description: 伴享
|
||||||
version: 1.1.8+10
|
version: 1.1.9+11
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.0.0 <4.0.0'
|
sdk: '>=3.0.0 <4.0.0'
|
||||||
|
|||||||
BIN
releases/banxiang-v1.2.0-about.apk
Normal file
BIN
releases/banxiang-v1.2.0-about.apk
Normal file
Binary file not shown.
BIN
releases/banxiang-v1.2.0-bugfix.apk
Normal file
BIN
releases/banxiang-v1.2.0-bugfix.apk
Normal file
Binary file not shown.
BIN
releases/banxiang-v1.2.0-navfix.apk
Normal file
BIN
releases/banxiang-v1.2.0-navfix.apk
Normal file
Binary file not shown.
13
scripts/version_check.sh
Executable file
13
scripts/version_check.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 读取 pubspec.yaml 中的 version 字段
|
||||||
|
VERSION=$(grep "^version:" pubspec.yaml | sed 's/version: *//' | tr -d ' ')
|
||||||
|
|
||||||
|
# 检查 version 格式是否符合 x.x.x+x(用正则)
|
||||||
|
if [[ ! $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+\+[0-9]+$ ]]; then
|
||||||
|
echo "错误: version 格式不符合 x.x.x+x"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 输出格式:当前版本: x.x.x+x
|
||||||
|
echo "当前版本: $VERSION"
|
||||||
Loading…
Reference in New Issue
Block a user