Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRamberger committed Dec 4, 2022
2 parents 6a289b9 + a707e8d commit 3845329
Show file tree
Hide file tree
Showing 10 changed files with 410 additions and 66 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/tag.yaml → .github/oldworkflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: "tag"
on:
push:
branches:
- "development"
pull_request:
branches:
- "development"
# name: "tag"
# on:
# push:
# branches:
# - "development"
# pull_request:
# branches:
# - "development"

jobs:
tag:
name: "git tag"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
# jobs:
# tag:
# name: "git tag"
# runs-on: "ubuntu-latest"
# steps:
# - uses: actions/checkout@v3

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# - name: Bump version and push tag
# id: tag_version
# uses: mathieudutour/github-tag-action@v6.1
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# - name: Create a GitHub release
# uses: ncipollo/release-action@v1
# with:
Expand Down
16 changes: 16 additions & 0 deletions lib/components/HeadingListTile.component.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import 'package:flutter/material.dart';

class HeadingListTile extends StatelessWidget {
const HeadingListTile({required this.labelText, super.key});

final String labelText;

@override
Widget build(BuildContext context) {
return ListTile(
title: Text(
labelText,
style: Theme.of(context).textTheme.headline5,
));
}
}
53 changes: 53 additions & 0 deletions lib/components/ListViewCard.component.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import 'package:badges/badges.dart';
import 'package:flutter/material.dart';
import 'package:hacklytics_checkin_flutter/components/HeadingListTile.component.dart';

class ListViewCard extends StatelessWidget {
const ListViewCard({this.labelText = "", required this.children, super.key});

final String labelText;
final List<Widget> children;

@override
Widget build(BuildContext context) {
return labelText.isEmpty ? _buildNoLabel() : _buildWithLabel();
}

_buildNoLabel() {
return Card(
child: ListView(
shrinkWrap: true,
physics: const ClampingScrollPhysics(),
children: children,
),
);
}

_buildWithLabel() {
return Card(
child: ListView(
shrinkWrap: true,
physics: const ClampingScrollPhysics(),
children: [
HeadingListTile(labelText: labelText),
// const Divider(),
...children
],
),
);
}
}

// Badge(
// badgeContent: Text(labelText),
// shape: BadgeShape.square,
// alignment: Alignment.topRight,
// position: BadgePosition.topEnd(top: 2, end: 2),
// borderRadius: BorderRadius.circular(10),
// child: Card(
// child: ListView(
// shrinkWrap: true,
// physics: const ClampingScrollPhysics(),
// children: children,
// ),
// ));
55 changes: 55 additions & 0 deletions lib/components/toast.component.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import 'package:flutter/material.dart';

class ConfirmToast extends StatelessWidget {
const ConfirmToast({required this.labelText, super.key});

final String labelText;

@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 12.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25.0),
color: Colors.green.shade500,
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Icons.check),
const SizedBox(
width: 12.0,
),
Text(labelText),
],
),
);
}
}

class ErrorToast extends StatelessWidget {
const ErrorToast({required this.labelText, super.key});

final String labelText;

@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 12.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25.0),
color: Colors.red.shade500,
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Icons.error),
const SizedBox(
width: 12.0,
),
Text(labelText),
],
),
);
}
}
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import 'package:flutter/material.dart';

import 'App.dart';

GlobalKey globalKey = GlobalKey();

void main() {
runApp(const MyApp());
}
76 changes: 39 additions & 37 deletions lib/view/Home.view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_flutter/amplify_flutter.dart';

import 'package:flutter/material.dart';
import 'package:hacklytics_checkin_flutter/components/ListViewCard.component.dart';

import 'package:hacklytics_checkin_flutter/components/statuscard.component.dart';
import 'package:hacklytics_checkin_flutter/models/ModelProvider.dart';
Expand Down Expand Up @@ -81,7 +82,7 @@ class _HomeViewState extends State<HomeView> {
leading: const Icon(Icons.settings),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return const SettingsView();
return SettingsView(user: _user);
}));
},
),
Expand Down Expand Up @@ -138,43 +139,44 @@ class _HomeViewState extends State<HomeView> {

return _error.isNotEmpty
? StatusCard(message: _error, success: false)
: Column(children: [
ListTile(
title: Text(
"Events",
style: textTheme.headline5,
)),
Expanded(
child: ListView.separated(
itemCount: _events.length,
itemBuilder: (context, index) {
return ListTile(
title: Row(children: [
Padding(
padding: const EdgeInsets.only(right: 8),
child: Text(_events[index].name),
),
Chip(
label: _events[index].status == true
? const Text("open")
: const Text("closed"),
backgroundColor: _events[index].status == true
? Colors.green.shade500
: Colors.red.shade500,
)
]),
subtitle: Text(_events[index].description ?? ""),
enabled: _events[index].status == true,
onTap: () {
// go to event page
print("event pressed ${_events[index].name}");
},
);
: SingleChildScrollView(
child: ListViewCard(labelText: "Events", children: [
ListView.separated(
shrinkWrap: true,
physics: const ClampingScrollPhysics(),
itemCount: _events.length,
itemBuilder: (context, index) {
return ListTile(
title: Row(children: [
Padding(
padding: const EdgeInsets.only(right: 8),
child: Text(_events[index].name),
),
Chip(
label: _events[index].status == true
? const Text("open")
: const Text("closed"),
backgroundColor: _events[index].status == true
? Colors.green.shade500
: Colors.red.shade500,
)
]),
subtitle: Text(_events[index].description ?? ""),
enabled: _events[index].status == true,
trailing: _events[index].status == true
? const Icon(Icons.chevron_right)
: null,
onTap: () {
// go to event page
// TODO: implement
print("event pressed ${_events[index].name}");
},
separatorBuilder: (context, index) {
return const Divider();
}))
]);
);
},
separatorBuilder: (context, index) {
return const Divider();
})
]));
}

getUserInfo(Function(Status) callback) async {
Expand Down
Loading

0 comments on commit 3845329

Please sign in to comment.