Skip to content

Commit

Permalink
Merge pull request #144 from susatthi/feature/143-change-url-strategy
Browse files Browse the repository at this point in the history
🚀 feat:  WebのUrlStrategyの設定をGoRouterの機能を使うように変更
  • Loading branch information
susatthi committed May 24, 2022
2 parents 05c8aff + 2510ac7 commit a855d11
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 31 deletions.
3 changes: 3 additions & 0 deletions lib/config/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ final routerProvider = Provider<GoRouter>(
),
observers: [pageRouteObserver],
debugLogDiagnostics: !kReleaseMode,

// URLの#を除去する
urlPathStrategy: UrlPathStrategy.path,
),
);

Expand Down
9 changes: 0 additions & 9 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> 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();

Expand Down
6 changes: 0 additions & 6 deletions lib/utils/url_strategy/url_strategy.dart

This file was deleted.

7 changes: 0 additions & 7 deletions lib/utils/url_strategy/url_strategy_noop.dart

This file was deleted.

9 changes: 0 additions & 9 deletions lib/utils/url_strategy/url_strategy_web.dart

This file was deleted.

0 comments on commit a855d11

Please sign in to comment.