picto_widget 0.0.5+5 picto_widget: ^0.0.5+5 copied to clipboard
Create great apps with Pictograms using OTTAA Picto widget, we feature a minimalistic design to foster understanding.
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:picto_widget/picto_widget.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Picto Widget Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const PictoWidgetExample(),
);
}
}
class PictoWidgetExample extends StatelessWidget {
const PictoWidgetExample({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: GridView.builder(
padding: const EdgeInsets.symmetric(horizontal: 24),
shrinkWrap: false,
itemCount: 20,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 12,
mainAxisSpacing: 12,
mainAxisExtent: 140,
),
itemBuilder: (context, index) => PictoWidget(
onTap: () {
print('tapped');
},
text: 'Example is preet long thi stime',
imageUrl: "https://picsum.photos/200",
image: CachedNetworkImage(
imageUrl: "https://picsum.photos/200", fit: BoxFit.cover),
colorNumber: 2,
onLongPress: () {
print('long pressed');
},
),
),
),
],
),
);
}
}