<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Rafael Winter</title>
    <description>The latest articles on Forem by Rafael Winter (@rafael_winter).</description>
    <link>https://forem.com/rafael_winter</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F8545%2F1da93015-135f-468c-8518-e2f82f797d67.jpg</url>
      <title>Forem: Rafael Winter</title>
      <link>https://forem.com/rafael_winter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/rafael_winter"/>
    <language>en</language>
    <item>
      <title>Barras: A simple barcode/QR code reader package for Flutter</title>
      <dc:creator>Rafael Winter</dc:creator>
      <pubDate>Wed, 28 Oct 2020 20:17:22 +0000</pubDate>
      <link>https://forem.com/rafael_winter/barras-a-simple-barcode-qr-code-reader-package-for-flutter-2mof</link>
      <guid>https://forem.com/rafael_winter/barras-a-simple-barcode-qr-code-reader-package-for-flutter-2mof</guid>
      <description>&lt;h6&gt;
  
  
  Cover image by &lt;a href="https://pixabay.com/users/wir_sind_klein-6630807/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=3970681" rel="noopener noreferrer"&gt;Wilfried Pohnke&lt;/a&gt; from &lt;a href="https://pixabay.com/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=3970681" rel="noopener noreferrer"&gt;Pixabay&lt;/a&gt;
&lt;/h6&gt;

&lt;p&gt;There are plenty of great dart plugins that do the same thing: scan barcodes and QR codes. But what happens when you have a very specific requirement? Like: &lt;em&gt;"My app can't use Google Services!"&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Barras
&lt;/h3&gt;

&lt;p&gt;It means "bars" in Portuguese. But besides that, &lt;a href="https://github.com/deadblit/barras" rel="noopener noreferrer"&gt;Barras&lt;/a&gt; is a QR code and barcode scanning library that uses ZXing and AVCaptureSession under the hood. It is simple to use and has a customizable capture screen.&lt;/p&gt;

&lt;p&gt;You can find &lt;a href="https://pub.dev/packages/barras" rel="noopener noreferrer"&gt;Barras in pub.dev.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently it only supports Android and iOS, and there are some known issues. But I'm planning to fix them, and add Flutter web support on it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why another package?
&lt;/h3&gt;

&lt;p&gt;I tested some barcode scanning packages that do not rely on Google Services (or ML Kit Vision API), and while they seem to work, there were some limitations, like requiring your app to support only Android 7 or newer. Other projects looked like they were abandoned.&lt;/p&gt;

&lt;p&gt;A project that I'm working on required urgently to have a substitute solution that could run on Android 5 and newer. So only one of the plugins that I found could be used, but it required me to create the barcode capturing screen.&lt;/p&gt;

&lt;p&gt;What if I create a customizable capturing screen for that plugin and let other people use it? At this point it is not the most refined solution out there: &lt;a href="https://github.com/deadblit/barras" rel="noopener noreferrer"&gt;Barras&lt;/a&gt; is a package that introduces other transient dependencies on your project, but the big plan is to do everything inside Barras and implement the web support.&lt;/p&gt;

&lt;p&gt;It is important to say that I see this as a great opportunity to contribute with open source. I've always used OSS operating systems, toolchains, libraries, but I feel that I never retributed properly. I believe that this package will be useful for people living in places that have restrictions on some Google products.&lt;/p&gt;

&lt;h3&gt;
  
  
  How it looks like
&lt;/h3&gt;

&lt;p&gt;It is simple as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Open the barcode reading page. Returned data will be null if&lt;/span&gt;
&lt;span class="c1"&gt;// Cancel button is pressed, or if user navigates back&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;Barras&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;scan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fdeadblit%2Fbarras%2Fraw%2Fmain%2Fexample%2Fscreenshots%2FScreenshot_20201022-034615.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fdeadblit%2Fbarras%2Fraw%2Fmain%2Fexample%2Fscreenshots%2FScreenshot_20201022-034615.jpg" alt="Default barcode capture page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also customize a bit the capturing screen, matching the app look and feel:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Open the barcode reading page. Customize the appearance, changing the&lt;/span&gt;
&lt;span class="c1"&gt;// viewfinder color, size and blinking speed. Returned data will be null&lt;/span&gt;
&lt;span class="c1"&gt;// if Cancel button is pressed, or if user navigates back&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;codigo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;Barras&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;scan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;viewfinderHeight:&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;viewfinderWidth:&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;scrimColor:&lt;/span&gt; &lt;span class="n"&gt;Color&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fromRGBO&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;128&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nl"&gt;borderColor:&lt;/span&gt; &lt;span class="n"&gt;Colors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;lightGreen&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;borderRadius:&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;borderStrokeWidth:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;buttonColor:&lt;/span&gt; &lt;span class="n"&gt;Colors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;borderFlashDuration:&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;cancelButtonText:&lt;/span&gt; &lt;span class="s"&gt;"Cancelar"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;successBeep:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fdeadblit%2Fbarras%2Fraw%2Fmain%2Fexample%2Fscreenshots%2FScreenshot_20201026-181635.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fdeadblit%2Fbarras%2Fraw%2Fmain%2Fexample%2Fscreenshots%2FScreenshot_20201026-181635.jpg" alt="Página de captura customizada"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Feedback and contributions
&lt;/h3&gt;

&lt;p&gt;I'm looking for feedback on Barras. It is in use in an app that is nearly finished, and the detection is fine for the app use cases. But I believe that there is room for improvement.&lt;/p&gt;

&lt;p&gt;Any help and feedback is appreciated, please file an issue in our repo or send me a message!&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/deadblit" rel="noopener noreferrer"&gt;
        deadblit
      &lt;/a&gt; / &lt;a href="https://github.com/deadblit/barras" rel="noopener noreferrer"&gt;
        barras
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A simple and customizable barcode scanning Flutter package for Android and iOS. It uses AVCaptureSession in iOS and ZXing in Android.
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>hacktoberfest</category>
      <category>opensource</category>
      <category>contributorswanted</category>
      <category>flutter</category>
    </item>
  </channel>
</rss>
