|
@@ -3,7 +3,6 @@
|
|
|
import 'dart:async';
|
|
|
import 'dart:io';
|
|
|
|
|
|
-import 'package:expandable/expandable.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_windowmanager/flutter_windowmanager.dart';
|
|
|
import 'package:photos/core/configuration.dart';
|
|
@@ -15,6 +14,7 @@ import 'package:photos/services/user_service.dart';
|
|
|
import 'package:photos/ui/account/sessions_page.dart';
|
|
|
import 'package:photos/ui/common/loading_widget.dart';
|
|
|
import 'package:photos/ui/components/captioned_text_widget.dart';
|
|
|
+import 'package:photos/ui/components/expandable_menu_item_widget.dart';
|
|
|
import 'package:photos/ui/components/menu_item_widget.dart';
|
|
|
import 'package:photos/ui/settings/common_settings.dart';
|
|
|
|
|
@@ -29,7 +29,6 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
|
|
|
final _config = Configuration.instance;
|
|
|
|
|
|
StreamSubscription<TwoFactorStatusChangeEvent> _twoFactorStatusChangeEvent;
|
|
|
- final expandableController = ExpandableController(initialExpanded: false);
|
|
|
|
|
|
@override
|
|
|
void initState() {
|
|
@@ -45,29 +44,15 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
|
|
|
@override
|
|
|
void dispose() {
|
|
|
_twoFactorStatusChangeEvent.cancel();
|
|
|
- expandableController.dispose();
|
|
|
super.dispose();
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- return ExpandablePanel(
|
|
|
- header: MenuItemWidget(
|
|
|
- captionedTextWidget: const CaptionedTextWidget(
|
|
|
- text: "Security",
|
|
|
- makeTextBold: true,
|
|
|
- ),
|
|
|
- isHeaderOfExpansion: true,
|
|
|
- leadingIcon: Icons.local_police_outlined,
|
|
|
- trailingIcon: Icons.expand_more,
|
|
|
- menuItemColor:
|
|
|
- Theme.of(context).colorScheme.enteTheme.colorScheme.fillFaint,
|
|
|
- expandableController: expandableController,
|
|
|
- ),
|
|
|
- collapsed: const SizedBox.shrink(),
|
|
|
- expanded: _getSectionOptions(context),
|
|
|
- theme: getExpandableTheme(context),
|
|
|
- controller: expandableController,
|
|
|
+ return ExpandableMenuItemWidget(
|
|
|
+ title: "Security",
|
|
|
+ selectionOptionsWidget: _getSectionOptions(context),
|
|
|
+ leadingIcon: Icons.local_police_outlined,
|
|
|
);
|
|
|
}
|
|
|
|