https://github.com/naxmefy/simple-flutter-gh-page
Simple Flutter app deployed on GitHub Pages
https://github.com/naxmefy/simple-flutter-gh-page
flutter gh-pages web
Last synced: 3 months ago
JSON representation
Simple Flutter app deployed on GitHub Pages
- Host: GitHub
- URL: https://github.com/naxmefy/simple-flutter-gh-page
- Owner: naxmefy
- License: mit
- Created: 2022-09-01T15:07:10.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-01T16:10:31.000Z (almost 3 years ago)
- Last Synced: 2025-01-16T01:16:07.776Z (5 months ago)
- Topics: flutter, gh-pages, web
- Language: Dart
- Homepage: https://nax.me/simple-flutter-gh-page/
- Size: 53.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simpleflutterghpage
## 1. Create a flutter app
```bash
flutter create my-app
```## 2. Add [flutter_web_plugins](https://api.flutter.dev/flutter/flutter_web_plugins/flutter_web_plugins-library.html)
Add the following to your dependencies in `pubspec.yaml`.
```yaml
flutter_web_plugins:
sdk: flutter
```## 3. Activate [usePathUrlStrategy](https://api.flutter.dev/flutter/flutter_web_plugins/usePathUrlStrategy.html)
As explained at https://docs.flutter.dev/development/ui/navigation/url-strategies.
Add flutter_web_plugins import.
```dart
import 'package:flutter_web_plugins/url_strategy.dart';
```Add [usePathUrlStrategy](https://api.flutter.dev/flutter/flutter_web_plugins/usePathUrlStrategy.html) before `runApp`.
```dart
void main() {
usePathUrlStrategy();
runApp(const MyApp());
}
```## 4. Add a GitHub Actions workflow to build and deploy to GitHub Pages
Checkout the one of this repo ([pages workflow](https://github.com/naxmefy/simple-flutter-gh-page/blob/2b1b2b693fedeaa36fb84398590651a4d2a5d8c1/.github/workflows/pages.yml)).