A News App in Flutter using the newsapi.org API and using Bloc.

Overview

flutter_newsapp

A News App using API from newsapi.org and using Bloc.

Working

Screenshots


=>=>



video




Before Running

  • Replace the <API_KEY> in lib/res/strings.dart with your own API key generated from newsapi.org.





Visitor count

Issues
  • _network_image_io.dart

    _network_image_io.dart

    Hi I could not solve the error, I would be very happy if you help me.

    'package:flutter/src/painting/_network_image_io.dart': Failed assertion: line 25 pos 11: 'url != null': is not true.

    /// The dart:io implementation of [image_provider.NetworkImage]. @immutable class NetworkImage extends image_provider.ImageProvider<image_provider.NetworkImage> implements image_provider.NetworkImage { /// Creates an object that fetches the image at the given URL. /// /// The arguments [url] and [scale] must not be null. const NetworkImage(this.url, { this.scale = 1.0, this.headers }) :assert(url != null ), assert(scale != null);

    @override final String url;

    @override final double scale;

    @override final Map<String, String>? headers;

    @override Future obtainKey(image_provider.ImageConfiguration configuration) { return SynchronousFuture(this); }

    @override ImageStreamCompleter load(image_provider.NetworkImage key, image_provider.DecoderCallback decode) { // Ownership of this controller is handed off to [_loadAsync]; it is that // method's responsibility to close the controller's stream when the image // has been loaded or an error is thrown. final StreamController chunkEvents = StreamController();

    return MultiFrameImageStreamCompleter(
      codec: _loadAsync(key as NetworkImage, chunkEvents, decode),
      chunkEvents: chunkEvents.stream,
      scale: key.scale,
      debugLabel: key.url,
      informationCollector: () {
        return <DiagnosticsNode>[
          DiagnosticsProperty<image_provider.ImageProvider>('Image provider', this),
          DiagnosticsProperty<image_provider.NetworkImage>('Image key', key),
        ];
      },
    );
    

    }

    // Do not access this field directly; use [_httpClient] instead. // We set autoUncompress to false to ensure that we can trust the value of // the Content-Length HTTP header. We automatically uncompress the content // in our call to [consolidateHttpClientResponseBytes]. static final HttpClient _sharedHttpClient = HttpClient()..autoUncompress = false;

    static HttpClient get _httpClient { HttpClient client = _sharedHttpClient; assert(() { if (debugNetworkImageHttpClientProvider != null) client = debugNetworkImageHttpClientProvider!(); return true; }()); return client; }

    Future<ui.Codec> _loadAsync( NetworkImage key, StreamController chunkEvents, image_provider.DecoderCallback decode, ) async { try { assert(key == this);

      final Uri resolved = Uri.base.resolve(key.url);
    
      final HttpClientRequest request = await _httpClient.getUrl(resolved);
    
      headers?.forEach((String name, String value) {
        request.headers.add(name, value);
      });
      final HttpClientResponse response = await request.close();
      if (response.statusCode != HttpStatus.ok) {
        // The network may be only temporarily unavailable, or the file will be
        // added on the server later. Avoid having future calls to resolve
        // fail to check the network again.
        await response.drain<List<int>>();
        throw image_provider.NetworkImageLoadException(statusCode: response.statusCode, uri: resolved);
      }
    
      final Uint8List bytes = await consolidateHttpClientResponseBytes(
        response,
        onBytesReceived: (int cumulative, int? total) {
          chunkEvents.add(ImageChunkEvent(
            cumulativeBytesLoaded: cumulative,
            expectedTotalBytes: total,
          ));
        },
      );
      if (bytes.lengthInBytes == 0)
        throw Exception('NetworkImage is an empty file: $resolved');
    
      return decode(bytes);
    } catch (e) {
      // Depending on where the exception was thrown, the image cache may not
      // have had a chance to track the key in the cache at all.
      // Schedule a microtask to give the cache a chance to add the key.
      scheduleMicrotask(() {
        PaintingBinding.instance!.imageCache!.evict(key);
      });
      rethrow;
    } finally {
      chunkEvents.close();
    }
    

    }

    @override bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is NetworkImage && other.url == url && other.scale == scale; }

    @override int get hashCode => ui.hashValues(url, scale);

    @override String toString() => '${objectRuntimeType(this, 'NetworkImage')}("$url", scale: $scale)'; }

    opened by ayzek67 8
  • [ImgBot] Optimize images

    [ImgBot] Optimize images

    Beep boop. Your images are optimized!

    Your image file size has been reduced!

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /web/favicon.png | 0.90kb | 0.64kb | 29.01% | | /Screenshots/spinkit.jpeg | 18.40kb | 16.39kb | 10.93% | | /Screenshots/Demo.gif | 7,783.40kb | 7,517.54kb | 3.42% | | /Screenshots/article2.jpeg | 54.90kb | 53.04kb | 3.38% | | /Screenshots/article1.jpeg | 65.47kb | 64.28kb | 1.82% | | /Screenshots/feed.jpeg | 109.63kb | 108.59kb | 0.95% | | | | | | | Total : | 8,032.69kb | 7,760.48kb | 3.39% |


    Black Lives Matter | 💰 donate | 🎓 learn | ✍🏾 sign

    📝 docs | :octocat: repo | 🙋🏾 issues | 🏅 swag | 🏪 marketplace

    opened by imgbot[bot] 0
Owner
Arunoday kumar
sophomore at @iiitv || Jack of all trades, Master of none ||
Arunoday kumar
Bhagavad Gita app using flutter & Bhagavad-Gita-API is A lightweight Node.js based Bhagavad Gita API [An open source rest api on indian Vedic Scripture Shrimad Bhagavad Gita].

Gita Bhagavad Gita flutter app. Download App - Playstore Web Application About Bhagavad Gita app using flutter & Bhagavad-Gita-API is A lightweight No

Ravi Kovind 7 Sep 29, 2021
Push Notification service for anime episodes and news. The episode updates will be based on actual upload on the internet and NOT Japan tv schedule as other apps do.

Quantz Push Notification service for anime episodes and news. Features Sub and dub - get notified with latest anime episodes on the internet. Ongoing

null 12 Nov 13, 2021
A starter kit for beginner learns with Bloc pattern, RxDart, sqflite, Fluro and Dio to architect a flutter project. This starter kit build an App Store app as a example

Flutter Starter Kit - App Store Example A starter kit for beginner learns with Bloc pattern, RxDart, sqflite, Fluro and Dio to architect a flutter pro

kw101 596 Nov 28, 2021
An open source flutter ride-hailing app for learning purpose(Provider & Bloc)

citycab An open source ride hailing app with flutter. Getting Started This project is a starting point for a Flutter application. A few resources to g

Paul Edeme'kong - Flutter Fairy 21 Nov 23, 2021
A flutter boilerplate project containing bloc, pedantic, hive, easy_translations and more!

Flutter Production Boilerplate A flutter project containing bloc, flutter_lints, hive, easy_translations and more! This repository is the starting poi

Andreas Feichtinger 69 Nov 21, 2021
A Flutter application with proper navigation and routes handling and API data fetching and posting.

Flutter-Navigation-and-API-Integration A Flutter application with proper navigation and routes handling and API data fetching and posting. ⏮ Preview G

Ehmad Saeed⚡ 7 Sep 18, 2021
Flutter Cryptocurrency App with Riverpod & Freezed + Dio for API REST

Flutter Crypto APP Complete Flutter Application with Riverpod & Freezed + Dio for API REST. Features API REST (CryptoWatch) Linear Graph View (Hour, D

Salvador Valverde 164 Nov 23, 2021
Easy form building in Flutter with a fluent schema API.

former - Easy form building in Flutter Motivation Formik is one of my favorite React libraries. It is a form library that drastically reduces boilerpl

Kenneth 17 Sep 23, 2021
This repository is Online_Learning Screen UI - Flutter. I am fetching the data from the local JSON API.

online_learning A new Flutter Online_Learning application. Designed by Arun PP, Code with Flutter by Kishor Kc. Kishor Kc I am fetching the data from

Kishor Kc 12 Aug 30, 2021
Authentication API client with Flutter (Login, Register, Google Login, Facebook Login, Apple Login)

Flutter Auth App (Login, Register, Google Login, Facebook Login, Apple Login) To use this client, get the server up and running. Try it out now! App S

Denzel Giraldo 15 Nov 29, 2021
Find The Latest trending and upcoming movies and tv shows with MovieDB app. The app contains all info about movies and tv shows. find similar movies or shows, Browse all genres, video trailers, backdrops, logos, and posters.

MovieDB App Features. Dynamic Theming Search Functionality Onboarding-Screen Select favourite movie Home Screen Tranding movie Movies different catego

Ansh rathod 15 Nov 22, 2021
It's a universal app template to have a great animated splash screen and liquid slider. Just change the animation if you want (rive) and change the images or colours according to your app.

liquid A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this i

Zikyan Rasheed 26 Oct 28, 2021
An app to pick, upload and display images from camera and gallery with size and extension constraints.

image_uploader A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

Ehmad Saeed⚡ 3 May 24, 2021
Codeflow 17 Oct 16, 2021
A todo app using firebase and flutter as part of youtube series

Welcome to flutter-with-firebase ?? This project made for those whowanted to learn about the firebase and thier Auth, Cloud Storage and Cloud function

Balram Rathore 35 Nov 23, 2021
Today we will show you how you can create your developer portfolio website and app using flutter.

Responsive and Animated Portfolio Website & App - Flutter UI Live Preview Watch it on YouTube Packages we are using: flutter_svg: link goole_fonts: li

Abu Anwar 138 Nov 25, 2021
Flutter plugin for selecting images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotation, cropping, adding sticker/text/filters.

advance_image_picker Flutter plugin for selecting multiple images from the Android and iOS image library, taking new pictures with the camera, and edi

Weta Vietnam 64 Nov 24, 2021