🅵
Size: a a a
🅵
🅵
AZ
EC
EC
🅵
EC
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: ScreenA(),
);
}
}
class ScreenA extends StatelessWidget {
ScreenA({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Screen A'),
),
body: Container(
color: Colors.blueAccent,
child: Center(
child: TextButton(
child: Text('Next'),
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context) {
return ScreenB();
},));
}
),
),
)
);
}
}
class ScreenB extends StatelessWidget {
ScreenB({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
// return Scaffold(
// backgroundColor: Colors.transparent,
// appBar: AppBar(
// title: Text('Screen B'),
// ),
// body: Container(
// color: Colors.transparent,
// )
// );
return Container(
color: Colors.transparent,
);
}
}
🅵
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: ScreenA(),
);
}
}
class ScreenA extends StatelessWidget {
ScreenA({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Screen A'),
),
body: Container(
color: Colors.blueAccent,
child: Center(
child: TextButton(
child: Text('Next'),
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context) {
return ScreenB();
},));
}
),
),
)
);
}
}
class ScreenB extends StatelessWidget {
ScreenB({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
// return Scaffold(
// backgroundColor: Colors.transparent,
// appBar: AppBar(
// title: Text('Screen B'),
// ),
// body: Container(
// color: Colors.transparent,
// )
// );
return Container(
color: Colors.transparent,
);
}
}
🅵
@immutable
class App extends StatelessWidget {
static const String title = 'APP';
const App({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) => MaterialApp(
title: title,
initialRoute: '/',
routes: {
'/': (context) => Home(),
'/settings': (context) => Settings(),
},
);
}
@immutable
class Home extends StatelessWidget {
const Home({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) => Scaffold(
backgroundColor: Colors.red,
body: Center(
child: SizedBox(
height: 50,
width: 150,
child: RaisedButton(
child: Text('Settings'),
onPressed: () => Navigator.of(context).pushNamed('/settings'),
),
),
),
);
}
@immutable
class Settings extends StatelessWidget {
const Settings({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) => Scaffold(
backgroundColor: Colors.transparent,
body: Center(
child: RaisedButton(
child: Text('Back'),
onPressed: () => Navigator.of(context).pop(),
),
),
);
}
EC
EC
🅵
EC
EC
🅵
🅵
P
🅵