Skip to content

Commit

Permalink
ci: add github actions (#89)
Browse files Browse the repository at this point in the history
* ci: add github actions

* rebase
  • Loading branch information
canastro committed Apr 22, 2022
1 parent 521b064 commit f0eae1e
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 21 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/pull_request.yml
@@ -0,0 +1,33 @@
name: pull-request

on:
pull_request:
types: [opened, reopened, synchronize]

concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install flutter
uses: subosito/flutter-action@v2
with:
channel: stable

- name: Get dependencies
run: flutter pub get

- name: Run formatter
run: flutter format --set-exit-if-changed .

- name: Run analyzer
run: flutter analyze .

- name: Run unit tests
run: flutter test
10 changes: 5 additions & 5 deletions example/lib/main.dart
@@ -1,13 +1,13 @@
import 'package:flutter/material.dart';

import 'home.dart';
import 'pages/bigdata.dart';
import 'pages/debug.dart';
import 'pages/echarts.dart';
import 'pages/interaction_channel_dynamic.dart';
import 'pages/interval.dart';
import 'pages/line_area_point.dart';
import 'pages/polygon_custom.dart';
import 'pages/interaction_channel_dynamic.dart';
import 'pages/bigdata.dart';
import 'pages/echarts.dart';
import 'pages/debug.dart';

final routes = {
'/': (context) => const HomePage(),
Expand All @@ -18,7 +18,7 @@ final routes = {
const InteractionChannelDynamicPage(),
'/examples/Bigdata': (context) => BigdataPage(),
'/examples/Echarts': (context) => EchartsPage(),
'/examples/Debug': (context) => DebugPage(),
'/examples/Debug': (context) => const DebugPage(),
};

class MyApp extends StatelessWidget {
Expand Down
24 changes: 10 additions & 14 deletions example/lib/pages/debug.dart
@@ -1,26 +1,23 @@
import 'dart:async';
import 'dart:math';

import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:graphic/graphic.dart';
import 'package:graphic_example/data.dart';

import '../data.dart';

class Sector extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
canvas.drawPath(
Paths.rSector(
center: Offset(175, 150),
center: const Offset(175, 150),
r: 20,
r0: 90,
startAngle: 0,
endAngle: -1.6,
clockwise: true,
topLeft: Radius.circular(5),
topRight: Radius.circular(5),
bottomRight: Radius.circular(5),
bottomLeft: Radius.circular(5),
topLeft: const Radius.circular(5),
topRight: const Radius.circular(5),
bottomRight: const Radius.circular(5),
bottomLeft: const Radius.circular(5),
),
Paint(),
);
Expand All @@ -31,9 +28,7 @@ class Sector extends CustomPainter {
}

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

final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
const DebugPage({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -64,7 +59,8 @@ class DebugPage extends StatelessWidget {
),
shape: ShapeAttr(
value: RectShape(
borderRadius: BorderRadius.all(Radius.circular(5)))),
borderRadius:
const BorderRadius.all(Radius.circular(5)))),
size: SizeAttr(value: 10),
)
],
Expand Down
2 changes: 1 addition & 1 deletion lib/src/geom/modifier/dodge.dart
Expand Up @@ -52,7 +52,7 @@ class DodgeGeomModifier extends GeomModifier {
final bool symmetric;

/// The band for each discrete x value.
///
///
/// It is a ratio to the total coordinate width.
final double band;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/geom/modifier/jitter.dart
Expand Up @@ -39,7 +39,7 @@ class JitterGeomModifier extends GeomModifier {
final double ratio;

/// The band for each discrete x value.
///
///
/// It is a ratio to the total coordinate width.
final double band;

Expand Down

0 comments on commit f0eae1e

Please sign in to comment.