Skip to content

Instantly share code, notes, and snippets.

View justkawal's full-sized avatar
:electron:
Let's talk

justkawal justkawal

:electron:
Let's talk
View GitHub Profile
@RodBr
RodBr / main5.dart
Last active April 9, 2023 06:09
Themes plus persistence
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart'; //STEP 4 - Import shared_preferences
void main() {
Get.lazyPut<ThemeController>(
() => ThemeController()); //STEP 5 - lazy create ThemeController
runApp(MyApp());
}
@klaszlo8207
klaszlo8207 / simple_animated_widget.dart
Created January 6, 2020 15:43
SimpleAnimatedWidget
import 'package:animator/animator.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
class SimpleAnimatedWidget extends StatelessWidget {
SimpleAnimatedWidget({
@required this.child,
@required this.tween,
@required this.builder,
this.curve = Curves.linear,
@klaszlo8207
klaszlo8207 / scaling_gesture_detector.dart
Last active August 16, 2022 00:44
Flutter ScalingGestureDetector for a 3D view (you can pan and zoom in/out)
import 'package:advert_app/utils/logging.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/gestures.dart';
class ScalingGestureDetector extends StatefulWidget {
final Widget child;
final void Function(Offset initialPoint) onPanStart;
final void Function(Offset initialPoint, Offset delta) onPanUpdate;
final void Function() onPanEnd;
@collinjackson
collinjackson / main.dart
Last active August 17, 2023 20:06
PageView example with dots indicator
// Copyright 2017, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(new MyApp());
}