• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

icapps / flutter-template / 12908916411

22 Jan 2025 01:09PM UTC coverage: 59.889% (-3.5%) from 63.402%
12908916411

push

github

web-flow
Merge pull request #351 from icapps/feature/#336-base-screen

Feature/#336 base screen

412 of 612 new or added lines in 62 files covered. (67.32%)

12 existing lines in 7 files now uncovered.

1184 of 1977 relevant lines covered (59.89%)

2.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/util/api/dummy_api_util.dart
1
import 'dart:convert';
2

3
import 'package:flutter/services.dart';
4
import 'package:flutter_template/util/env/flavor_config.dart';
5
import 'package:flutter_template/util/logging/flutter_template_logger.dart';
6

7
class DummyApiUtil {
8
  static const _apiAssetPath = 'assets/api';
9

10
  static Future<T> getResponse<T>(String url) async {
×
11
    if (!FlavorConfig.isDummy()) {
×
12
      throw ArgumentError('Failed to get dummy response while configuration is not dummy');
×
13
    }
14
    final path = '$_apiAssetPath/$url.json';
×
15
    try {
NEW
16
      FlutterTemplateLogger.logDebug('---------------> GET - url: file://$path');
×
17

18
      final jsonString = await rootBundle.loadString(path);
×
NEW
19
      FlutterTemplateLogger.logDebug('<--------------- GET - url: file://$path - statucode: 200');
×
20
      return json.decode(jsonString) as T;
×
21
    } catch (e, stack) {
NEW
22
      FlutterTemplateLogger.logError(
×
23
        '<--------------- GET - url: $path - statucode: 404',
×
24
        error: e,
25
        stackTrace: stack,
26
      );
27
      rethrow;
28
    }
29
  }
30
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc