45 lines
1.3 KiB
Dart
45 lines
1.3 KiB
Dart
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),
|
|
);
|
|
}),
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|