|
|
@ -5,9 +5,11 @@
|
|
|
|
import 'dart:io';
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:fluent_ui/fluent_ui.dart';
|
|
|
|
import 'package:fluent_ui/fluent_ui.dart';
|
|
|
|
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import 'package:logging/logging.dart';
|
|
|
|
import 'package:logging/logging.dart';
|
|
|
|
import 'package:menubar/menubar.dart' as menubar;
|
|
|
|
import 'package:menubar/menubar.dart' as menubar;
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
import 'package:window_size/window_size.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'src/model/photo_search_model.dart';
|
|
|
|
import 'src/model/photo_search_model.dart';
|
|
|
|
import 'src/unsplash/unsplash.dart';
|
|
|
|
import 'src/unsplash/unsplash.dart';
|
|
|
@ -30,6 +32,8 @@ void main() {
|
|
|
|
exit(1);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setupWindow();
|
|
|
|
|
|
|
|
|
|
|
|
runApp(
|
|
|
|
runApp(
|
|
|
|
ChangeNotifierProvider<PhotoSearchModel>(
|
|
|
|
ChangeNotifierProvider<PhotoSearchModel>(
|
|
|
|
create: (context) => PhotoSearchModel(
|
|
|
|
create: (context) => PhotoSearchModel(
|
|
|
@ -40,6 +44,16 @@ void main() {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const double kWindowWidth = 1024;
|
|
|
|
|
|
|
|
const double kWindowHeight = 800;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setupWindow() {
|
|
|
|
|
|
|
|
if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
|
|
|
|
|
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
|
|
|
setWindowMinSize(const Size(kWindowWidth, kWindowHeight));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class UnsplashSearchApp extends StatelessWidget {
|
|
|
|
class UnsplashSearchApp extends StatelessWidget {
|
|
|
|
const UnsplashSearchApp({Key? key}) : super(key: key);
|
|
|
|
const UnsplashSearchApp({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|