Flutter Heroes
26.1K subscribers
272 photos
2 videos
31.1K links
Download Telegram
New post on /r/flutterdev subreddit:

<b>call method from another class using animationcontroller</b>
i new on flutter i want to call a method to a antother class i find this error 'LateInitializationError: Field 'animationController' has not been initialized.'could somebody help me please?import 'package:flutter/animation.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
<a href="/u/override">u/override</a>
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage>
with SingleTickerProviderStateMixin {
late AnimationController animationController;
static const double maxSlide = 225.0;
static const double minDragStartEdge = 60;
static const double maxDragstartEdge = maxSlide - 16;
bool _canBeDragged = false;
<a href="/u/override">u/override</a>
void initState() {
super.initState();
animationController = AnimationController(
vsync: this, duration: const Duration(milliseconds: 250));
  }
void toggle() => animationController.isDismissed ? open() : close();
void close() => animationController.reverse();
void open() => animationController.forward();
// Declaration des page
var drawer = MyDrawer();
var customChild = MyCustomChild();
<a href="/u/override">u/override</a>
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: GestureDetector(
//gestation de comportments des page
onHorizontalDragStart: _onDragStart,
onHorizontalDragUpdate: _onDragUpdate,
onHorizontalDragEnd: _onDragEnd,
onTap: toggle,
child: AnimatedBuilder(
animation: animationController,
builder: (context, _) {
double numValue = animationController.value;
final slide = numValue * maxSlide;
final scale = 1.0 - (numValue * 0.3);
return Stack(children: [
drawer,
Transform(
transform: Matrix4.identity()
                        ..translate(slide)
                        ..scale(scale),
alignment: Alignment.centerLeft,
child: customChild),
                ]);
              }),
        ),
      ),
    );
  }
void _onDragStart(DragStartDetails details) {
bool isDragOpenFromLeft = animationController.isDismissed &&
details.globalPosition.dx < minDragStartEdge;
bool isDragCloseFromRight = animationController.isCompleted &&
details.globalPosition.dx > maxDragstartEdge;
_canBeDragged = isDragOpenFromLeft || isDragCloseFromRight;
  }
void _onDragUpdate(DragUpdateDetails details) {
if (_canBeDragged) {
double delta = details.primaryDelta! / maxSlide;
animationController.value += delta;
    }
  }
void _onDragEnd(DragEndDetails details) {
if (animationController.isDismissed || animationController.isCompleted) {
return;
    }
if (details.velocity.pixelsPerSecond.dx.abs() >= 365.0) {
double visualVelocity = details.velocity.pixelsPerSecond.dx /
MediaQuery.of(context).size.width;
animationController.fling(velocity: visualVelocity);
    } else if (animationController.value < 0.5) {
close();
    } else {
open();
    }
  }
}
class MyDrawer extends StatefulWidget {
MyDrawer({Key? key}) : super(key: key);
<a href="/u/override">u/override</a>
_MyDrawerState createState() => _MyDrawerState();
}
class _MyDrawerState extends State<MyDrawer> {
<a href="/u/override">u/override</a>
Widget build(BuildContext context) => Scaffold(
backgroundColor: //const Color.fromRGBO(21, 30, 61, 1),
Theme.of(context).primaryColor,
body: Container());
}
class MyCustomChild extends StatefulWidget {
// ignore: non_constant_identifier_names
const MyCustomChild({Key? key}) : super(key: key);
<a href="/u/override">u/override</a>
_MyCustomChildState createState() => _MyCustomChildState();
}
class _MyCustomChildState extends State<MyCustomChild> {
_HomePageState toggleDrawer = _HomePageState();
<a href="/u/override">u/override</a>
Widget build(BuildContext context) => Scaffold(
backgroundColor: Colors.yellow[800],
appBar: AppBar(
leading: IconButton(
onPressed:…
New tweet from FlutterDev:

🦋 Chapter 3: Pop Quiz! Which of the following is NOT the job of a "Layout" widget? #flutterapprentice— Flutter (@FlutterDev) Nov 2, 2021

November 02, 2021 at 05:08PM
https://twitter.com/FlutterDev/status/1455567582019285004
New post on /r/flutterdev subreddit:

Flutter notification
I want to to make a notification to keep on ringing until i stop it myself (just like the alarm system). Anyone can help?

November 02, 2021 at 08:04PM by shabriko
https://ift.tt/3CGG6kT
New tweet from FlutterDev:

RT @GooglePlayDev: Learn about our new policy updates designed just for YOU!➞ https://t.co/oasW9ryxc4 📆 On November 17, tune in to hear about: Latest policy updates December’s compliance requirements Insights into new Families policies Get your questions answered by experts https://t.co/cpF0OBO2L7— Flutter (@FlutterDev) Nov 2, 2021

November 02, 2021 at 10:31PM
https://twitter.com/FlutterDev/status/1455648899532734477
New post on /r/flutterdev subreddit:

Has anyone implemented a Freemium Model into your app?
I'm looking into Monetizing my Note-Taking app and know there are many different ways to do this. I was wondering if anyone has experience in implementing a Freemium Model? Does it work and is it the best Payment Solution?

November 03, 2021 at 02:28AM by Dover21
https://ift.tt/3jYZqSW
New post on /r/flutterdev subreddit:

Flutter and macOS Monterey
Hey guys, I haven't updated my mac os yet and would be great if people could share some experiences and how stable it is at the moment.thanks!!!

November 03, 2021 at 06:08AM by marcuslr
https://ift.tt/3nPYqSd
New post on /r/flutterdev subreddit:

How did your null-safety migration go?
If you are working on a non-trivial Flutter application used in production where most of the app's code was written before null-safety was introduced, how did your null-safety migration go?I'm planning to give a short talk about null safety migration and running apps in unsound null safety, and I'd like to learn more about how your migration went. Please feel free to share as much about your experience as you can/want, I'd appreciate all comments!Did you migrate completely with the migration tool? How was your experience with the tool?Could you migrate the whole app in one step? Did you have to fix up a lot of things? Or did you "just let it run"? Are you happy with the result?How long did it take to migrate the app? / How long do you estimate it taking?Did you run in mixed-version, unsound mode? If yes, how long were you running in unsound mode?Did you find it hard to find null-safe versions of your dependencies? Did you have lots of forks that you then had to migrate on your own?Did the migration cause confusion within your team?Did the app size decrease significantly? If yes, by how much?Resources that could be interested for you if you don't know what this question is about:Migration to null safetyUnsound null safetyView Poll

November 03, 2021 at 11:06AM by serial_dev
https://ift.tt/3k0PYyD
New post on /r/flutterdev subreddit:

Jobs
In regards to flutter jobs, are they actually plentiful in the US? I don’t see many job postings so it has me wondering.Also for anyone currently working as a flutter dev, did you start with native systems first or did you start with flutter?

November 03, 2021 at 04:51PM by CalitaWyatt4
https://ift.tt/3w9Ettu
New tweet from FlutterDev:

C. Displaying content is the correct answer! 🥳— Flutter (@FlutterDev) Nov 3, 2021

November 03, 2021 at 06:08PM
https://twitter.com/FlutterDev/status/1455945006246625282
New post on /r/flutterdev subreddit:

My first Flutter App released on IOS and Android
I would like to share my article that talks about my app for hospitals workers and maybe it can be useful for someone here.https://vincenzopalazzo.medium.com/shift-you-an-app-for-hospital-workers-9591d986b639​Thanks to make Flutter great.

November 03, 2021 at 10:14PM by crazyjoker96
https://ift.tt/3jZyXVm
New post on /r/flutterdev subreddit:

Flutter Web for a Netflix clone ?
I am thinking about using flutter for my Netflix cloneSo targeting Mobile and WebBut is Flutter Web is good for a OTT / video on demand website like Netflix ?I am asking in terms of performance of listings such as series list and episode lists, search results etc(For playing video I will use nativeplatform views)Tell your ideas

November 04, 2021 at 05:18AM by RageshAntony
https://ift.tt/3k4lfRj
New post on /r/flutterdev subreddit:

Please drop the link to your Flutter web Apps
I am planning to build a website with Flutter. Kindly drop the link to the existing websites you built with Flutter, I will also like to know how you handle responsiveness in your app.

November 04, 2021 at 12:05PM by Vikilinho
https://ift.tt/3CM8Use
New post on /r/flutterdev subreddit:

Flutter without login
Hey hey,I was curious. I have been tossing this idea in my head about creating an app without a traditional sign in process (username,password).The idea that I have is similar to jackbox games, where everyone essentially just uses a room code and give a one time username that they use for that session.The caviat is, the host of the session needs to create like a set of questions/activities that can be stored in a db (for example firebase), So that if the host opens the app again they will be able to reuse that set of questions/activities that they created.Ideally this would come with a public/private flag when creating them, that results in the following:if public, anyone that has the app can find your quiz/activities and use itif private, only you as the host can find the quiz/activities and use it.Is there anyone here, that can offer some advice on how to do this?

November 04, 2021 at 01:17PM by the_duckmouse
https://ift.tt/3BLdvJC
New tweet from FlutterDev:

🦋 Chapter 4: Pop Quiz! Flutter UIs follow which paradigm? #flutterapprentice— Flutter (@FlutterDev) Nov 4, 2021

November 04, 2021 at 06:02PM
https://twitter.com/FlutterDev/status/1456305876277469202
New post on /r/flutterdev subreddit:

Implementing subscriptions. in_app_purchase plugin or RevenueCat?
I have an existing website with a database of paying subscribers. I have a Flutter app that I need to integrate the same features with. Which one is generally easier to implement?

November 04, 2021 at 07:49PM by len_ryuka
https://ift.tt/3mKM3HN
New post on /r/flutterdev subreddit:

Plugin to calculate a file checksum as MD5 hash, using a platform native implementation
Hey everyone 👋I've created a new Flutter plugin to calculate a file checksum as MD5 hash, using a platform native implementation ==> https://pub.dev/packages/md5_file_checksumIt's very fast, it has a score of 120, test coverage, and I'm using it in production in one of my apps.It's a small package, but I hope someone will find it useful!

November 04, 2021 at 09:49PM by albemala
https://ift.tt/2Yi9xut
New post on /r/flutterdev subreddit:

ListTile ThemeData Update, Date when its in Stable!
I thought would share something I found.​ListTile ThemeData will drop into stable on Dec 21st this year per:​List Tile ThemeData Issue​That means that we can set it via ThemeData, yeah!

November 04, 2021 at 11:15PM by fredgrott
https://ift.tt/3CRnj6n