🐛 Fixes and optimization in programs
This commit is contained in:
parent
9cc577adbe
commit
d7359cfd0d
@ -9,6 +9,7 @@ import 'package:surface/providers/sn_network.dart';
|
||||
import 'package:surface/types/account.dart';
|
||||
import 'package:surface/widgets/dialog.dart';
|
||||
import 'package:surface/widgets/loading_indicator.dart';
|
||||
import 'package:surface/widgets/markdown_content.dart';
|
||||
import 'package:surface/widgets/navigation/app_scaffold.dart';
|
||||
|
||||
class AccountProgramScreen extends StatefulWidget {
|
||||
@ -86,14 +87,17 @@ class _AccountProgramScreenState extends State<AccountProgramScreen> {
|
||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||
onTap: () {
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
builder: (context) => _ProgramJoinPopup(
|
||||
program: ele,
|
||||
isJoined: _programMembers
|
||||
.any((ele) => ele.programId == ele.id),
|
||||
isJoined:
|
||||
_programMembers.any((e) => e.programId == ele.id),
|
||||
),
|
||||
).then((value) {
|
||||
if (value == true) {
|
||||
_fetchProgramMembers();
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Column(
|
||||
@ -137,7 +141,7 @@ class _AccountProgramScreenState extends State<AccountProgramScreen> {
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
if (_programMembers
|
||||
.any((ele) => ele.programId == ele.id))
|
||||
.any((e) => e.programId == ele.id))
|
||||
Text('accountProgramAlreadyJoined'.tr())
|
||||
.opacity(0.75),
|
||||
],
|
||||
@ -205,7 +209,10 @@ class _ProgramJoinPopupState extends State<_ProgramJoinPopup> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
return SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.75,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
@ -240,11 +247,7 @@ class _ProgramJoinPopupState extends State<_ProgramJoinPopup> {
|
||||
widget.program.name,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
).bold(),
|
||||
Text(
|
||||
widget.program.description,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
MarkdownTextContent(content: widget.program.description),
|
||||
const Gap(8),
|
||||
Text(
|
||||
'accountProgramJoinRequirements',
|
||||
@ -278,7 +281,10 @@ class _ProgramJoinPopupState extends State<_ProgramJoinPopup> {
|
||||
),
|
||||
],
|
||||
).padding(horizontal: 24),
|
||||
Gap(MediaQuery.of(context).padding.bottom),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ import 'package:gap/gap.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:material_symbols_icons/symbols.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:responsive_framework/responsive_framework.dart';
|
||||
import 'package:styled_widget/styled_widget.dart';
|
||||
import 'package:surface/providers/channel.dart';
|
||||
import 'package:surface/providers/config.dart';
|
||||
@ -48,17 +47,6 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
|
||||
final nav = context.watch<NavigationProvider>();
|
||||
final cfg = context.watch<ConfigProvider>();
|
||||
|
||||
final routeName = GoRouter.of(context)
|
||||
.routerDelegate
|
||||
.currentConfiguration
|
||||
.last
|
||||
.route
|
||||
.name;
|
||||
final showNavButtons = cfg.hideBottomNav ||
|
||||
!(nav.showBottomNavScreen.contains(routeName)
|
||||
? ResponsiveBreakpoints.of(context).smallerOrEqualTo(MOBILE)
|
||||
: false);
|
||||
|
||||
final backgroundColor = cfg.drawerIsExpanded ? Colors.transparent : null;
|
||||
|
||||
return ListenableBuilder(
|
||||
@ -67,7 +55,8 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
|
||||
return Drawer(
|
||||
elevation: widget.elevation,
|
||||
backgroundColor: backgroundColor,
|
||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(0))),
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(0))),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@ -92,7 +81,6 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
|
||||
Expanded(
|
||||
child: _DrawerContentList(),
|
||||
),
|
||||
if (showNavButtons)
|
||||
Row(
|
||||
spacing: 8,
|
||||
children:
|
||||
@ -104,9 +92,7 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
|
||||
child: IconButton(
|
||||
icon: ele.icon,
|
||||
color: nav.currentIndex == idx
|
||||
? Theme.of(context)
|
||||
.colorScheme
|
||||
.onPrimaryContainer
|
||||
? Theme.of(context).colorScheme.onPrimaryContainer
|
||||
: Theme.of(context).colorScheme.onSurface,
|
||||
style: ButtonStyle(
|
||||
backgroundColor: WidgetStatePropertyAll(
|
||||
|
Loading…
x
Reference in New Issue
Block a user