-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.dart
48 lines (42 loc) · 1.24 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import 'dart:developer';
import 'package:flutter/material.dart';
// ignore: depend_on_referenced_packages
import 'package:flutter_image_multi_grid_selection/flutter_image_multi_grid_selection.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: ImageGridSelectorExample(),
);
}
}
class ImageGridSelectorExample extends StatelessWidget {
ImageGridSelectorExample({super.key});
String imageURL =
'https://res.cloudinary.com/vertexinspector/image/upload/v1678793934/inspection-images/mjujbtrvgtjuv3z3hlo0.jpg'; //
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: ImageGridSelector(
image: NetworkImage(imageURL),
rows: 4,
columns: 4,
gridColor: Colors.green,
overlayColor: Colors.orangeAccent.withOpacity(0.5),
onCellsSelected: (selectedCells) {
log('Selected cells: ${selectedCells.toString()}');
},
),
));
}
}