mirror of
https://github.com/cupcakearmy/fight-of-the-mobiles.git
synced 2026-04-02 10:15:23 +00:00
code
This commit is contained in:
23
src/flutter/lib/Components/BG.dart
Normal file
23
src/flutter/lib/Components/BG.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BG extends StatelessWidget {
|
||||
BG({@required this.child});
|
||||
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
child: child,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [Color(0xFF6FABFF), Color(0xFFE4FF71)],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
25
src/flutter/lib/Components/Button.dart
Normal file
25
src/flutter/lib/Components/Button.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Button extends StatelessWidget {
|
||||
Button({@required this.text, @required this.callback});
|
||||
|
||||
final String text;
|
||||
final Function callback;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: this.callback,
|
||||
child: Container(
|
||||
width: 180.0,
|
||||
height: 45.0,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100.0),
|
||||
border: Border.all(width: 1.0, color: const Color(0xFF000000))),
|
||||
child: Center(
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(fontSize: 20.0),
|
||||
))));
|
||||
}
|
||||
}
|
||||
21
src/flutter/lib/Components/ListItem.dart
Normal file
21
src/flutter/lib/Components/ListItem.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ListItem extends StatelessWidget {
|
||||
ListItem({this.left, this.right});
|
||||
|
||||
final int left;
|
||||
final String right;
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(right: 4.0),
|
||||
child: Text('${left.toString()}.',
|
||||
style: TextStyle(fontWeight: FontWeight.bold))),
|
||||
Text(right, style: TextStyle())
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
26
src/flutter/lib/Components/Logo.dart
Normal file
26
src/flutter/lib/Components/Logo.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Logo extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(overflow: Overflow.visible, children: <Widget>[
|
||||
Text(
|
||||
"QR NOTIFICATOR",
|
||||
style: TextStyle(fontFamily: "Jaapokki", fontSize: 30.0),
|
||||
),
|
||||
Positioned(
|
||||
right: -20.0,
|
||||
top: -5.0,
|
||||
child: Container(
|
||||
width: 20.0,
|
||||
height: 20.0,
|
||||
child: Center(
|
||||
child: Text('2', style: TextStyle(fontFamily: "Jaapokki"))),
|
||||
decoration: new BoxDecoration(
|
||||
color: Colors.orange,
|
||||
shape: BoxShape.circle,
|
||||
)),
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
37
src/flutter/lib/Components/SyncIcon.dart
Normal file
37
src/flutter/lib/Components/SyncIcon.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'dart:math';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/animation.dart';
|
||||
|
||||
class SyncIcon extends StatefulWidget {
|
||||
_SyncIcon createState() => _SyncIcon();
|
||||
}
|
||||
|
||||
class _SyncIcon extends State<SyncIcon> with SingleTickerProviderStateMixin {
|
||||
Animation<double> animation;
|
||||
AnimationController controller;
|
||||
|
||||
initState() {
|
||||
super.initState();
|
||||
controller = AnimationController(
|
||||
duration: const Duration(milliseconds: 2000), vsync: this);
|
||||
animation = Tween(begin: 0.0, end: pi * 2).animate(controller);
|
||||
animation.addListener(() => setState(() {}));
|
||||
controller.repeat();
|
||||
}
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return Transform.rotate(
|
||||
angle: animation.value,
|
||||
child: Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 10.0),
|
||||
height: 32.0,
|
||||
width: 32.0,
|
||||
child: Image.asset('images/sync.png'),
|
||||
));
|
||||
}
|
||||
|
||||
dispose() {
|
||||
controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user