Skip to content

Commit

Permalink
* Change: example app name
Browse files Browse the repository at this point in the history
* Update: environment sdk and flutter
* Migrate: to android v2 embedding
* Add: flutter lints and analysis options
* Update: LICENSE
  • Loading branch information
jagrit-idc committed Mar 3, 2022
1 parent 38d5a11 commit 1d1f019
Show file tree
Hide file tree
Showing 13 changed files with 155 additions and 45 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [3.1.0] - 2021-03-04
* Change: example app name
* Update: environment sdk and flutter
* Migrate: to android v2 embedding
* Add: flutter lints and analysis options
* Update: LICENSE

## [3.0.0] - 2021-06-21

# Breaking changes:-
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Jagrit Kharbanda
Copyright (c) 2022 Jagrit Kharbanda

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
29 changes: 29 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
29 changes: 29 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
4 changes: 2 additions & 2 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="example"
android:name="${applicationName}"
android:label="blur example"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>example</string>
<string>blur example</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
Expand Down
30 changes: 16 additions & 14 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import 'package:flutter/material.dart';
import 'package:blur/blur.dart';

void main() {
runApp(MyApp());
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return MaterialApp(
Expand All @@ -15,13 +17,13 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Blur Wrapper widget'),
home: const MyHomePage(title: 'Blur Wrapper widget'),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key? key, required this.title}) : super(key: key);
const MyHomePage({Key? key, required this.title}) : super(key: key);

final String title;

Expand All @@ -40,7 +42,7 @@ class _MyHomePageState extends State<MyHomePage> {
title: Text(widget.title),
),
body: Padding(
padding: EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Expand All @@ -51,15 +53,15 @@ class _MyHomePageState extends State<MyHomePage> {
blur: blurValue,
blurColor: theme.primaryColor,
borderRadius:
BorderRadius.horizontal(left: Radius.circular(20)),
const BorderRadius.horizontal(left: Radius.circular(20)),
),
),
SizedBox(width: 20.0),
const SizedBox(width: 20.0),
Expanded(
child: Image.asset('assets/cat.png').blurred(
colorOpacity: 0.2,
borderRadius:
BorderRadius.horizontal(right: Radius.circular(20)),
const BorderRadius.horizontal(right: Radius.circular(20)),
blur: blurValue,
overlay: Text(
'Cat',
Expand All @@ -82,7 +84,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
Column(
children: [
Icon(Icons.image),
const Icon(Icons.image),
Text(
'Frost',
style: theme.textTheme.headline4,
Expand All @@ -91,15 +93,15 @@ class _MyHomePageState extends State<MyHomePage> {
).frosted(
blur: blurValue,
borderRadius: BorderRadius.circular(20),
padding: EdgeInsets.all(8),
padding: const EdgeInsets.all(8),
)
],
),
Blur(
blur: blurValue,
blurColor: theme.primaryColor,
child: Padding(
padding: EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0),
child: Text(
'Blur',
style: theme.textTheme.headline3,
Expand All @@ -125,11 +127,11 @@ class _MyHomePageState extends State<MyHomePage> {
style: theme.textTheme.headline3,
).frosted(
blur: blurValue,
padding: EdgeInsets.all(8),
padding: const EdgeInsets.all(8),
),
SizedBox(width: 20),
Icon(Icons.image).frosted(
padding: EdgeInsets.all(8),
const SizedBox(width: 20),
const Icon(Icons.image).frosted(
padding: const EdgeInsets.all(8),
blur: blurValue,
),
],
Expand Down
41 changes: 31 additions & 10 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.1"
version: "2.8.2"
blur:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "3.0.0"
version: "3.0.1"
boolean_selector:
dependency: transitive
description:
Expand All @@ -28,14 +28,14 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.1"
clock:
dependency: transitive
description:
Expand All @@ -62,25 +62,46 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
lints:
dependency: transitive
description:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10"
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.7.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -134,7 +155,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
version: "0.4.8"
typed_data:
dependency: transitive
description:
Expand All @@ -148,7 +169,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
sdks:
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.17.0"
dart: ">=2.16.0 <3.0.0"
flutter: ">=2.5.0"
3 changes: 2 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=2.16.0 <3.0.0'

dependencies:
flutter:
Expand All @@ -15,6 +15,7 @@ dependencies:
path: ../

dev_dependencies:
flutter_lints: ^1.0.4
flutter_test:
sdk: flutter

Expand Down
2 changes: 1 addition & 1 deletion example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'package:example/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
await tester.pumpWidget(const MyApp());

// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
Expand Down
5 changes: 2 additions & 3 deletions lib/blur.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
library blur;

import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

///blur it's [child]
Expand All @@ -12,7 +11,7 @@ import 'package:flutter/material.dart';
///[overlay] is the widget that can be stacked over blurred widget
///[alignment] is the alignment geometry of the overlay (default value = Alignment.center)
class Blur extends StatelessWidget {
Blur({
const Blur({
Key? key,
required this.child,
this.blur = 5,
Expand Down Expand Up @@ -110,7 +109,7 @@ extension FrostExtension on Widget {
height: height,
width: width,
padding: padding,
child: height == null || width == null ? this : SizedBox.shrink(),
child: height == null || width == null ? this : const SizedBox.shrink(),
color: frostColor.withOpacity(frostOpacity),
),
alignment: alignment,
Expand Down
Loading

0 comments on commit 1d1f019

Please sign in to comment.