BusinessAppFlutter/openclosenew/lib/26-PhotoListing.dart

44 lines
1.2 KiB
Dart
Raw Normal View History

2022-06-22 19:39:23 +00:00
import 'package:flutter/material.dart';
import '25-addphotos1.dart';
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Home Page')),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
onPressed: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) => addphotos1()));
},
),
body: StreamBuilder(
builder: (context, snapshot) {
return !snapshot.hasData
? Center(
child: CircularProgressIndicator(),
)
: Container(
padding: EdgeInsets.all(4),
child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3),
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.all(3),
);
}),
);
},
),
);
}
}