Created
June 16, 2023 23:43
-
-
Save andersonmendesdev/118bec2d26f8d938c977e62b39f9a887 to your computer and use it in GitHub Desktop.
rotation vinil
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
import 'package:flutter/material.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData.dark().copyWith( | |
scaffoldBackgroundColor: darkBlue, | |
), | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text('Demo'), | |
), | |
body: SplashPage(), | |
), | |
); | |
} | |
} | |
class SplashPage extends StatefulWidget { | |
const SplashPage({super.key}); | |
@override | |
State<SplashPage> createState() => _SplashPageState(); | |
} | |
class _SplashPageState extends State<SplashPage> | |
with SingleTickerProviderStateMixin { | |
late final AnimationController _animationController; | |
final bool _isRotated = false; | |
@override | |
void initState() { | |
_animationController = AnimationController( | |
vsync: this, | |
duration: const Duration(seconds: 15), | |
)..repeat(); | |
super.initState(); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return SizedBox( | |
width: 300, | |
height: 300, | |
child: Stack( | |
children: [ | |
ClipOval( | |
child: RotationTransition( | |
turns: Tween(begin: 0.0, end: 4.0).animate(_animationController), | |
child: Container( | |
decoration: const BoxDecoration( | |
gradient: LinearGradient( | |
colors: [ | |
Color(0xFF212657), | |
Color(0xFF28346D), | |
Color(0xFF33498E), | |
Color(0xFF3A56A1), | |
Color(0xFF3D5BA9), | |
Color(0xFF405AA7), | |
Color(0xFF7D538B), | |
Color(0xFFAE4E74), | |
Color(0xFFD14A64), | |
Color(0xFFE7475A), | |
Color(0xFFEF4757), | |
], | |
begin: Alignment.topLeft, | |
end: Alignment.bottomRight, | |
stops: [ | |
0.02, | |
0.11, | |
0.28, | |
0.41, | |
0.5, | |
0.52, | |
0.73, | |
0.82, | |
0.92, | |
0.95, | |
1 | |
]), | |
), | |
), | |
), | |
), | |
// ...others widgets | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment