新增"更多"功能

This commit is contained in:
jasonchenwork 2025-06-03 13:01:33 +08:00
parent 8fe8e7113c
commit a6123b506f
2 changed files with 45 additions and 10 deletions

View File

@ -5,6 +5,7 @@ import 'package:communityapp/visitor.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'reapair.dart'; import 'reapair.dart';
import 'activity.dart'; import 'activity.dart';
import 'announcement.dart';
class HomeContentPage extends StatelessWidget { class HomeContentPage extends StatelessWidget {
const HomeContentPage({super.key}); const HomeContentPage({super.key});
@ -59,7 +60,7 @@ class HomeContentPage extends StatelessWidget {
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
_announcementSection(), _announcementSection(context),
_quickMenuSection(context), _quickMenuSection(context),
_adCarousel(), _adCarousel(),
_marqueeNotice(), _marqueeNotice(),
@ -71,21 +72,56 @@ class HomeContentPage extends StatelessWidget {
} }
// 📢 // 📢
static Widget _announcementSection() { static Widget _announcementSection(BuildContext context) {
return Padding( return Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const Text( Row(
'📢 重要公告', children: [
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), const Text(
'📢 重要公告',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
const Spacer(),
TextButton(
onPressed: () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
builder: (_) => const AnnouncementWrapper(),
);
},
style: OutlinedButton.styleFrom(
foregroundColor: Colors.blue,
side: const BorderSide(color: Colors.blue), //
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20), //
),
padding: const EdgeInsets.symmetric(
horizontal: 12,
vertical: 6,
), //
minimumSize: const Size(0, 0), //
tapTargetSize: MaterialTapTargetSize.shrinkWrap, //
),
child: const Text(
'更多',
style: TextStyle(fontSize: 14), //
),
),
],
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
Card( Padding(
child: ListTile( padding: const EdgeInsets.symmetric(horizontal: 16),
title: const Text('4/20 水塔清洗通知'), child: Card(
subtitle: const Text('本週六早上9:00至下午3:00進行清洗請提前儲水。'), child: ListTile(
title: const Text('4/20 水塔清洗通知'),
subtitle: const Text('本週六早上9:00至下午3:00進行清洗請提前儲水。'),
),
), ),
), ),
], ],

View File

@ -157,7 +157,6 @@ class PersonalPage extends StatelessWidget {
right: 0, right: 0,
child: OutlinedButton( child: OutlinedButton(
onPressed: () { onPressed: () {
// TODO:
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => const FeedbackPage()), MaterialPageRoute(builder: (context) => const FeedbackPage()),