Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- import 'package:ultra_washtex/view/myweb_view.dart';
- class MyHomeGridView extends StatelessWidget {
- List<String> titles = [
- "Google",
- "FB",
- "Twitter",
- "Insta",
- "Amazon",
- "Flipkart",
- "Google",
- "FB",
- "Twitter",
- "Insta",
- "Amazon",
- "Flipkart"
- ];
- List<String> images = [
- "cart.png",
- "flipkart.jpeg",
- "logo.png",
- "more.png",
- "home.png",
- "more.png",
- "cart.png",
- "flipkart.jpeg",
- "logo.png",
- "more.png",
- "home.png",
- "more.png",
- ];
- List<String> urls = [
- "https://pub.dev/packages/webview_flutter",
- "https://pub.dev/packages/webview_flutter",
- "https://pub.dev/packages/webview_flutter",
- "https://pub.dev/packages/webview_flutter",
- "https://pub.dev/packages/webview_flutter",
- "https://pub.dev/packages/webview_flutter",
- "https://pub.dev/packages/webview_flutter",
- "https://pub.dev/packages/webview_flutter",
- "https://pub.dev/packages/webview_flutter",
- "https://pub.dev/packages/webview_flutter",
- "https://pub.dev/packages/webview_flutter",
- "https://pub.dev/packages/webview_flutter",
- ];
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(),
- body: GridView.builder(
- itemCount: titles.length,
- gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
- crossAxisCount:
- (Orientation.portrait == MediaQuery.of(context).orientation)
- ? 3
- : 2),
- itemBuilder: (context, index) {
- return Padding(
- padding: const EdgeInsets.all(8.0),
- child: new InkResponse(
- onTap: () async {
- Navigator.of(context).push(MaterialPageRoute(
- builder: (cc) => MyWebView(urls[index])));
- },
- child: Column(
- children: [
- new Container(
- width: 80,
- height: 80,
- decoration: new BoxDecoration(
- color: Colors.green,
- shape: BoxShape.circle,
- border: Border.all(
- color: Colors.red,
- width: 2,
- ),
- ),
- alignment: Alignment.center,
- child: new Container(
- width: 50.0,
- height: 50.0,
- decoration: new BoxDecoration(
- shape: BoxShape.circle,
- color: Colors.white,
- border: Border.all(
- color: Colors.white,
- width: 2,
- ),
- image: new DecorationImage(
- fit: BoxFit.fill,
- image: AssetImage(
- "assets/images/" + images[index],
- ),
- ),
- ),
- ),
- ),
- SizedBox(
- height: 5,
- ),
- Text(titles[index])
- ],
- ),
- ),
- );
- }),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment