Skip to content

Commit

Permalink
Merge pull request #61 from mkobuolys/feat/update-project
Browse files Browse the repository at this point in the history
feat: update project
  • Loading branch information
mkobuolys authored Nov 2, 2024
2 parents 61e2fbd + bc351d5 commit f8364a1
Show file tree
Hide file tree
Showing 20 changed files with 92 additions and 62 deletions.
24 changes: 22 additions & 2 deletions .metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,27 @@
# This file should be version controlled and should not be manually edited.

version:
revision: 2d2a1ffec95cc70a3218872a2cd3f8de4933c42f
channel: stable
revision: "603104015dd692ea3403755b55d07813d5cf8965"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
- platform: web
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
base_revision: 603104015dd692ea3403755b55d07813d5cf8965

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
1 change: 1 addition & 0 deletions assets/markdown/decorator.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ class _DecoratorExampleState extends State<DecoratorExample> {
horizontal: LayoutConstants.paddingL,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:convert';

import 'package:flutter/services.dart' show rootBundle;
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

import '../../constants/constants.dart';
Expand All @@ -16,16 +17,14 @@ DesignPatternCategoriesRepository designPatternCategoriesRepository(_) {
}

@riverpod
Future<List<DesignPatternCategory>> designPatternCategories(
DesignPatternCategoriesRef ref,
) {
Future<List<DesignPatternCategory>> designPatternCategories(Ref ref) {
final repository = ref.watch(designPatternCategoriesRepositoryProvider);

return repository.get();
}

@riverpod
Future<DesignPattern> designPattern(DesignPatternRef ref, String id) async {
Future<DesignPattern> designPattern(Ref ref, String id) async {
final categories = await ref.watch(designPatternCategoriesProvider.future);

return categories
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lib/data/repositories/markdown_repository.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/services.dart' show rootBundle;
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

import '../../constants/constants.dart';
Expand All @@ -9,7 +10,7 @@ part 'markdown_repository.g.dart';
MarkdownRepository markdownRepository(_) => const MarkdownRepository();

@riverpod
Future<String> markdown(MarkdownRef ref, String id) {
Future<String> markdown(Ref ref, String id) {
return ref.watch(markdownRepositoryProvider).get(id);
}

Expand Down
8 changes: 6 additions & 2 deletions lib/data/repositories/markdown_repository.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:faker/faker.dart';
import 'package:faker/faker.dart' hide Color;
import 'package:flutter/material.dart';

import '../command.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:faker/faker.dart';
import 'package:faker/faker.dart' hide Color;
import 'package:flutter/material.dart';

import '../../memento/imemento.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/design_patterns/prototype/shapes/circle.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:faker/faker.dart';
import 'package:faker/faker.dart' hide Color;
import 'package:flutter/material.dart';

import '../shape.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/design_patterns/prototype/shapes/rectangle.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:faker/faker.dart';
import 'package:faker/faker.dart' hide Color;
import 'package:flutter/material.dart';

import '../shape.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:url_strategy/url_strategy.dart';
import 'package:flutter_web_plugins/url_strategy.dart';

import 'app.dart';

Expand All @@ -10,7 +10,7 @@ Future<void> main() async {

await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);

setPathUrlStrategy();
usePathUrlStrategy();

runApp(const ProviderScope(child: App()));
}
7 changes: 5 additions & 2 deletions lib/navigation/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ part 'router.g.dart';
@riverpod
GoRouter router(_) => GoRouter(
routes: $appRoutes,
redirect: (context, state) =>
state.location.isEmpty ? const MainMenuRoute().location : null,
redirect: (context, state) {
final uri = state.uri.toString();

return uri.isEmpty ? const MainMenuRoute().location : null;
},
);

@TypedGoRoute<MainMenuRoute>(
Expand Down
6 changes: 4 additions & 2 deletions lib/navigation/router.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const lightBackgroundColor = Color(0xFFECECEC);

final lightTheme = ThemeData.from(
colorScheme: const ColorScheme.light(
background: lightBackgroundColor,
surface: lightBackgroundColor,
primary: Colors.grey,
),
).copyWith(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class _ChoiceChip extends StatelessWidget {
final color = selected ? Colors.white : Colors.black;

return ChoiceChip(
color: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.selected)) {
color: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.selected)) {
return Colors.black;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class _DecoratorExampleState extends State<DecoratorExample> {
horizontal: LayoutConstants.paddingL,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/image_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class _ImageViewState extends State<ImageView>
return Scaffold(
appBar: AppBar(
elevation: 0,
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: Theme.of(context).colorScheme.surface,
leading: const CloseButton(color: Colors.black),
),
body: GestureDetector(
Expand Down
29 changes: 15 additions & 14 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,28 @@ environment:
sdk: ">=3.0.0 <4.0.0"

dependencies:
cupertino_icons: ^1.0.5
faker: ^2.1.0
cupertino_icons: ^1.0.8
faker: ^2.2.0
flutter:
sdk: flutter
flutter_markdown: ^0.6.14
flutter_riverpod: ^2.3.6
font_awesome_flutter: ^10.4.0
go_router: ^7.0.1
flutter_markdown: ^0.7.4+1
flutter_riverpod: ^2.6.1
flutter_web_plugins:
sdk: flutter
font_awesome_flutter: ^10.7.0
go_router: ^14.3.0
highlight: ^0.7.0
riverpod_annotation: ^2.1.1
url_launcher: ^6.1.11
url_strategy: ^0.2.0
xml: ^6.3.0
riverpod_annotation: ^2.6.1
url_launcher: ^6.3.1
xml: ^6.5.0

dev_dependencies:
build_runner: ^2.4.4
build_runner: ^2.4.13
flutter_test:
sdk: flutter
go_router_builder: ^2.0.1
lint: ^2.1.2
riverpod_generator: ^2.2.3
go_router_builder: ^2.7.1
lint: ^2.3.0
riverpod_generator: ^2.6.2

flutter:
uses-material-design: true
Expand Down
24 changes: 2 additions & 22 deletions web/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
Fore more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
-->
<base href="/">
<base href="$FLUTTER_BASE_HREF">

<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
Expand Down Expand Up @@ -40,16 +30,6 @@ <h1>
Welcome to Flutter Design Patterns! 👋
</h1>
</div>
<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('flutter-first-frame', function () {
navigator.serviceWorker.register('flutter_service_worker.js');
});
}
</script>
<script src="main.dart.js" type="application/javascript"></script>
<script src="flutter_bootstrap.js" async></script>
</body>
</html>
12 changes: 12 additions & 0 deletions web/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "icons/Icon-maskable-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "icons/Icon-maskable-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}

0 comments on commit f8364a1

Please sign in to comment.