Skip to content

Instantly share code, notes, and snippets.

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

Nitish Kumar Singh nitishk72

🏠
Working from home
View GitHub Profile
import 'package:flutter/material.dart';
// usage for this route
// Navigator.push(context, AppTransRoute(builder: (context) => new SecondPage(),),);
class AppTransRoute<T> extends MaterialPageRoute<T> {
AppTransRoute({WidgetBuilder builder, RouteSettings settings})
: super(builder: builder, settings: settings);
@override
Widget buildTransitions(BuildContext context, Animation<double> animation,
import 'package:flutter/material.dart';
// usage for this route
// Navigator.push(context, AppSlideRoute(builder: (context) => new SecondPage(),),);
class AppSlideRoute<T> extends MaterialPageRoute<T> {
AppSlideRoute({WidgetBuilder builder, RouteSettings settings})
: super(builder: builder, settings: settings);
@override
Widget buildTransitions(BuildContext context, Animation<double> animation,
return new Scaffold(
appBar: new AppBar(
title: new Text("Project Details"),
backgroundColor: Colors.blue[800]),
body:
new CustomScrollView(
slivers: <Widget>[
new SliverPadding(padding: const EdgeInsets.only(left: 10.0,right: 10.0,
top: 10.0,bottom: 0.0),
sliver: new SliverList(delegate:
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@nitishk72
nitishk72 / main.dart
Created April 24, 2018 12:57
Simple List Builder in Flutter
import 'package:flutter/material.dart';
main()=>runApp(new MaterialApp(
home: new AppHome(),
));
class AppHome extends StatefulWidget{
@override
State<AppHome> createState() {
return new AppState();
}
@nitishk72
nitishk72 / main.dart
Created April 20, 2018 14:41
Async http request
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
main(){
runApp(new AppName());
}
class AppName extends StatefulWidget{
@override
State<StatefulWidget> createState() {
@nitishk72
nitishk72 / Sum_pointer_object.cpp
Created February 13, 2018 08:19
Sum of two number using pointer Object
#include<iostream>
using namespace std;
class A{
int x,y,z;
public:
void add(){
cout<<"Enter value of x "<<endl;
cin>>x;
cout<<"Enter value of y "<<endl;
cin>>y;
#include<iostream>
using namespace std;
class A{
int x;
public:
void getdata(){
cout<<"\n Enter value of x:"<<endl;
cin>>x;
}
void showdata(){
@nitishk72
nitishk72 / slideshow.html
Created January 29, 2018 13:54
This is simple slideshow JavaScript code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style media="screen">
body{
background: #efefef;