Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 19 21:53
    Coveralls flutter/flutter (master) -81.05%
  • Jul 26 16:52
    Coveralls flutter/flutter (HEAD) -2.5%
  • Jul 03 06:58
    Coveralls flutter/flutter (docs_crosslink) -70%
  • Apr 15 16:23
    Coveralls flutter/flutter (HEAD) -1.6%
  • Mar 09 04:01
    Coveralls flutter/flutter (HEAD) 1.3%
  • Mar 08 03:51
    Coveralls flutter/flutter (HEAD) 1.05%
  • Mar 07 23:43
    Coveralls flutter/flutter (HEAD) -1.04%
  • Jan 31 22:57
    crystallinering starred flutter/flutter
  • Jan 31 22:45
    skjagini edited #27372
  • Jan 31 22:44
    skjagini edited #27372
  • Jan 31 22:44
    skjagini edited #27372
  • Jan 31 22:44
    skjagini opened #27372
  • Jan 31 22:34
    pedromassango commented #17099
  • Jan 31 22:34
    pedromassango commented #17099
  • Jan 31 22:28

    Hixie on master

    [H] Add ImageStreamCompleter.ha… (compare)

  • Jan 31 22:28
    Hixie closed #25865
  • Jan 31 22:27
    Hixie commented #25865
  • Jan 31 22:21
    mkustermann commented #27250
  • Jan 31 22:21
    mkustermann commented #27250
  • Jan 31 22:16
    eseidelGoogle labeled #23838
Lawrence Pickford
@Contract16
That's all
Like MVC, MVVM, MVP etc
ChaitanyaHarde
@Chaitanyaha
So not related right?
Lawrence Pickford
@Contract16
No
Not related
Prince Nna
@Prn-Ice

I am building an app in with flutter and on one of my screens I have a page built with a column. I would like to change the column to a ListView at any point the RenderFlex overflows, is there any way to listen for RenderFlex overflows or any other method for fixing this problem.

I have been able to achieve something similar with the device orientation like with this code:

class MightScrollBaseScaffold extends StatefulWidget {
  const MightScrollBaseScaffold({
    Key key,
    this.appBar,
    this.children,
    this.selectedIndex,
    this.hasBottomNavBar,
  }) : super(key: key);
  final AppBar appBar;
  final List<Widget> children;
  final int selectedIndex;
  final bool hasBottomNavBar;

  @override
  _MightScrollBaseScaffoldState createState() =>
      _MightScrollBaseScaffoldState();
}

class _MightScrollBaseScaffoldState extends State<MightScrollBaseScaffold> {
  @override
  Widget build(BuildContext context) {
    final Orientation orientation = MediaQuery.of(context).orientation;

    final Widget body = SafeArea(
      child: orientation == Orientation.portrait
          ? Column(
              children: widget.children,
            )
          : ListView(
              children: widget.children,
            ),
    );

    return LayoutBuilder(
        builder: (BuildContext context, BoxConstraints constraints) {
      print(constraints);
      print(kDeviceDimensions(context));
      return widget.hasBottomNavBar
          ? BaseScaffold(
              selectedIndex: widget.selectedIndex,
              appBar: widget.appBar,
              body: body,
            )
          : Scaffold(
              extendBody: true,
              appBar: widget.appBar,
              body: body,
            );
    });
  }
}

I would like something like that with the RenderFlex issue.

Jimmy Forrester-Fellowes
@jimmyff
This is my apps main.dart: https://gist.github.com/jimmyff/eb68aeb0406c40ff3ecf0742f24e15fd -Could anyone help me with couple of questions? 1) It feels messy having two MaterialApp classes - is this bad practice? This is the only way I've found that I can have app-wide snackbars (using redux) and also have a global bottom tab bar navigation for my app. 2) I'm not sure how to trigger the rebuild of the the MaterialApp - the bottom bar is only there when authState == AuthState.authenticated -however this only takes effect when I do a hot reload, anybody know how I can refresh the MaterialApp tree when the store updates? -I think I need a store connector but I only have the store provider as this is the root of my app
Rob Halff
@rhalff
How to allow overflow for a widget? I'm using a SliverHeader and it's ok if the container shrinks smaller than it's content.
I tried OverflowBox but that doesn't help much.
Prince Nna
@Prn-Ice
@rhalff Is this widget in a row or column if so try wrapping it with Flexible, if not then try FittedBox.
Rob Halff
@rhalff
@Prn-Ice yeah it's in a column just a title and a subtitle, I want to keep the content fixed. I'll try FittedBox, thanks.
Prince Nna
@Prn-Ice
@rhalff I take it you've tried Flexible
Rob Halff
@rhalff
Flexible does solve the overflow, but moves the lower subtitle over the title.
FittedBox seems to do what I\ve intended.
Prince Nna
@Prn-Ice
Ok thats great
Rob Halff
@rhalff
yep :)
Or actually the default is to scale it down, which I didn't intent, but looks nice anyway.
I'll just pretend it took me hours to achieve that effect.
Prince Nna
@Prn-Ice
I usually use Flexible but I think I'll start giving fittedbox a try
Rob Halff
@rhalff
BoxFit.fitWidth gives what I was trying to accomplish.
ahhhfiq
@ahhhfiq
class Progress {
  String userID;
  double progressPercentage;
  List<String> progressTypes;
  List<double> individualProgress;
  List<Color> colors;

  Progress({
    this.userID,
    this.progressPercentage,
    this.progressTypes,
    this.individualProgress,
    this.colors,
  });

  getProgress(String uid) async {
    User user = new User();

    await user.getUser(uid).then((results) {
      return [results[6], results[7]];
    }).catchError((err) => print(err));
  }
}
@override
  void initState() {
    getCurrentUser();
    super.initState();
  }

  getCurrentUser() async {
    Progress progress = new Progress();
    await FirebaseAuth.instance.currentUser().then((currentUser) async {
      _userUID = currentUser.uid;
    });
    await progress.getProgress(_userUID).then((results) {
      print(results);
    }).catchError(
      (err) => print(err),
    );
  }
Why does getProgress return null in my widget??
await progress.getProgress(_userUID).then((results) {
      print(results);
    }).catchError(
      (err) => print(err),
    );
results seem to always be null
But if i print the results in getProgress, it will return the intended value
shenaz
@shenaz38839511_twitter
@ahhhfiq because you are mixing async code in init state and not handling the async code properly in ur widget ... maybe ur widget is being built before it gets the values from getProgress....
Tõnis Ostrat
@tonisostrat
or maybe it's because getProgress() doesn't return anything
i'd go with the latter.
shenaz
@shenaz38839511_twitter
I think that is just debug code to show he is getting the results from getProgress, hence his comment about 'if i print' . if you look further up the - getProgress() returns [results[6], results[7]]
Tõnis Ostrat
@tonisostrat
but he doesn't return the promise itself, only awaits it.
agreensh
@agreensh

@ahhhfiq Shouldn't it just be:

  getProgress(String uid) async {    // should put the return type!!
    User user = new User();
    var results = await user.getUser(uid);
    return [results[6], results[7]];
  }

and

    _userUID = await FirebaseAuth.instance.currentUser();
    var results = await progress.getProgress(_userUID);
therealjohnsummer
@therealjohnsummer
@tonisostrat Awaits the future and returns result here :
getProgress(String uid) async {
    User user = new User();

    await user.getUser(uid).then((results) {
      return [results[6], results[7]];
    }).catchError((err) => print(err));
  }
alevinetx
@alevinetx
I'm hitting the "equality...invocation with references of unrelated types" problem, where 1 type shows as "package:me/.../myclass.dart", and the other shows as "MyClass". Every import is using the full "package:me/..." format (absolute), and never relative. My class hierarchy extends Equatable, so "==" should work (right?). This is coming from using flutter_bloc, which I've used in other spots, but not having this issue.
Any suggestions on how to further track this down ?
I'm not even using a fake package (exports ....dart) to access my classes.
I'm sure it's coming from using BlocListener<Bloc, State>, as that's where I'm testing for equality and where it's not matching like it should.
Tõnis Ostrat
@tonisostrat

@therealjohnsummer

getProgress(String uid) async {
  User user = new User();

  await user.getUser(uid).then((results) {
    return [results[6], results[7]];
  }).catchError((err) => print(err));
}

OR

getProgress(String uid) async {
  User user = new User();

  return user.getUser(uid).then((results) {
    return [results[6], results[7]];
  }).catchError((err) => print(err));
}

which one is right?

huzeyfe coşkun
@huzeyfecoskun
Hi folks i am having issue with video player
are there anybody have an experience with video on flutter
Tõnis Ostrat
@tonisostrat
@therealjohnsummer, the first one just returns the specific array members as a new array to the context of that method, the second one also bounces them outside of it.
therealjohnsummer
@therealjohnsummer
@tonisostrat yes but what your missing is that on the first fragment, he will have assigned the await to a local variable which he will return out of the getProgress() - this will then allow him to see the value of the User which is why he says he can see the value when he prints it
Tõnis Ostrat
@tonisostrat

@therealjohnsummer , he's not returning anything out of getProgress(), that's the problem.

go to https://dartpad.dartlang.org/
and run the following code:

likeTheOriginal(String uid) async {
  await Future.value('$uid : processed').then((results) {
    return results;
  }).catchError((err) => print(err));
}

withReturnAdded(String uid) async {
  return Future.value('$uid : processed').then((results) {
    return results;
  }).catchError((err) => print(err));
}

main() async {
  var r1 = await likeTheOriginal('1');
  var r2 = await withReturnAdded('2');

  print(r1);
  print(r2);
}
therealjohnsummer
@therealjohnsummer
@tonisostrat I said He will have assigned the await to a local variable. He has pasted fragments of code and not complete code so I am assuming he is not that dumb to await on something without returning the value ...
Tõnis Ostrat
@tonisostrat
look at the goddamn method, there's no assignment outside of it, for the love of god.
it's a complete copy-paste of the method and there's no return, jesus fucking christ
once more for posterity's sake
getProgress(String uid) async {
  User user = new User();

  await user.getUser(uid).then((results) {
    return [results[6], results[7]];
  }).catchError((err) => print(err));
}
Pablo Murillo
@pabloamg_gitlab
@huzeyfecoskun Hi , what kind of issue are you having?
therealjohnsummer
@therealjohnsummer
@tonisostrat Are you really swearing here ? Wow - you are really embarrassing yourself do you realise this. I think if you can't venture into a debate without resorting to immature childish remarks then maybe take your views somewhere else - you are obviously missing the big picture!
Tõnis Ostrat
@tonisostrat
there's no big picture to miss when the method doesn't return any data. learn to read code and then come back and focus on me swearing.
Pablo Murillo
@pabloamg_gitlab

@therealjohnsummer @tonisostrat is right if you await something but you still register a callback for then you wont really get a value outside of the promise ...
it should be either

return user.getUser(uid).then((results) {
    return [results[6], results[7]];
  }).catchError((err) => print(err));

or

var user=await user.getUser(uid);
return user;

The whole code is plan bad and it should be more like this

Future<int> getCurrentUser() {
    return FirebaseAuth.instance.currentUser().then((currentUser) {
      Progress progress = new Progress();
      return progress.getProgress(currentUser.uid).then((results) {
            return results; 
       });
     }).catchError(
           (err) => print(err),
        );
 }

and that should be use as the future in a Future Builder...

If you have more than two promises maybe i would consider awaiting things inside a try,catch block to reduce the callbacks.
Randal L. Schwartz
@RandalSchwartz
yeah, “await… then” seems to be broken
Pablo Murillo
@pabloamg_gitlab
totally, Hi @RandalSchwartz ! almost a year since I stopped coming here and you are still here helping!
Randal L. Schwartz
@RandalSchwartz
Yeah, I enjoy learning things by teaching things.