Skip to content

Commit

Permalink
update package to version 0.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
khlebobul committed Oct 12, 2024
1 parent a4adca6 commit f75f35f
Show file tree
Hide file tree
Showing 36 changed files with 437 additions and 907 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@
* Remove Import section
* Add badge with contacts information
* Update website link
* Update puckages
* Update packages

## 0.0.5

* All widgets are adapted to different screen sizes
* Updated demos
* Removed Rotatint trapezium and Conic Gradient
45 changes: 7 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,6 @@ void main() {
),
```

##### ConicGradient

```dart
ConicGradient(
durationSeconds: 10, // Duration of the animation in seconds
maxDiameter: 1.2, // Maximum diameter of the gradient
steps: 10, // Number of steps in the gradient
),
```

##### GridOfLines

```dart
Expand Down Expand Up @@ -175,17 +165,6 @@ void main() {
),
```

##### RotatingTrapezium

```dart
RotatingTrapezium(
nx: 20, // number of columns
ny: 20, // number of rows
t: 17, // trapezium
animationDuration: Duration(seconds: 5), // animation duration
),
```

##### CircleGrid

```dart
Expand Down Expand Up @@ -244,11 +223,6 @@ void main() {
</td>
</tr>
<tr>
<td align="center">
<img src="https://github.com/khlebobul/gen_art_bg/raw/main/screenshots/rotating_trapezium.gif" width="100px">
<br />
AnimatedTrapezium
</td>
<td align="center">
<img src="https://github.com/khlebobul/gen_art_bg/raw/main/screenshots/random_noise.gif" width="100px">
<br />
Expand All @@ -259,18 +233,6 @@ void main() {
<br />
MolnarArt
</td>
<td align="center">
<img src="https://github.com/khlebobul/gen_art_bg/raw/main/screenshots/conic_gradient.gif" width="100px">
<br />
ConicGradient
</td>
</tr>
<tr>
<td align="center">
<img src="https://github.com/khlebobul/gen_art_bg/raw/main/screenshots/pulsed_circle_grid.gif" width="100px">
<br />
PulsedCircleGrid
</td>
<td align="center">
<img src="https://github.com/khlebobul/gen_art_bg/raw/main/screenshots/animated_bw_squares.gif" width="100px">
<br />
Expand All @@ -281,6 +243,13 @@ void main() {
<br />
WaveLineGrid
</td>
</tr>
<tr>
<td align="center">
<img src="https://github.com/khlebobul/gen_art_bg/raw/main/screenshots/pulsed_circle_grid.gif" width="100px">
<br />
PulsedCircleGrid
</td>
<td align="center">
Space for a new
</td>
Expand Down
68 changes: 33 additions & 35 deletions example/lib/wave_line_grid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import 'dart:math';
import 'package:flutter/material.dart';

class WaveLineGrid extends StatefulWidget {
final int columns; // Number of columns in the grid
final int rows; // Number of rows in the grid
final int locationConstant; // Constant to adjust the location of the grid
final Duration animationDuration; // Duration of the animation
final int columns;
final int rows;
final int locationConstant;
final Duration animationDuration;

const WaveLineGrid({
Key? key,
Expand All @@ -16,11 +16,10 @@ class WaveLineGrid extends StatefulWidget {
}) : super(key: key);

@override
// ignore: library_private_types_in_public_api
_WaveLineGridState createState() => _WaveLineGridState();
WaveLineGridState createState() => WaveLineGridState();
}

class _WaveLineGridState extends State<WaveLineGrid>
class WaveLineGridState extends State<WaveLineGrid>
with TickerProviderStateMixin {
late AnimationController _controller;

Expand All @@ -45,9 +44,7 @@ class _WaveLineGridState extends State<WaveLineGrid>

@override
Widget build(BuildContext context) {
return SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
return SizedBox.expand(
child: AnimatedBuilder(
animation: _controller,
builder: (context, _) {
Expand Down Expand Up @@ -87,57 +84,59 @@ class _WaveGridPainter extends CustomPainter {
final paint = Paint()..color = Colors.black;
final linePaint = Paint()
..color = Colors.black
..strokeWidth = 4
..strokeWidth = 2
..style = PaintingStyle.stroke;

canvas.drawRect(Offset.zero & size, Paint()..color = Colors.white);

final grid = _generateGrid(size);

_drawGrid(canvas, grid, linePaint, paint);
}

List<List<Cell>> _generateGrid(Size size) {
List<List<LineCell>> _generateGrid(Size size) {
const cellSize = 20.0;
const padding = cellSize;
final columns = ((size.width + 2 * padding) / cellSize).ceil();
final rows = ((size.height + 2 * padding) / cellSize).ceil();

return List.generate(columns, (i) {
return List.generate(rows, (j) {
return Cell(
colSize: size.width / columns,
rowSize: size.height / rows,
x0: size.width / columns * i,
y0: size.height / rows * j,
r: (size.width / columns) / 10,
angle: (size.width / columns) * locationConstant / 100 * i +
locationConstant * j,
return LineCell(
cellSize: cellSize,
x0: cellSize * i - padding,
y0: cellSize * j - padding,
r: cellSize / 10,
angle: cellSize * locationConstant / 100 * i + locationConstant * j,
);
});
});
}

void _drawGrid(
Canvas canvas, List<List<Cell>> grid, Paint linePaint, Paint paint) {
Canvas canvas, List<List<LineCell>> grid, Paint linePaint, Paint paint) {
for (var i = 0; i < grid.length; i++) {
for (var j = 0; j < grid[i].length; j++) {
grid[i][j].update(waveAnimation.value);
canvas.drawCircle(
Offset(grid[i][j].x0 * 1.2 + grid[i][j].x,
grid[i][j].y0 * 1.2 + grid[i][j].y),
Offset(grid[i][j].x0 + grid[i][j].x, grid[i][j].y0 + grid[i][j].y),
grid[i][j].r,
paint,
);

if (i > 0) {
canvas.drawLine(
Offset(grid[i][j].x0 * 1.2 + grid[i][j].x,
grid[i][j].y0 * 1.2 + grid[i][j].y),
Offset(grid[i - 1][j].x0 * 1.2 + grid[i - 1][j].x,
grid[i - 1][j].y0 * 1.2 + grid[i - 1][j].y),
Offset(grid[i][j].x0 + grid[i][j].x, grid[i][j].y0 + grid[i][j].y),
Offset(grid[i - 1][j].x0 + grid[i - 1][j].x,
grid[i - 1][j].y0 + grid[i - 1][j].y),
linePaint,
);
}
if (j > 0) {
canvas.drawLine(
Offset(grid[i][j].x0 * 1.2 + grid[i][j].x,
grid[i][j].y0 * 1.2 + grid[i][j].y),
Offset(grid[i][j - 1].x0 * 1.2 + grid[i][j - 1].x,
grid[i][j - 1].y0 * 1.2 + grid[i][j - 1].y),
Offset(grid[i][j].x0 + grid[i][j].x, grid[i][j].y0 + grid[i][j].y),
Offset(grid[i][j - 1].x0 + grid[i][j - 1].x,
grid[i][j - 1].y0 + grid[i][j - 1].y),
linePaint,
);
}
Expand All @@ -149,17 +148,16 @@ class _WaveGridPainter extends CustomPainter {
bool shouldRepaint(_WaveGridPainter oldDelegate) => true;
}

class Cell {
class LineCell {
final double r;
final double angle;
final double x0;
final double y0;
late double x;
late double y;

Cell({
required double colSize,
required double rowSize,
LineCell({
required double cellSize,
required this.x0,
required this.y0,
required this.r,
Expand Down
24 changes: 12 additions & 12 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -119,18 +119,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.8.0"
version: "0.11.1"
meta:
dependency: transitive
description:
name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.12.0"
version: "1.15.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -188,10 +188,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
version: "0.7.2"
vector_math:
dependency: transitive
description:
Expand All @@ -204,10 +204,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.1"
version: "14.2.5"
sdks:
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
2 changes: 0 additions & 2 deletions lib/gen_art_bg.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ export 'src/animated_bw_squares.dart';
export 'src/animated_colored_squares.dart';
export 'src/animated_lines_gradient.dart';
export 'src/animated_lines.dart';
export 'src/conic_gradient.dart';
export 'src/grid_of_lines.dart';
export 'src/molnar_art.dart';
export 'src/perlin_noise.dart';
export 'src/pulsed_circle_grid.dart';
export 'src/random_noise.dart';
export 'src/random_square.dart';
export 'src/rotating_trapezium.dart';
export 'src/spiral_wave.dart';
export 'src/wave_dot_grid.dart';
export 'src/wave_line_grid.dart';
Loading

0 comments on commit f75f35f

Please # to comment.