Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update example assets #305

Merged
merged 2 commits into from Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 26 additions & 3 deletions example/lib/main.dart
@@ -1,4 +1,4 @@
import 'package:example_resources/gen/assets.gen.dart' as res;
import 'package:example_resources/gen/assets.gen.dart';
import 'package:flutter/material.dart';

import 'gen/assets.gen.dart';
Expand Down Expand Up @@ -75,8 +75,6 @@ void main() async {
child: const Center(child: Text('Deco')),
),
// Use from example_resource package.
res.Assets.images.flutter3.image(),
res.Assets.images.dart.svg(),
MyAssets.images.icons.kmm.svg(key: const Key("kmm_svg")),
MyAssets.images.icons.fuchsia.svg(),
MyAssets.images.icons.paint.svg(
Expand All @@ -89,6 +87,31 @@ void main() async {
// height: 120,
// fit: BoxFit.scaleDown,
// ),

// example_resource package.
ResAssets.images.flutter3.image(),
ResAssets.images.dart.svg(),
SizedBox(
width: 200,
height: 200,
child: ResAssets.images.skills.rive(
fit: BoxFit.contain,
),
),
SizedBox(
width: 200,
height: 200,
child: ResAssets.images.favorite.flare(
shouldClip: false,
),
),
SizedBox(
width: 200,
height: 200,
child: ResAssets.images.runningCarOnRoad.lottie(
fit: BoxFit.contain,
),
),
const Text(
'Hi there, I\'m FlutterGen',
style: TextStyle(
Expand Down
Binary file added example_resources/assets/images/favorite.flr
Binary file not shown.
1 change: 1 addition & 0 deletions example_resources/assets/images/running-car-on-road.json

Large diffs are not rendered by default.

Binary file added example_resources/assets/images/skills.riv
Binary file not shown.
157 changes: 154 additions & 3 deletions example_resources/lib/gen/assets.gen.dart

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

2 changes: 1 addition & 1 deletion example_resources/lib/gen/colors.gen.dart

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

10 changes: 9 additions & 1 deletion example_resources/pubspec.yaml
Expand Up @@ -14,6 +14,9 @@ dependencies:
sdk: flutter

flutter_svg: ^1.0.3
lottie: 1.4.1
flare_flutter: ^3.0.2
rive: ^0.8.4

dev_dependencies:
build_runner: ^2.1.11
Expand All @@ -25,10 +28,15 @@ flutter_gen:

integrations:
flutter_svg: true
flare_flutter: true
rive: true
lottie: true

assets:
enabled: true
package_parameter_enabled: true
outputs:
package_parameter_enabled: true
class_name: ResAssets

fonts:
enabled: true
Expand Down
Expand Up @@ -2,7 +2,6 @@ import '../../settings/asset_type.dart';
import 'integration.dart';

class FlareIntegration extends Integration {

FlareIntegration(String packageParameterLiteral)
: super(packageParameterLiteral);

Expand Down
@@ -1,7 +1,6 @@
import '../../settings/asset_type.dart';

abstract class Integration {

Integration(this.packageParameterLiteral);

final String packageParameterLiteral;
Expand Down
Expand Up @@ -7,7 +7,6 @@ import 'dart:io';
import 'package:path/path.dart' as p;

class LottieIntegration extends Integration {

LottieIntegration(String packageParameterLiteral)
: super(packageParameterLiteral);

Expand Down
Expand Up @@ -2,7 +2,6 @@ import '../../settings/asset_type.dart';
import 'integration.dart';

class RiveIntegration extends Integration {

RiveIntegration(String packageParameterLiteral)
: super(packageParameterLiteral);

Expand Down
Expand Up @@ -2,7 +2,6 @@ import '../../settings/asset_type.dart';
import 'integration.dart';

class SvgIntegration extends Integration {

SvgIntegration(String packageParameterLiteral)
: super(packageParameterLiteral);

Expand Down