-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
357 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks you configure in | ||
# VS Code which you may wish to be included in version control, so this line | ||
# is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
**/doc/api/ | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.packages | ||
.pub-cache/ | ||
.pub/ | ||
/build/ | ||
|
||
# Web related | ||
lib/generated_plugin_registrant.dart | ||
|
||
# Exceptions to above rules. | ||
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: 0b8abb4724aa590dd0f429683339b1e045a1594d | ||
channel: stable | ||
|
||
project_type: app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# bloom | ||
|
||
A beautiful app with parallax animation | ||
|
||
Design by [Punit Chawla on youtube](https://bit.ly/2y01V2i) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
import 'dart:math' as math; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/rendering.dart'; | ||
import 'package:flutter_gifimage/flutter_gifimage.dart'; | ||
|
||
void main() => runApp(MyApp()); | ||
|
||
class MyApp extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return MaterialApp( | ||
title: 'Bloom', | ||
theme: ThemeData( | ||
primarySwatch: Colors.blue, | ||
), | ||
home: Home(), | ||
debugShowCheckedModeBanner: false, | ||
); | ||
} | ||
} | ||
|
||
class Home extends StatefulWidget { | ||
Home({Key key}) : super(key: key); | ||
|
||
@override | ||
_HomeState createState() => _HomeState(); | ||
} | ||
|
||
enum Direction { up, down } | ||
|
||
class _HomeState extends State<Home> with SingleTickerProviderStateMixin { | ||
ScrollController _scrollController; | ||
Direction _direction; | ||
GifController _gifController; | ||
double _frame = 0.0; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
|
||
_gifController = GifController(vsync: this); | ||
_gifController.value = _frame; | ||
|
||
_scrollController = ScrollController(); | ||
_direction = Direction.down; | ||
|
||
_scrollController.addListener(_handleScrollEvent); | ||
} | ||
|
||
void _handleScrollEvent() { | ||
if (_direction == Direction.down) { | ||
setState(() { | ||
_frame -= 0.5; | ||
_gifController.value = math.min(math.max(_frame, 0.0), 59.0); | ||
}); | ||
} else if (_direction == Direction.up) { | ||
setState(() { | ||
_frame += 0.5; | ||
_gifController.value = math.min(math.max(_frame, 0.0), 59.0); | ||
}); | ||
} | ||
} | ||
|
||
@override | ||
void dispose() { | ||
_scrollController.removeListener(_handleScrollEvent); | ||
_scrollController.dispose(); | ||
super.dispose(); | ||
} | ||
|
||
bool _handleNotification(Notification notification) { | ||
if (notification is ScrollNotification) { | ||
if (notification is UserScrollNotification && | ||
notification.direction == ScrollDirection.forward) { | ||
setState(() { | ||
_direction = Direction.down; | ||
}); | ||
} else if (notification is UserScrollNotification && | ||
notification.direction == ScrollDirection.reverse) { | ||
setState(() { | ||
_direction = Direction.up; | ||
}); | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
|
||
Widget _upperSection() { | ||
final TextStyle textStyle = | ||
TextStyle(fontFamily: 'worksans', color: Colors.white); | ||
|
||
return Container( | ||
width: MediaQuery.of(context).size.width, | ||
height: MediaQuery.of(context).size.height, | ||
decoration: BoxDecoration( | ||
image: DecorationImage( | ||
image: AssetImage('images/background.png'), fit: BoxFit.cover)), | ||
child: Scaffold( | ||
backgroundColor: Colors.transparent, | ||
appBar: AppBar( | ||
elevation: 0.0, | ||
backgroundColor: Colors.transparent, | ||
leading: Image.asset('images/xd.png'), | ||
actions: <Widget>[Image.asset('images/menu.png')], | ||
), | ||
body: Column( | ||
children: <Widget>[ | ||
SizedBox( | ||
height: 60.0, | ||
), | ||
Text( | ||
"Let your ideas", | ||
style: textStyle.copyWith( | ||
fontSize: 23, | ||
fontWeight: FontWeight.w600, | ||
), | ||
), | ||
Text( | ||
"Bloom", | ||
style: textStyle.copyWith( | ||
fontSize: 100, fontWeight: FontWeight.w700), | ||
), | ||
SizedBox( | ||
height: 30.0, | ||
), | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 30.0), | ||
child: Text( | ||
"Share your amazing Adobe Xd Projects for the world to see", | ||
style: textStyle.copyWith( | ||
fontSize: 18, | ||
fontWeight: FontWeight.w400, | ||
), | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
SizedBox( | ||
height: 37, | ||
), | ||
Image.asset('images/arrow.png'), | ||
Spacer(), | ||
FittedBox( | ||
child: GifImage( | ||
controller: _gifController, | ||
image: AssetImage('images/bloom.gif'), | ||
height: 300.0, | ||
width: 400.0, | ||
), | ||
) | ||
], | ||
), | ||
), | ||
); | ||
} | ||
|
||
Widget _lowerPart() { | ||
return Material( | ||
child: Container( | ||
width: MediaQuery.of(context).size.width, | ||
height: MediaQuery.of(context).size.height / 2, | ||
color: Colors.pink.shade50, | ||
child: Align( | ||
alignment: Alignment.bottomCenter, | ||
child: Container( | ||
margin: EdgeInsets.only(bottom: 20.0), | ||
child: FloatingActionButton( | ||
backgroundColor: Colors.pink.shade100, | ||
splashColor: Colors.green, | ||
child: Icon( | ||
Icons.refresh, | ||
color: Colors.black, | ||
), | ||
onPressed: () { | ||
_scrollController.animateTo(0.0, | ||
duration: Duration(milliseconds: 800), | ||
curve: Curves.fastLinearToSlowEaseIn); | ||
_gifController.animateTo(0.0, duration: Duration(seconds: 1)); | ||
setState(() { | ||
_frame = 0.0; | ||
}); | ||
}, | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return NotificationListener( | ||
onNotification: _handleNotification, | ||
child: ListView( | ||
controller: _scrollController, | ||
children: <Widget>[_upperSection(), _lowerPart()], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: bloom | ||
description: A new Flutter project. | ||
|
||
# The following defines the version and build number for your application. | ||
# A version number is three numbers separated by dots, like 1.2.43 | ||
# followed by an optional build number separated by a +. | ||
# Both the version and the builder number may be overridden in flutter | ||
# build by specifying --build-name and --build-number, respectively. | ||
# In Android, build-name is used as versionName while build-number used as versionCode. | ||
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning | ||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. | ||
# Read more about iOS versioning at | ||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html | ||
version: 1.0.0+1 | ||
|
||
environment: | ||
sdk: ">=2.1.0 <3.0.0" | ||
|
||
dependencies: | ||
flutter: | ||
sdk: flutter | ||
|
||
# The following adds the Cupertino Icons font to your application. | ||
# Use with the CupertinoIcons class for iOS style icons. | ||
cupertino_icons: ^0.1.2 | ||
flutter_gifimage: ^1.0.0 | ||
|
||
dev_dependencies: | ||
flutter_test: | ||
sdk: flutter | ||
|
||
|
||
# For information on the generic Dart part of this file, see the | ||
# following page: https://dart.dev/tools/pub/pubspec | ||
|
||
# The following section is specific to Flutter. | ||
flutter: | ||
|
||
# The following line ensures that the Material Icons font is | ||
# included with your application, so that you can use the icons in | ||
# the material Icons class. | ||
uses-material-design: true | ||
|
||
# To add assets to your application, add an assets section, like this: | ||
assets: | ||
- images/ | ||
|
||
# An image asset can refer to one or more resolution-specific "variants", see | ||
# https://flutter.dev/assets-and-images/#resolution-aware. | ||
|
||
# For details regarding adding assets from package dependencies, see | ||
# https://flutter.dev/assets-and-images/#from-packages | ||
|
||
# To add custom fonts to your application, add a fonts section here, | ||
# in this "flutter" section. Each entry in this list should have a | ||
# "family" key with the font family name, and a "fonts" key with a | ||
# list giving the asset and other descriptors for the font. For | ||
# example: | ||
fonts: | ||
- family: worksans | ||
fonts: | ||
- asset: fonts/WorkSans-Regular.ttf | ||
- asset: fonts/WorkSans-Medium.ttf | ||
weight: 600 | ||
- asset: fonts/WorkSans-Light.ttf | ||
weight: 400 | ||
- asset: fonts/WorkSans-ExtraBold.ttf | ||
weight: 700 | ||
# | ||
# For details regarding fonts from package dependencies, | ||
# see https://flutter.dev/custom-fonts/#from-packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// This is a basic Flutter widget test. | ||
// | ||
// To perform an interaction with a widget in your test, use the WidgetTester | ||
// utility that Flutter provides. For example, you can send tap and scroll | ||
// gestures. You can also use WidgetTester to find child widgets in the widget | ||
// tree, read text, and verify that the values of widget properties are correct. | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
import 'package:bloom/main.dart'; | ||
|
||
void main() { | ||
testWidgets('Counter increments smoke test', (WidgetTester tester) async { | ||
// Build our app and trigger a frame. | ||
await tester.pumpWidget(MyApp()); | ||
|
||
// Verify that our counter starts at 0. | ||
expect(find.text('0'), findsOneWidget); | ||
expect(find.text('1'), findsNothing); | ||
|
||
// Tap the '+' icon and trigger a frame. | ||
await tester.tap(find.byIcon(Icons.add)); | ||
await tester.pump(); | ||
|
||
// Verify that our counter has incremented. | ||
expect(find.text('0'), findsNothing); | ||
expect(find.text('1'), findsOneWidget); | ||
}); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.