Skip to content

Commit

Permalink
style!: rename flags directory to world_flags (#191)
Browse files Browse the repository at this point in the history
* style!: rename flags directory to world_flags

* style!: rename package to world_flags
  • Loading branch information
tsinis authored Jun 23, 2024
1 parent 8730266 commit cd7c2b3
Show file tree
Hide file tree
Showing 168 changed files with 35 additions and 42 deletions.
4 changes: 2 additions & 2 deletions .vscode/sealed_world.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"path": "../tools"
},
{
"name": "Flags",
"path": "../packages/flags"
"name": "Flutter Flags",
"path": "../packages/world_flags"
},
{
"name": "Flutter World",
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 3 additions & 7 deletions packages/flags/README.md → packages/world_flags/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Pub package](https://img.shields.io/pub/v/flags.svg)](https://pub.dev/packages/flags)
[![Pub package](https://img.shields.io/pub/v/world_flags.svg)](https://pub.dev/packages/world_flags)

# Every country flag is a Flutter Widget

Expand All @@ -13,11 +13,11 @@

## Getting Started

To use this package, you will need Flutter version 3.10+. Add `flags` as a dependency in your `pubspec.yaml` file.
To use this package, you will need Flutter version 3.10+. Add `world_flags` as a dependency in your `pubspec.yaml` file.

```yaml
dependencies:
flags: any
world_flags: any
```
### Usage
Expand All @@ -31,10 +31,6 @@ If you have any issues or suggestions for the package, please file them in the G
This package is licensed under the MIT license. See [LICENSE](./LICENSE) for details. This package dependencies are under their respective licenses (that can be found in their respective folders under LICENSE and NOTICE files).
### Attributions
The color emoji flags fonts used in this package were obtained from open-source repositories of the original creators.
---
### FAQ
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "package:flags/flags.dart";
import "package:flutter/material.dart";
import "package:world_flags/world_flags.dart";

void main() => runApp(
MaterialApp(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,6 @@ static void my_application_init(MyApplication* self) {}
MyApplication* my_application_new() {
return MY_APPLICATION(g_object_new(my_application_get_type(),
"application-id", APPLICATION_ID,
"flags", G_APPLICATION_NON_UNIQUE,
"world_flags", G_APPLICATION_NON_UNIQUE,
nullptr));
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.1"
flags:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.0.0"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -94,10 +87,10 @@ packages:
dependency: "direct dev"
description:
name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
version: "4.0.0"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -223,6 +216,13 @@ packages:
url: "https://pub.dev"
source: hosted
version: "14.2.1"
world_flags:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.0.0"
sdks:
dart: ">=3.4.1 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: example
description: A flags package example application.
description: A world_flags package example application.
publish_to: none

version: 0.0.1+1
Expand All @@ -8,15 +8,15 @@ environment:
sdk: ^3.4.1

dependencies:
flags:
path: ../
flutter:
sdk: flutter
world_flags:
path: ../

dev_dependencies:
flutter_test: # From Google
sdk: flutter
lints: ^3.0.0 # From Google
lints: ^4.0.0 # From Google

flutter:
uses-material-design: true
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "package:flutter/rendering.dart";
import "dart:ui";

import "../../../model/typedefs.dart";
import "../basic/elements_painter.dart";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "package:flags/src/model/shape.dart";
import "package:flutter/rendering.dart";
import "dart:ui";

import "../../../model/shape.dart";
import "../../../model/typedefs.dart";
import "../basic/elements_painter.dart";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "package:flags/src/model/shape.dart";
import "package:flutter/rendering.dart";
import "dart:ui";

import "../../../model/shape.dart";
import "../../../model/typedefs.dart";
import "../basic/elements_painter.dart";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "dart:math" as math;
import "dart:math";
import "dart:ui";

import "../../../model/shape.dart";
Expand All @@ -7,23 +7,23 @@ import "../basic/elements_painter.dart";

final class StarPainter extends ElementsPainter {
StarPainter(super.properties, super.aspectRatio);
static const startRadians = math.pi / 2;
static const radiansMultiplier = math.pi / 180;
static const startRadians = pi / 2;
static const radiansMultiplier = pi / 180;

@override
FlagParentBounds paintFlagElements(Canvas canvas, Size size) {
final star = shapeType<Star>() ?? const Star();
final radiansPerPoint = math.pi * 2 / (star.points * 2);
final radiansPerPoint = pi * 2 / (star.points * 2);
final center = calculateCenter(size);
final radius = calculateSize(size);
final path = Path();

for (var i = 0; i <= star.points * 2; i++) {
final radiusFactor = i.isEven ? star.radiusFactor : 1;
final x = center.dx +
radius * radiusFactor * math.cos(i * radiansPerPoint + startRadians);
radius * radiusFactor * cos(i * radiansPerPoint + startRadians);
final y = center.dy +
radius * radiusFactor * math.sin(i * radiansPerPoint + startRadians);
radius * radiusFactor * sin(i * radiansPerPoint + startRadians);
i == 0 ? path.moveTo(x, y) : path.lineTo(x, y);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import "dart:ui";

import "package:flutter/rendering.dart";

import "../../../model/typedefs.dart";
import "../basic/elements_painter.dart";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import "dart:math" hide Rectangle;
import "dart:ui";

import "package:flags/src/model/shape.dart";

import "../../model/elements/custom_elements_properties.dart";
import "../../model/elements/elements_properties.dart";
import "../../model/shape.dart";
import "../../model/typedefs.dart";
import "basic/custom_elements_painter.dart";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Every flag is a Widget.
library flags;
library world_flags;

import "package:sealed_countries/sealed_countries.dart";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 0.0.0
name: flags
name: world_flags
description: Country flags made with Flutter - every flag is a Widget.
maintainer: Roman Cinis
repository: https://github.com/tsinis/sealed_world/tree/main/packages/flags
repository: https://github.com/tsinis/sealed_world/tree/main/packages/world_flags
issue_tracker: https://github.com/tsinis/sealed_world/issues/
topics:
- flags
Expand Down

0 comments on commit cd7c2b3

Please sign in to comment.