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