-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the QR Code implementation (#36)
* chore: change qr implementation * i am the best :) (#37) * test qr embeded image implementation * fix: missing comma * fuck yes * remove redundant code * fix: solve the share and embedimage issue --------- Co-authored-by: Jatin <main.jatink@gmail.com> Co-authored-by: ShivamBansal07 <sb2368@srmist.edu.in>
- Loading branch information
1 parent
ead8050
commit 18c3880
Showing
5 changed files
with
66 additions
and
33 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import 'dart:async'; | ||
import 'dart:ui' as ui; | ||
import 'dart:typed_data'; | ||
import 'package:flutter/material.dart'; | ||
|
||
Future<ui.Image> loadImage(BuildContext context, String assetPath) async { | ||
final ByteData data = await DefaultAssetBundle.of(context).load(assetPath); | ||
final Completer<ui.Image> completer = Completer(); | ||
ui.decodeImageFromList(data.buffer.asUint8List(), (ui.Image img) { | ||
return completer.complete(img); | ||
}); | ||
return completer.future; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters