Base64 to Circle ImageView In Flutter

Base64 to Circle ImageView In Flutter : In this flutter tutorial , I will show just a basic screen with a circle image. this flutter tutorial is easy to understand and implement. the output is given below.

Circle imageview looking cool in flutter.

Screenshot :

Base64 to Circle ImageView In Flutter

Base64 to Circle ImageView In Flutter Program :

import 'dart:convert';
import 'dart:typed_data';

import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';

class DashboardPage extends StatefulWidget {
  @override
  DashboardState createState() {
    return new DashboardState();
  }
}

class DashboardState extends State<DashboardPage> {
  final _scaffoldState = GlobalKey<ScaffoldState>();

  SharedPreferences preferences;
  @override
  Widget build(BuildContext context) {
    Uint8List profile = base64.decode(preferences.getString('profile'));
    return Scaffold(
        body: Container(padding: EdgeInsets.all(100), child: new CircleAvatar(
            radius: 40, child: ClipOval(child: new Image.memory(profile)))));
  }

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

  getImage() async {
    preferences = await SharedPreferences.getInstance();
  }
}

The flutter tutorial  is a website that bring you the latest and amazing resources of code. All the languages codes are included in this website. The languages like flutter, android, java,kotlin etc.with the help of this languages any user can develop the beautiful application

For more information about Flutter. visit www.fluttertutorial.in