Sunday, September 1, 2019

test

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

class MyBeginner extends StatefulWidget {
var pindah;
MyBeginner({this.pindah});

_MyBeginnerState createState() => _MyBeginnerState();
}

class _MyBeginnerState extends State<MyBeginner> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Pentesting"),
),
body: Column(
children: <Widget>[
Expanded(
child: Container(
decoration: BoxDecoration(color: Colors.red),
),
),
Expanded(
child: Container(
decoration: BoxDecoration(color: Colors.yellow),
child: RaisedButton(
child: Text("Pindah Halaman Belajar"),
onPressed: (){
Navigator.push(context, MaterialPageRoute(builder: (context) => MyPindah()));
// Navigator.pushNamed(context, MyBeginner.pindah)
},
),
),
),
Expanded(
child: Container(
child: RaisedButton(
child: Text("Push Rauting Named"),
onPressed: (){
Navigator.of(context).pushNamed('/latihan');
// Navigator.pushNamed(context, 'latihan');
},
),
decoration: BoxDecoration(color: Colors.green),
),
),
],
),
);
}
}

class MyPindah extends StatefulWidget {
var pindah;
MyPindah({this.pindah});

_MyPindahState createState() => _MyPindahState();
}

class _MyPindahState extends State<MyPindah> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("App Back"),
),
body: Padding(
padding: const EdgeInsets.all(100.0),
child: SizedBox.expand(
child: Card(
color: Colors.blue,
child: Center(child: Text("Hello World")),
),
),
),
);
}
}

No comments:

Post a Comment

test

import 'dart:async' ; import 'package:flutter/material.dart' ; class MyBeginner extends StatefulWidget { var...