Fixes and improvements

This commit is contained in:
Juan Gilsanz Polo 2023-04-13 02:05:00 +02:00
parent 38172a2c1c
commit e77c31b367

View file

@ -21,8 +21,6 @@ class ManagementModal extends StatefulWidget {
}
class _ManagementModalState extends State<ManagementModal> with SingleTickerProviderStateMixin {
double height = 540;
bool showTimes = false;
late AnimationController animationController;
late Animation<double> animation;
final ExpandableController expandableController = ExpandableController();
@ -142,7 +140,7 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
}
}
void disableWithCountdown(int time) {
void disableWithCountdown(int time) async {
updateBlocking(value: false, filter: 'general', time: time);
expandableController.toggle();
}
@ -263,6 +261,10 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
color: Theme.of(context).primaryColor.withOpacity(0.1)
),
child: Expandable(
theme: const ExpandableThemeData(
animationDuration: Duration(milliseconds: 200),
fadeCurve: Curves.ease
),
collapsed: topRow(),
expanded: Column(
children: [
@ -326,23 +328,22 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
);
}
return Container(
width: double.maxFinite,
height: Platform.isIOS ? height+16 : height,
return SafeArea(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).dialogBackgroundColor,
color: Theme.of(context).colorScheme.surface,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(28),
topRight: Radius.circular(28)
)
),
child: Column(
child: Wrap(
children: [
Expanded(
child: ListView(
physics: (Platform.isIOS ? height+16 : height) < MediaQuery.of(context).size.height
? const NeverScrollableScrollPhysics()
: null,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(top: 24),
@ -363,6 +364,10 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
),
),
),
],
),
],
),
mainSwitch(),
const SizedBox(height: 10),
smallSwitch(
@ -393,9 +398,6 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
(value) => updateBlocking(value: value, filter: 'safeSearch'),
serversProvider.protectionsManagementProcess.contains('safeSearch')
),
],
),
),
Padding(
padding: const EdgeInsets.all(24),
child: Row(
@ -411,6 +413,7 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
if (Platform.isIOS) const SizedBox(height: 16)
],
),
),
);
}
}