Skip to content

Instantly share code, notes, and snippets.

View Roaa94's full-sized avatar
πŸ’™

Roaa Roaa94

πŸ’™
View GitHub Profile
@Roaa94
Roaa94 / explicit_animations_example.dart
Created April 23, 2022 22:51
Explicit Animations Example
class ExplicitAnimations extends StatefulWidget {
const ExplicitAnimations({Key? key}) : super(key: key);
@override
State<ExplicitAnimations> createState() => _ExplicitAnimationsState();
}
class _ExplicitAnimationsState extends State<ExplicitAnimations>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
@Roaa94
Roaa94 / animated_builder_example.dart
Created April 24, 2022 11:59
Flutter AnimatedBuilder Example (Gradient Animation)
class AnimatedBuilderExample extends StatefulWidget {
const AnimatedBuilderExample({Key? key}) : super(key: key);
@override
_AnimatedBuilderExampleState createState() => _AnimatedBuilderExampleState();
}
class _AnimatedBuilderExampleState extends State<AnimatedBuilderExample>
with SingleTickerProviderStateMixin {
late final AnimationController _controller;
@Roaa94
Roaa94 / main.dart
Created April 25, 2022 04:11
Flutter Cool Toolbar
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@Roaa94
Roaa94 / main.dart
Last active April 27, 2022 23:12
Flutter Carousel
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Carousel',
debugShowCheckedModeBanner: false,
@Roaa94
Roaa94 / main.dart
Created June 9, 2022 23:37
Flutter Cool Card Swiper
import 'dart:math' as math;
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Starter',
@Roaa94
Roaa94 / infinite_scrolling.dart
Last active September 25, 2023 15:47
Infinite Scrolling with Riverpod
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:dio/dio.dart';
// Disclaimer: This uses the "The Movie Database API (TMDB)"
// https://developers.themoviedb.org/3/getting-started
// With this endpoint:
// https://developers.themoviedb.org/3/people/get-popular-people
/// The FutureProvider that does the fetching of the paginated list of people
@Roaa94
Roaa94 / main.dart
Created August 13, 2022 13:36
Animated Scroll Views
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Animated Scroll View Item',
debugShowCheckedModeBanner: false,
@Roaa94
Roaa94 / recipes_page.dart
Last active September 9, 2022 18:31
Flutter Vikings Talk Animation Demo - RecipesPage widget code
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:recipes_ui/core/enums/screen_size.dart';
import 'package:recipes_ui/features/recipes/recipes_data.dart';
import 'package:recipes_ui/features/recipes/recipes_layout.dart';
import 'package:recipes_ui/features/recipes/views/widgets/recipe_list_item.dart';
import 'package:recipes_ui/features/recipes/views/widgets/recipe_list_item_wrapper.dart';
class RecipesPage extends StatefulWidget {
const RecipesPage({Key? key}) : super(key: key);
@Roaa94
Roaa94 / recipe_list_item_wrapper.dart
Created September 9, 2022 19:04
Flutter Vikings Talk Animation Demo - RecipeListItemWrapper widget code
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class RecipeListItemWrapper extends StatefulWidget {
const RecipeListItemWrapper({
Key? key,
required this.child,
this.keepAlive = false,
this.scrollDirection = ScrollDirection.forward,
}) : super(key: key);
@Roaa94
Roaa94 / gyroscope_effect.dart
Last active September 10, 2022 19:34
Flutter Vikings Talk Animation Demo - GyroscopeEffect widget code
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:recipes_ui/core/widgets/adaptive_offset_effect.dart';
import 'package:recipes_ui/features/recipes/providers/gyroscope_provider.dart';
import 'package:sensors_plus/sensors_plus.dart';
class GyroscopeEffect extends StatefulWidget {
const GyroscopeEffect({
Key? key,
required this.child,