Skip to content

Instantly share code, notes, and snippets.

View raviyadav5951's full-sized avatar
🏠
Working from home

Ravi Yadav raviyadav5951

🏠
Working from home
View GitHub Profile
@raviyadav5951
raviyadav5951 / expanded.dart
Created January 31, 2021 13:19
Expanded.dart
Column(
children: <Widget>[
Container(
color: Colors.blue,
height: 100,
width: 100,
),
Expanded(
child: Container(
color: Colors.amber,
@raviyadav5951
raviyadav5951 / stack.dart
Created January 31, 2021 13:19
stack.dart
Stack(
children: <Widget>[
Container(
width: 100,
height: 100,
color: Colors.red,
),
Container(
width: 90,
height: 90,
@raviyadav5951
raviyadav5951 / container.dart
Created January 31, 2021 13:18
container.dart
Container(
constraints: BoxConstraints.expand(
height: Theme.of(context).textTheme.headline4.fontSize * 1.1 + 200.0,
),
padding: const EdgeInsets.all(8.0),
color: Colors.blue[600],
alignment: Alignment.center,
child: Text('Hello World',
style: Theme.of(context)
.textTheme
@raviyadav5951
raviyadav5951 / Column.dart
Created January 31, 2021 13:18
Column dart
Column(
children: <Widget>[
Text('Flutter Child One'),
Text('Flutter Child Two'),
Expanded(
child: FittedBox(
fit: BoxFit.contain, // this is simple image
child: const FlutterLogo(),
),
),
@raviyadav5951
raviyadav5951 / row.dart
Created January 31, 2021 13:17
Row dart
Row(
children: <Widget>[
Expanded(
child: Text('Flutter Child One', textAlign: TextAlign.center),
),
Expanded(
child: Text('Flutter Child Two', textAlign: TextAlign.center),
),
Expanded(
child: FittedBox(
@raviyadav5951
raviyadav5951 / text.dart
Created January 31, 2021 13:17
Text dart
Text(
'Hello, guys! Flutter is beautiful',
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontWeight: FontWeight.bold),
)
@raviyadav5951
raviyadav5951 / build.gradle
Created December 27, 2019 05:58
MVVM project after creating new project
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.askfortricks.mvvmnavcontrol"
@raviyadav5951
raviyadav5951 / pubspec.yaml
Created December 25, 2019 08:02
Yaml file for multiple apks
name: app_name
description: A new Flutter application.
version: 1.0.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
@raviyadav5951
raviyadav5951 / build.gradle
Last active December 25, 2019 08:01
Split apks
splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs per ABI.
enable true
// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for armeabi-v7a and arm64-v8a.
// Resets the list of ABIs that Gradle should create APKs for to none.
reset()
@raviyadav5951
raviyadav5951 / main.dart
Last active February 14, 2019 13:03
My First Dart code
class Bicycle {
int cadence;
int _speed = 0;
//we have made speed as read only so we will just use get below to read its value.
//we will update its value using _speed variable.(work as setter)
// and to print the speed value (use _speed which always gets the latest speed value)
int get speed => _speed;
int gear;