Created
November 13, 2020 07:34
-
-
Save imaNNeo/c4c5898cc4fea79c4bd1a4f4dfab53ca to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import 'package:flutter/material.dart'; | |
| import 'dart:math' as math; | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| // Degree / Radians converter | |
| const double degrees2Radians = math.pi / 180.0; | |
| const double radians2Degrees = 180.0 / math.pi; | |
| double degrees(double radians) => radians * radians2Degrees; | |
| double radians(double degrees) => degrees * degrees2Radians; | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| title: 'Flutter 4 Fun', | |
| home: MainPage(), | |
| ); | |
| } | |
| } | |
| class MainPage extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| appBar: AppBar(backgroundColor: Colors.transparent, elevation: 0, title: Text('Flutter4Fun.com'),), | |
| backgroundColor: Color(0xffFF6958), | |
| body: Column( | |
| mainAxisAlignment: MainAxisAlignment.center, | |
| children: [ | |
| Transform.translate( | |
| offset: Offset(-30, 0), | |
| child: Transform( | |
| alignment: FractionalOffset.center, | |
| transform: Matrix4.identity() | |
| ..setEntry(3, 2, 0.01) | |
| ..rotateY(radians(5)), | |
| child: Container( | |
| height: 180, | |
| margin: EdgeInsets.symmetric(horizontal: 40), | |
| decoration: BoxDecoration( | |
| color: Colors.white.withOpacity(0.4), | |
| borderRadius: BorderRadius.all(Radius.circular(22)), | |
| ), | |
| ), | |
| ), | |
| ), | |
| ], | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment