Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull to refresh feature with UI changed #175

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 44 additions & 43 deletions lib/components/hike_button.dart
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
import 'package:beacon/utilities/constants.dart';
import 'package:flutter/material.dart';

class HikeButton extends StatelessWidget {
final Function onTap;
final String text;
final double textSize;
final Color textColor;
final Color borderColor;
final Color buttonColor;
final double buttonWidth;
final double buttonHeight;
HikeButton(
{this.onTap,
this.borderColor = Colors.white,
this.buttonColor = kYellow,
this.text,
this.textColor = Colors.white,
this.buttonWidth = optbwidth,
this.buttonHeight = optbheight,
this.textSize = 18});

@override
Widget build(BuildContext context) {
return ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: buttonColor,
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(50.0),
side: BorderSide(color: borderColor)),
),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: buttonWidth, vertical: buttonHeight),
child: Text(
text,
style: TextStyle(color: textColor, fontSize: textSize),
),
),
onPressed: onTap,
);
}
}

import 'package:beacon/utilities/constants.dart';
import 'package:flutter/material.dart';

class HikeButton extends StatelessWidget {
final Function onTap;
final String text;
final double textSize;
final Color textColor;
final Color borderColor;
final Color buttonColor;
final double buttonWidth;
final double buttonHeight;
HikeButton(
{this.onTap,
this.borderColor = Colors.white,
this.buttonColor = kYellow,
this.text,
this.textColor = Colors.white,
this.buttonWidth = optbwidth,
this.buttonHeight = optbheight,
this.textSize = 18});

@override
Widget build(BuildContext context) {
return ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: buttonColor,
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(50.0),
side: BorderSide(color: borderColor)),
),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: buttonWidth, vertical: buttonHeight),
child: Text(
text,
style: TextStyle(color: textColor, fontSize: textSize),
),
),
onPressed: onTap,
);
}
}
44 changes: 44 additions & 0 deletions lib/components/reloading_icon.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import 'package:beacon/utilities/constants.dart';
import 'package:flutter/material.dart';

class ReloadIcon extends StatefulWidget {
const ReloadIcon({Key key}) : super(key: key);

@override
State<ReloadIcon> createState() => _ReloadIconState();
}

class _ReloadIconState extends State<ReloadIcon> with TickerProviderStateMixin {
AnimationController _animation;
@override
void initState() {
super.initState();
_animation = AnimationController(
vsync: this,
duration: Duration(seconds: 10),
upperBound: 1,
)..repeat();
}

@override
void dispose() {
_animation.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
_animation..forward();
return RotationTransition(
turns: Tween(begin: 0.0, end: 10.0).animate(_animation),
child: Transform.rotate(
angle: 0.5,
child: Icon(
Icons.refresh,
color: kBlue,
size: 30,
),
),
);
}
}
Loading