text:
I have a problem with my Flutter application and it says "Failed assertion: line 25 pos 14: 'url != null': is not true."

code sample
import 'package:flutter/material.dart';
import 'package:api_top_beers/Beer.dart';
import 'package:api_top_beers/Beer_repository.dart';
import 'package:api_top_beers/Beer_tile.dart';

/*main function responsible for running our app
and instantiating a BeerListApp object where a material app will be build upon*/
void main() => runApp(BeerListApp());

class BeerListApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) => MaterialApp(

    title: "Beer List App",
    debugShowCheckedModeBanner: false,
    theme: ThemeData(
      primaryColor: Colors.black,
      accentColor: Colors.black,
    ),

    home: HomePage(),
  );
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {

  //Creating an array list to save beers inside it
  List<Beer> _beers = <Beer>[];

  @override
  void initState() {
    super.initState();
    listenForBeers();
  }

  ListView.builder : describes the body of our widget.
  itemCount represents the number of items to be shown on screen.
  itemBuilder key holds a function that returns a Widget for each beer
  */
  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: AppBar(
      centerTitle: true,
      title: Text('Top Beers'),
    ),
    body: ListView.builder(
      itemCount: _beers.length,
      itemBuilder: (context, index) => BeerTile(_beers[index]),

    ),
  );

  void listenForBeers() async {
    final Stream<Beer> stream = await getBeers();
    stream.listen((Beer beer) =>
        setState(() => _beers.add(beer))
    );
  }
}

import 'package:http/http.dart' as http;
import 'dart:convert';
import 'package:api_top_beers/Beer.dart';

/*This step involves creating a repository to parse the JSON data received from the API and transform it into an instances of the Beer model.
*/

Future<Stream<Beer>> getBeers() async {
  final String url = 'https://api.punkapi.com/v2/beers';

  //The instruction below sends a  HTTP request and awaits a response from the /beers APi endpoint
  final client = new http.Client();
  final streamedRest = await client.send(
      http.Request('get', Uri.parse(url))
  );

  /*After obtaining a response, we apply a few methods to the resulting stream to make it ready for consumption
  */
  return streamedRest.stream
      .transform(utf8.decoder)
      .transform(json.decoder)
      .expand((data) => (data as List))
      .map((data) => Beer.fromJSON(data));
}

import 'package:flutter/material.dart';
import 'package:api_top_beers/Beer.dart';
/*List tiles are typically used in ListViews, or arranged in Columns in Drawers and Cards.
*/
class BeerTile extends StatelessWidget {
  final Beer _beer;
  BeerTile(this._beer);

  @override
  Widget build(BuildContext context) => Column(
    children: <Widget>[
      ListTile(
        title: Text(_beer.name),
        subtitle: Text(_beer.tagline),
        leading: Container(
            margin: EdgeInsets.only(left: 6.0),
            child: Image.network(_beer.imageUrl, height: 50.0, fit: BoxFit.fill,)
        ),
      ),
      Divider()
    ],
  );
}

/*My Model
*/
class Beer{
  final int id;
  final String name;
  final String tagline;
  final String description;
  final String imageUrl;

  Beer(
      this.id,
      this.name,
      this.tagline,
      this.description,
      this.imageUrl);

  Beer.fromJSON(Map<String, dynamic> jsonMap) :
        id = jsonMap['id'],
        name = jsonMap['name'],
        tagline = jsonMap['tagline'],
        description = jsonMap['description'],
        imageUrl = jsonMap['imageUrl'];

}

---------------------------------------The error I get is below after running the app---------------------------------------

Launching lib\main.dart on DRA LX2 in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
Debug service listening on ws://127.0.0.1:51919/UBZhjP32-HU=/ws
Syncing files to device DRA LX2...

======== Exception caught by widgets library =======================================================
The following assertion was thrown building BeerTile(dirty):
'package:flutter/src/painting/_network_image_io.dart': Failed assertion: line 25 pos 14: 'url != null': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was:
  BeerTile file:///C:/Users/Mtlho/IdeaProjects/api_top_beers/lib/main.dart:80:40
When the exception was thrown, this was the stack:
#2      new NetworkImage (package:flutter/src/painting/_network_image_io.dart:25:14)
#3      new Image.network (package:flutter/src/widgets/image.dart:406:68)
#4      BeerTile.build (package:api_top_beers/Beer_tile.dart:27:26)
#5      StatelessElement.build (package:flutter/src/widgets/framework.dart:4569:28)
#6      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4495:15)
...
====================================================================================================

Hi @Tlhoni
The error is caused by your code, you should use StreamBuilder or FutureBuilder and check if the data is is null or empty before using it in your image widget
Please see https://flutter.dev/community for resources and asking questions like this,
you may also get some help if you post it on Stack Overflow and if you need help with your code, please see https://www.reddit.com/r/flutterhelp/
Closing, as this isn't an issue with Flutter itself. If you disagree, please write in the comments and I will reopen it.
Thank you

authors: TahaTesser Tlhoni


text:
Run tests on emulator that use API level 30, and 31 (when it's out)

We currently only test against API level 28 because it was the only option the Chrome infra team had at the time.
31 is required for #83949

31 is required for https://github.com/flutter/flutter/issues/83949

Chrome infra has support for API levels 23, 27-30, so they can used in LUCI.

The embedding is already tested on 30. https://github.com/flutter/engine/blob/4cb4710b98c246739bf36fe9067bde0a5f7e18ed/testing/run_tests.py#L398
Chrome infra has support for emulators running API levels 23, 27-30, so they can used in LUCI recipes.

/cc @GaryQian

https://bugs.chromium.org/p/chromium/issues/detail?id=1112429 Tracks updating CIPD packages to support API 30 (and eventually 31)

https://chromium-review.googlesource.com/c/chromium/src/+/2987631 Provides automated updating of the CIPD package

@ricardoamador This should just require a update to the recipes to use a newer package.

@GaryQian I did a check and the module for the virtual device takes either the passed in version or defaults to level 31 and the current dependencies are as follows in the recipe:
dependencies: >-
[
{"dependency": "android_sdk", "version": "version:32v1"},
{"dependency": "android_virtual_device", "version": "31"}
]
Is there a different place that needs to be updated?

Awesome, if this is the case, then this issue seems to be resolved! Thanks!

source: gharchive/issue

authors: GaryQian blasten ricardoamador

repo: flutter/flutter

license_type: permissive

license_source: github-api


text:
[in_app_purchase] Cannot get non-renewable subscription on iOS

There is no documentation for non renewable subscription ios .. i can't able to load non renewable subscription which i have defined in the app connect

Hi @Samioffical
There is no need for a dedicated way to load non-renewable subscriptions
Please your sub id in the official example and try again

Hello sir :
Still the same issue  i have changed the id but no luck
On Mon, 30 Aug 2021 at 17:10, Taha Tesser @.***> wrote:

Hi @Samioffical https://github.com/Samioffical
There is no need for a dedicated way to load non-renewable subscriptions
Please your sub id in the official example
https://pub.dev/packages/in_app_purchase/example and try again
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/flutter/flutter/issues/89156#issuecomment-908289024,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASWJ5V5L6ZMZW3C2SQVUXCLT7NYJ7ANCNFSM5DBOHEIQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Hi @Samioffical
I just tried non-renewable sub too, sure enough, I can't get it too (even after waiting a couple of hours)

Preview

flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 12.0 21A5304g darwin-x64, locale en-US)
    • Flutter version 2.2.3 at /Users/tahatesser/Code/flutter_stable
    • Framework revision f4abaa0735 (9 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/tahatesser/Code/android-sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_SDK_ROOT = /Users/tahatesser/Code/android-sdk
    • Java binary at: /Users/tahatesser/Code/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode-beta.app/Contents/Developer
    • Xcode 13.0, Build version 13A5212g
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (version 2020.3)
    • Android Studio at /Users/tahatesser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7621141/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] VS Code (version 1.59.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.25.0

[✓] Connected device (4 available)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E            • ios            • iOS 15.0
    • iPhone 12 (mobile)     • 77819686-4E78-4DC9-96A8-6D0E8587E397 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64     • macOS 12.0 21A5304g darwin-x64
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 92.0.4515.159

! Doctor found issues in 1 category.

Thanks for filing the issue

Your welcome .
Have you any suggestions that how I handle this scenario . We can't use
other payment method because apple will reject the app. Really stressed
😫😫 that what to do.. and how to handle this issue.
On Tue, Aug 31, 2021, 3:05 PM Taha Tesser @.***> wrote:

Hi @Samioffical https://github.com/Samioffical
I just tried non-renewable sub too, sure enough, I can't get it too (even
after waiting a couple of hours)
Preview
https://user-images.githubusercontent.com/48603081/131483644-0dea7e8e-ed11-443c-b0b1-63ad17f11335.jpeg flutter
doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 12.0 21A5304g darwin-x64, locale en-US)
• Flutter version 2.2.3 at /Users/tahatesser/Code/flutter_stable
• Framework revision f4abaa0735 (9 weeks ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/tahatesser/Code/android-sdk
• Platform android-31, build-tools 31.0.0
• ANDROID_SDK_ROOT = /Users/tahatesser/Code/android-sdk
• Java binary at: /Users/tahatesser/Code/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode-beta.app/Contents/Developer
• Xcode 13.0, Build version 13A5212g
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (version 2020.3)
• Android Studio at /Users/tahatesser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7621141/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[✓] VS Code (version 1.59.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.25.0
[✓] Connected device (4 available)
• Taha’s iPhone (mobile) • 00008020-001059882212002E            • ios            • iOS 15.0
• iPhone 12 (mobile)     • 77819686-4E78-4DC9-96A8-6D0E8587E397 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
• macOS (desktop)        • macos                                • darwin-x64     • macOS 12.0 21A5304g darwin-x64
• Chrome (web)           • chrome                               • web-javascript • Google Chrome 92.0.4515.159
! Doctor found issues in 1 category.
Thanks for filing the issue
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/flutter/flutter/issues/89156#issuecomment-909090678,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASWJ5V7VZ2XB443NOUES5TTT7SSNNANCNFSM5DBOHEIQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

@Samioffical
Do you mind trying again? I just tried loading the product again, it loads fine now (probably App Store needed time to distribute the newly added product)

As you can see there is no subscription duration since it is a non-renewable subscription

Wao sir can you send me the source code please
On Wed, Sep 1, 2021, 6:29 PM Taha Tesser @.***> wrote:

@Samioffical https://github.com/Samioffical
Do you mind trying again? I just tried loading the product again, it loads
fine now (probably App Store needed time to distribute the newly added
product)
[image: Screenshot 2021-09-01 at 16 25 20]
https://user-images.githubusercontent.com/48603081/131679548-a27492d7-4f18-43fd-ad3e-e2f843c4ab86.png
As you can see there is no subscription duration since it is a
non-renewable subscription
[image: image]
https://user-images.githubusercontent.com/48603081/131679905-63850c88-c184-42a7-bc28-94880a03e28f.png
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/flutter/flutter/issues/89156#issuecomment-910287057,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASWJ5V2IUJEDLZDRLSWLZI3T7YTDJANCNFSM5DBOHEIQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

@Samioffical
native_iap_sample.zip

authors: Samioffical TahaTesser