flutter_gallery_3d 1.1.1 flutter_gallery_3d: ^1.1.1 copied to clipboard
3d gallery
import 'package:example/demo01.dart';
import 'package:example/pageview_demo.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
Widget _buildItem(String title, Widget page) {
return InkWell(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return page;
}));
},
child: Container(
width: double.infinity,
padding: EdgeInsets.all(10),
child: Text(title),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: SingleChildScrollView(
child: Column(
children: [
_buildItem("demo01", Demo01()),
_buildItem("pageview_demo", PageViewDemo()),
],
),
),
);
}
}