diff --git a/lib/config/router.dart b/lib/config/router.dart index 21cd144a..b44bf5d5 100644 --- a/lib/config/router.dart +++ b/lib/config/router.dart @@ -85,6 +85,9 @@ final routerProvider = Provider( ), observers: [pageRouteObserver], debugLogDiagnostics: !kReleaseMode, + + // URLの#を除去する + urlPathStrategy: UrlPathStrategy.path, ), ); diff --git a/lib/main.dart b/lib/main.dart index e6b4f0c9..593fc874 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,25 +3,16 @@ // found in the LICENSE file. import 'package:flutter/material.dart'; -import 'package:flutter_cache_manager/flutter_cache_manager.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:hive_flutter/hive_flutter.dart'; import 'config/github_search_app.dart'; import 'localizations/strings.g.dart'; import 'repositories/hive/app_data_repository.dart'; -import 'utils/url_strategy/url_strategy.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); - // CacheManagerのログレベルを設定する - CacheManager.logLevel = CacheManagerLogLevel.none; - - // Web版のURLの#を除去する - // see: https://docs.flutter.dev/development/ui/navigation/url-strategies - usePathUrlStrategy(); - // fast_i18n の初期化 LocaleSettings.useDeviceLocale(); diff --git a/lib/utils/url_strategy/url_strategy.dart b/lib/utils/url_strategy/url_strategy.dart deleted file mode 100644 index 9873ce8a..00000000 --- a/lib/utils/url_strategy/url_strategy.dart +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2022 susatthi All rights reserved. -// Use of this source code is governed by a MIT license that can be -// found in the LICENSE file. - -// see: https://docs.flutter.dev/development/ui/navigation/url-strategies -export 'url_strategy_noop.dart' if (dart.library.html) 'url_strategy_web.dart'; diff --git a/lib/utils/url_strategy/url_strategy_noop.dart b/lib/utils/url_strategy/url_strategy_noop.dart deleted file mode 100644 index dbeb670f..00000000 --- a/lib/utils/url_strategy/url_strategy_noop.dart +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2022 susatthi All rights reserved. -// Use of this source code is governed by a MIT license that can be -// found in the LICENSE file. - -void usePathUrlStrategy() { - // noop -} diff --git a/lib/utils/url_strategy/url_strategy_web.dart b/lib/utils/url_strategy/url_strategy_web.dart deleted file mode 100644 index b376c01c..00000000 --- a/lib/utils/url_strategy/url_strategy_web.dart +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2022 susatthi All rights reserved. -// Use of this source code is governed by a MIT license that can be -// found in the LICENSE file. - -import 'package:flutter_web_plugins/flutter_web_plugins.dart'; - -void usePathUrlStrategy() { - setUrlStrategy(PathUrlStrategy()); -}