diff --git a/lib/settings/widgets/section_dataset_toggles.dart b/lib/settings/widgets/section_dataset_toggles.dart index 3197d4e5..2cbe6d2e 100644 --- a/lib/settings/widgets/section_dataset_toggles.dart +++ b/lib/settings/widgets/section_dataset_toggles.dart @@ -30,6 +30,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:markdown_tooltip/markdown_tooltip.dart'; import 'package:rattle/settings/widgets/section_partition.dart'; +import 'package:rattle/settings/widgets/section_random_seed.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:rattle/constants/spacing.dart'; @@ -252,6 +253,10 @@ class DatasetToggles extends ConsumerWidget { ], ), settingsGroupGap, + RandomSeed(), + + settingsGroupGap, + Partition(), settingsGroupGap, diff --git a/lib/settings/widgets/section_random_seed.dart b/lib/settings/widgets/section_random_seed.dart index abc1758b..a3fe6076 100644 --- a/lib/settings/widgets/section_random_seed.dart +++ b/lib/settings/widgets/section_random_seed.dart @@ -62,6 +62,8 @@ class RandomSeed extends ConsumerWidget { children: [ Row( children: [ + // Title. + MarkdownTooltip( message: ''' @@ -76,40 +78,11 @@ class RandomSeed extends ConsumerWidget { child: const Text( 'Random Seed', style: TextStyle( - fontSize: 20, fontWeight: FontWeight.bold, ), ), ), configRowGap, - MarkdownTooltip( - message: ''' - - **Reset Random Seed:** - Clicking this button resets the random seed to the default value of 42. - This is useful if you want to restore the initial random state. - - ''', - child: ElevatedButton( - onPressed: () { - ref.read(randomSeedSettingProvider.notifier).state = 42; - _saveRandomSeed(42); - - ref - .read( - randomPartitionSettingProvider.notifier, - ) - .state = false; - _saveRandomPartition(false); - }, - child: const Text('Reset'), - ), - ), - ], - ), - configRowGap, - Row( - children: [ RandomSeedRow( randomSeed: randomSeed, updateSeed: (newSeed) { @@ -117,6 +90,8 @@ class RandomSeed extends ConsumerWidget { _saveRandomSeed(newSeed); }, ), + configRowGap, + MarkdownTooltip( message: ''' @@ -128,6 +103,8 @@ class RandomSeed extends ConsumerWidget { style: TextStyle(fontSize: 16), ), ), + configRowGap, + MarkdownTooltip( message: ''' @@ -148,10 +125,32 @@ class RandomSeed extends ConsumerWidget { }, ), ), + configRowGap, + MarkdownTooltip( + message: ''' + + **Reset Random Seed:** + Clicking this button resets the random seed to the default value of 42. + This is useful if you want to restore the initial random state. + + ''', + child: ElevatedButton( + onPressed: () { + ref.read(randomSeedSettingProvider.notifier).state = 42; + _saveRandomSeed(42); + + ref + .read( + randomPartitionSettingProvider.notifier, + ) + .state = false; + _saveRandomPartition(false); + }, + child: const Text('Reset'), + ), + ), ], ), - settingsGroupGap, - const Divider(), ], ); } diff --git a/lib/settings/widgets/settings_dialog.dart b/lib/settings/widgets/settings_dialog.dart index 7edc1ed7..3eeadba7 100644 --- a/lib/settings/widgets/settings_dialog.dart +++ b/lib/settings/widgets/settings_dialog.dart @@ -36,7 +36,6 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:rattle/settings/widgets/section_dataset_toggles.dart'; import 'package:rattle/settings/widgets/section_graphic_theme.dart'; -import 'package:rattle/settings/widgets/section_random_seed.dart'; import 'package:rattle/settings/widgets/section_session.dart'; import 'package:rattle/providers/cleanse.dart'; import 'package:rattle/providers/keep_in_sync.dart'; @@ -179,7 +178,6 @@ class SettingsDialogState extends ConsumerState { Divider(), DatasetToggles(), GraphicTheme(), - RandomSeed(), Session(), Script(), ],