-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from mafreud/animated_positioned
add animated positioned
- Loading branch information
Showing
8 changed files
with
125 additions
and
32 deletions.
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
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
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,82 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:proximity/app/customized_widgets/custom_app_bar.dart'; | ||
import 'package:proximity/constants/proximity_colors.dart'; | ||
|
||
class AnimatedPositionedPage extends StatefulWidget { | ||
@override | ||
_AnimatedPositionedPageState createState() => _AnimatedPositionedPageState(); | ||
} | ||
|
||
class _AnimatedPositionedPageState extends State<AnimatedPositionedPage> { | ||
var selected = false; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final screenHeight = MediaQuery.of(context).size.height; | ||
final screenWidth = MediaQuery.of(context).size.width; | ||
|
||
return Scaffold( | ||
appBar: CustomAppBar( | ||
title: 'AnimatedPositioned', | ||
documentUrl: | ||
'https://api.flutter.dev/flutter/widgets/AnimatedPositioned-class.html', | ||
videoUrl: 'https://youtu.be/hC3s2YdtWt8', | ||
), | ||
body: Center( | ||
child: Stack( | ||
alignment: Alignment.center, | ||
children: [ | ||
Container( | ||
height: screenHeight * 0.6, | ||
width: screenWidth * 0.9, | ||
color: ProximityColors.secondaryBlue, | ||
child: Align( | ||
alignment: Alignment.topCenter, | ||
child: Padding( | ||
padding: const EdgeInsets.all(20.0), | ||
child: Text( | ||
'Stack Widget', | ||
style: TextStyle(fontSize: 30), | ||
), | ||
), | ||
), | ||
), | ||
Align( | ||
alignment: Alignment.center, | ||
child: Text( | ||
'Rate my app 😆', | ||
style: TextStyle(fontSize: screenWidth / 20), | ||
), | ||
), | ||
AnimatedPositioned( | ||
top: selected ? screenHeight / 3.0 : screenHeight / 2.4, | ||
curve: Curves.fastOutSlowIn, | ||
duration: const Duration(seconds: 1), | ||
child: InkWell( | ||
onTap: () { | ||
setState(() { | ||
selected = !selected; | ||
}); | ||
}, | ||
child: Material( | ||
elevation: 10, | ||
child: Container( | ||
color: ProximityColors.flutterBlue, | ||
height: screenHeight / 15, | ||
width: screenWidth / 2, | ||
child: Align( | ||
child: Text( | ||
'tap me 🤩', | ||
style: TextStyle(fontSize: 20), | ||
), | ||
), | ||
), | ||
), | ||
), | ||
) | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
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,8 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ProximityColors { | ||
static final flutterBlue = Color(0xFF02569B); | ||
static final primaryBlue = Color(0xFF0175C2); | ||
static final secondaryBlue = Color(0xFF13B9FD); | ||
static final googleGray = Color(0xFF202124); | ||
} |
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