Skip to content

Commit

Permalink
Add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimibe committed Jun 26, 2020
1 parent d3b42eb commit 8cb30b0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 7 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- uses: subosito/[email protected]
- name: Install Dependencies
run: flutter packages get
- name: Format
run: flutter format --set-exit-if-changed lib test
- name: Analyze
run: flutter analyze lib test
- name: Run tests
run: flutter test --no-pub --coverage --test-randomize-ordering-seed random
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

# Sticky grouped list package for Flutter.
[![Pub](https://img.shields.io/pub/v/sticky_grouped_list.svg)](https://pub.dev/packages/sticky_grouped_list)
![CI](https://github.com/Dimibe/sticky_grouped_list/workflows/CI/badge.svg?branch=master)

A ListView with sticky headers in which list items can be grouped to sections. Based on [scrollable_positioned_list](https://pub.dev/packages/scrollable_positioned_list).

Expand Down
14 changes: 7 additions & 7 deletions test/sticky_grouped_list_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ import 'package:flutter_test/flutter_test.dart';

import 'package:sticky_grouped_list/sticky_grouped_list.dart';


final List _elements = [
{'name': 'John', 'group': 'Team A'},
//{'name': 'Will', 'group': 'Team B'},
// {'name': 'Beth', 'group': 'Team A'},
// {'name': 'Beth', 'group': 'Team A'},
{'name': 'Miranda', 'group': 'Team B'},
// {'name': 'Mike', 'group': 'Team C'},
{'name': 'Danny', 'group': 'Team C'},
// {'name': 'Mike', 'group': 'Team C'},
{'name': 'Danny', 'group': 'Team C'},
];
void main() {
Widget _buildGroupSeperator(dynamic element) {
Widget _buildGroupSeperator(dynamic element) {
return Text(element['group']);
}

Expand All @@ -24,7 +23,7 @@ Widget _buildGroupSeperator(dynamic element) {
body: StickyGroupedListView(
groupBy: (element) => element['group'],
elements: _elements,
order:StickyGroupedListOrder.DESC,
order: StickyGroupedListOrder.DESC,
groupSeparatorBuilder: _buildGroupSeperator,
itemBuilder: (context, element) => Text(element['name']),
),
Expand Down Expand Up @@ -54,7 +53,8 @@ Widget _buildGroupSeperator(dynamic element) {
);
});

testWidgets('finds only one group separator per group', (WidgetTester tester) async {
testWidgets('finds only one group separator per group',
(WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
Expand Down

0 comments on commit 8cb30b0

Please sign in to comment.