app.dart

PHOTO EMBED

Sun Jun 19 2022 15:34:08 GMT+0000 (UTC)

Saved by @alefl10 #dart

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hello_web3/hello/hello.dart';
import 'package:hello_web3/l10n/l10n.dart';
import 'package:smart_contract_repository/smart_contract_repository.dart';

class App extends StatelessWidget {
  const App({
    required SmartContractRepository smartContractRepository,
    super.key,
  }) : _smartContractRepository = smartContractRepository;

  final SmartContractRepository _smartContractRepository;

  @override
  Widget build(BuildContext context) {
    return MultiRepositoryProvider(
      providers: [RepositoryProvider.value(value: _smartContractRepository)],
      child: const AppView(),
    );
  }
}

class AppView extends StatelessWidget {
  const AppView({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        appBarTheme: const AppBarTheme(color: Color(0xFF13B9FF)),
        colorScheme: ColorScheme.fromSwatch(
          accentColor: const Color(0xFF13B9FF),
        ),
      ),
      localizationsDelegates: const [
        AppLocalizations.delegate,
        GlobalMaterialLocalizations.delegate,
      ],
      supportedLocales: AppLocalizations.supportedLocales,
      home: const HelloPage(),
    );
  }
}
content_copyCOPY