Gallery/lib/main.dart

44 lines
932 B
Dart
Raw Normal View History

import 'dart:io';
2022-09-25 22:12:57 +00:00
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
2022-09-25 22:12:57 +00:00
import 'home_page.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
if (Platform.isAndroid) {
if (await Permission.storage.request().isGranted) {
runApp(const MyApp());
}
} else {
runApp(const MyApp());
}
2022-09-25 22:12:57 +00:00
}
class AppScrollBehavior extends MaterialScrollBehavior {
@override
Set<PointerDeviceKind> get dragDevices => {
2022-09-26 22:30:13 +00:00
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
};
2022-09-25 22:12:57 +00:00
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
scrollBehavior: AppScrollBehavior(),
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Gallery'),
);
}
}