37 lines
1017 B
Dart
37 lines
1017 B
Dart
// lib/main.dart
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'data/instruction_repository.dart';
|
|
import 'providers/instruction_provider.dart';
|
|
import 'screens/instruction_list_page.dart';
|
|
//import 'data/api_instruction_repository.dart';
|
|
|
|
void main() {
|
|
final InstructionRepository repository = LocalInstructionRepository();
|
|
//LocalInstructionRepository();
|
|
|
|
runApp(
|
|
// "Предоставляем" наш провайдер всему дереву виджетов
|
|
ChangeNotifierProvider(
|
|
create: (context) => InstructionProvider(repository),
|
|
child: const MyApp(),
|
|
),
|
|
);
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Инструктажи',
|
|
theme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
|
useMaterial3: true,
|
|
),
|
|
home: const InstructionListPage(),
|
|
);
|
|
}
|
|
} |