Skip to content

Commit d58fe3e

Browse files
committed
Initial Commit
0 parents  commit d58fe3e

18 files changed

+692
-0
lines changed

.gitignore

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
12+
# IntelliJ related
13+
*.iml
14+
*.ipr
15+
*.iws
16+
.idea/
17+
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
21+
#.vscode/
22+
23+
# Flutter/Dart/Pub related
24+
**/doc/api/
25+
**/ios/Flutter/.last_build_id
26+
.dart_tool/
27+
.flutter-plugins
28+
.flutter-plugins-dependencies
29+
.packages
30+
.pub-cache/
31+
.pub/
32+
/build/
33+
34+
# Web related
35+
lib/generated_plugin_registrant.dart
36+
37+
# Symbolication related
38+
app.*.symbols
39+
40+
# Obfuscation related
41+
app.*.map.json
42+
43+
# Exceptions to above rules.
44+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

.metadata

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: 9b9b543d9265484132c798adaab6caca52055b08
8+
channel: beta
9+
10+
project_type: app

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# fcswebsite
2+
3+
Flutter Coffee Website
4+
5+
## Getting Started
6+
7+
This project is a starting point for a Flutter application.
8+
9+
A few resources to get you started if this is your first Flutter project:
10+
11+
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13+
14+
For help getting started with Flutter, view our
15+
[online documentation](https://flutter.dev/docs), which offers tutorials,
16+
samples, guidance on mobile development, and a full API reference.

assets/background.jpg

991 KB
Loading

assets/instagram.png

7.31 KB
Loading

lib/main.dart

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import 'package:fcswebsite/routes/home_route.dart';
2+
import 'package:flutter/material.dart';
3+
4+
void main() {
5+
runApp(Website());
6+
}
7+
8+
class Website extends StatelessWidget {
9+
10+
static final DateTime MEETING_DATE = DateTime(2020, 9, 19, 18);
11+
12+
// This widget is the root of your application.
13+
@override
14+
Widget build(BuildContext context) {
15+
return MaterialApp(
16+
title: 'Flutter Coffee Show',
17+
theme: ThemeData(
18+
// This is the theme of your application.
19+
//
20+
// Try running your application with "flutter run". You'll see the
21+
// application has a blue toolbar. Then, without quitting the app, try
22+
// changing the primarySwatch below to Colors.green and then invoke
23+
// "hot reload" (press "r" in the console where you ran "flutter run",
24+
// or simply save your changes to "hot reload" in a Flutter IDE).
25+
// Notice that the counter didn't reset back to zero; the application
26+
// is not restarted.
27+
primarySwatch: Colors.blue,
28+
// This makes the visual density adapt to the platform that you run
29+
// the app on. For desktop platforms, the controls will be smaller and
30+
// closer together (more dense) than on mobile platforms.
31+
visualDensity: VisualDensity.adaptivePlatformDensity,
32+
brightness: Brightness.dark
33+
),
34+
home: Scaffold(
35+
body: HomeRoute(),
36+
),
37+
);
38+
}
39+
}

lib/routes/home_route.dart

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
3+
import 'dart:ui';
4+
5+
import 'package:fcswebsite/widgets/countdown.dart';
6+
import 'package:fcswebsite/widgets/instagram_button.dart';
7+
import 'package:flutter/cupertino.dart';
8+
import 'package:flutter/material.dart';
9+
import 'package:google_fonts/google_fonts.dart';
10+
11+
12+
13+
class HomeRoute extends StatelessWidget {
14+
HomeRoute({Key key}) : super(key: key);
15+
16+
@override
17+
Widget build(BuildContext context) {
18+
return Container(
19+
constraints: BoxConstraints.expand(),
20+
decoration: BoxDecoration(
21+
image: DecorationImage(
22+
image: AssetImage("background.jpg"),
23+
fit: BoxFit.cover
24+
),
25+
),
26+
child: BackdropFilter(
27+
filter: ImageFilter.blur(sigmaX: 2, sigmaY: 2),
28+
child: Container(
29+
color: Colors.black38,
30+
child: Row(
31+
crossAxisAlignment: CrossAxisAlignment.center,
32+
mainAxisAlignment: MainAxisAlignment.center,
33+
children: [
34+
Column(
35+
crossAxisAlignment: CrossAxisAlignment.center,
36+
mainAxisAlignment: MainAxisAlignment.center,
37+
children: [
38+
Text("Flutter Coffee Show", style: GoogleFonts.homemadeApple(
39+
fontSize: 48
40+
)),
41+
SizedBox(height: 260),
42+
Text("Stay tuned!", style: GoogleFonts.homemadeApple(
43+
fontSize: 36,
44+
)),
45+
46+
SizedBox(height: 40),
47+
48+
Countdown(),
49+
50+
InstagramButton(),
51+
],
52+
),
53+
],
54+
),
55+
),
56+
),
57+
);
58+
}
59+
60+
}

lib/widgets/countdown.dart

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import 'dart:async';
2+
3+
import 'package:fcswebsite/main.dart';
4+
import 'package:fcswebsite/widgets/countdown_number.dart';
5+
import 'package:flutter/material.dart';
6+
import 'package:flutter/widgets.dart';
7+
8+
class Countdown extends StatefulWidget {
9+
Countdown({Key key}) : super(key: key);
10+
11+
@override
12+
_CountdownState createState() => _CountdownState();
13+
}
14+
15+
class _CountdownState extends State<Countdown> {
16+
Timer _timer;
17+
Duration _remainingTime;
18+
19+
20+
@override
21+
void initState() {
22+
_remainingTime = Website.MEETING_DATE.difference(DateTime.now());
23+
_timer = Timer.periodic(const Duration(seconds: 1), (timer) {
24+
setState(() {
25+
_remainingTime = Website.MEETING_DATE.difference(DateTime.now());
26+
});
27+
});
28+
super.initState();
29+
}
30+
31+
@override
32+
void dispose() {
33+
_timer.cancel();
34+
super.dispose();
35+
}
36+
37+
@override
38+
Widget build(BuildContext context) {
39+
return Row(
40+
children: [
41+
42+
CountdownNumber(
43+
number: _remainingTime.inDays.toString().padLeft(2, '0'),
44+
subtitle: "DAYS",
45+
),
46+
SizedBox(width: 32),
47+
CountdownNumber(
48+
number: (_remainingTime.inHours % 24).toString().padLeft(2, '0'),
49+
subtitle: "HOURS",
50+
),
51+
52+
SizedBox(width: 32),
53+
CountdownNumber(
54+
number: (_remainingTime.inMinutes % 60).toString().padLeft(2, '0'),
55+
subtitle: "MINUTES",
56+
),
57+
58+
SizedBox(width: 32),
59+
CountdownNumber(
60+
number: (_remainingTime.inSeconds % 60).toString().padLeft(2, '0'),
61+
subtitle: "SECONDS",
62+
),
63+
],
64+
);
65+
}
66+
}

lib/widgets/countdown_number.dart

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:google_fonts/google_fonts.dart';
3+
4+
class CountdownNumber extends StatelessWidget {
5+
6+
final String subtitle;
7+
final String number;
8+
9+
const CountdownNumber({Key key, @required this.number, @required this.subtitle}) : super(key: key);
10+
11+
@override
12+
Widget build(BuildContext context) {
13+
return Container(
14+
width: 140,
15+
height: 140,
16+
decoration: BoxDecoration(
17+
color: Colors.black38,
18+
borderRadius: BorderRadius.all(Radius.circular(200))
19+
),
20+
child: Column(
21+
mainAxisAlignment: MainAxisAlignment.center,
22+
children: [
23+
Text(this.number, style: GoogleFonts.roboto(
24+
fontSize: 80,
25+
fontWeight: FontWeight.w100
26+
)),
27+
Text(this.subtitle, style: GoogleFonts.roboto(fontSize: 16,
28+
fontWeight: FontWeight.bold
29+
))
30+
],
31+
),
32+
);
33+
}
34+
}

lib/widgets/instagram_button.dart

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import 'dart:html';
2+
import 'package:flutter/material.dart';
3+
4+
class InstagramButton extends StatelessWidget {
5+
@override
6+
Widget build(BuildContext context) {
7+
return Tooltip(
8+
message: "Follow us on Instagram!",
9+
child: Container(
10+
height: 60,
11+
width: 60,
12+
child: Material(
13+
color: Colors.black38,
14+
borderRadius: BorderRadius.all(Radius.circular(200)),
15+
child: InkWell(
16+
onTap: () async {
17+
window.open("https://instagram.com/flutter.coffee", "Instagram");
18+
},
19+
child: Padding(
20+
padding: const EdgeInsets.all(8.0),
21+
child: Image(image: AssetImage("instagram.png")),
22+
),
23+
),
24+
),
25+
),
26+
);
27+
}
28+
}

0 commit comments

Comments
 (0)