24
This commit is contained in:
@@ -99,6 +99,7 @@ class SortStateScope extends InheritedNotifier<SortState> {
|
||||
static SortState of(BuildContext context) =>
|
||||
context.dependOnInheritedWidgetOfExactType<SortStateScope>()!.notifier!;
|
||||
|
||||
static SortState read(BuildContext context) =>
|
||||
context.getInheritedWidgetOfExactType<SortStateScope>()!.notifier!;
|
||||
static SortState read(BuildContext context) {
|
||||
return context.getInheritedWidgetOfExactType<SortStateScope>()!.notifier!;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import '../../provider/state.dart';
|
||||
import 'color_picker.dart';
|
||||
class SortSettings extends StatefulWidget {
|
||||
@@ -66,8 +67,9 @@ class _SortSettingsState extends State<SortSettings> {
|
||||
child: IconButton(
|
||||
splashRadius: 20,
|
||||
onPressed: (){
|
||||
SortState state = SortStateScope.of(context);
|
||||
state.config =state.config.copyWith(
|
||||
|
||||
SortState state = SortStateScope.read(context);
|
||||
state.config = state.config.copyWith(
|
||||
count: int.parse(_count.text),
|
||||
duration: Duration(
|
||||
microseconds: int.parse(_duration.text),
|
||||
@@ -75,7 +77,8 @@ class _SortSettingsState extends State<SortSettings> {
|
||||
seed: int.parse(_seed.text),
|
||||
colorIndex: _colorIndex
|
||||
);
|
||||
Navigator.of(context).pop();
|
||||
GoRouter.of(context).pop();
|
||||
// Navigator.of(context).pop();
|
||||
}, icon: Icon(Icons.check)),
|
||||
)],
|
||||
iconTheme: IconThemeData(color: Colors.black),
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../../app/navigation/router/iroute_config.dart';
|
||||
import '../../../../app/navigation/router/app_router_delegate.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'sort_button.dart';
|
||||
|
||||
import '../../functions.dart';
|
||||
@@ -62,7 +61,8 @@ class SortRailPanel extends StatelessWidget {
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
router.changePath('/app/sort/settings',style: RouteStyle.push);
|
||||
GoRouter.of(context).push('/sort/settings');
|
||||
// router.changePath('/app/sort/settings',style: RouteStyle.push);
|
||||
},
|
||||
child: const Icon(
|
||||
CupertinoIcons.settings,
|
||||
@@ -81,7 +81,7 @@ class SortRailPanel extends StatelessWidget {
|
||||
options: sortNameMap.values.toList(),
|
||||
onSelected: (name) {
|
||||
state.selectName(name);
|
||||
router.changePath('/app/sort/${name}',recordHistory: true);
|
||||
GoRouter.of(context).go('/sort/player/$name');
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user