simple_asset_picker 0.0.2+1 simple_asset_picker: ^0.0.2+1 copied to clipboard
simple_asset_picker
// Copyright 2019 The FlutterCandies author. All rights reserved.
// Use of this source code is governed by an Apache license that can be found
// in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:simple_asset_picker/simple_asset_picker.dart';
import 'constants/extensions.dart';
import 'constants/screens.dart';
import 'pages/splash_page.dart';
const Color themeColor = Color(0xff00bc56);
String? packageVersion;
void main() {
runApp(const MyApp());
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle.dark.copyWith(statusBarColor: Colors.transparent),
);
AssetPicker.registerObserve();
// Enables logging with the photo_manager.
PhotoManager.setLog(true);
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'WeChat Asset Picker Demo',
theme: ThemeData(
brightness: Screens.mediaQuery.platformBrightness,
primarySwatch: themeColor.swatch,
textSelectionTheme: const TextSelectionThemeData(
cursorColor: themeColor,
),
),
home: const SplashPage(),
builder: (BuildContext c, Widget? w) {
return ScrollConfiguration(
behavior: const NoGlowScrollBehavior(),
child: w!,
);
},
localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
GlobalWidgetsLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
);
}
}
class NoGlowScrollBehavior extends ScrollBehavior {
const NoGlowScrollBehavior();
@override
Widget buildOverscrollIndicator(
BuildContext context,
Widget child,
ScrollableDetails details,
) =>
child;
}