We can easily format any numbers which are coming from API… This is an easiest way to do it.

First you need flutter dependency which is call intl 0.17.0 and you can get it from here : (https://pub.dev/packages/intl). So after you need to adding this to your project as a dependency.

Now its time to code.

As for my experience, This is the way I used to format.

1. you need to import inil.dart

import 'package:intl/intl.dart';

2. Now create local variable for assign value Which is come from API.

var valueConvert; // this is null variable....

2.1 Also you need to create final variable for…


When You develop mobile App, you should use buttons like toggle button or toggle switch for design above mentioned button designs. So I recommended to use SwitchListTile for overcome this coding challenge. we have so many advantage by using SwitchListTile.

when user tap above List tile anywhere toggle switch on/off working without doubt. this is best advantage that we can give end user to use our app easily by one tap.

Coding Example :

bool _toggled = false; // variable assigned top of the our classContainer(
color: Colors.white,
child: Column(
children: [ SwitchListTile(
secondary: Icon(
Icons.lock,
),
title: const Text("Sign Out"),
activeColor: Colors.deepOrange,
value: _toggled, //this is local variable I assigned.
onChanged: (bool value){
setState(() => _toggled = value);
},
),
],
),

Mohamed Shaheem

Mobile App Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store