82 lines
2.1 KiB
Dart
82 lines
2.1 KiB
Dart
|
|
import 'package:ads_example/vast_webview_page.dart';
|
||
|
|
// import 'package:ads_example/vast_webview_local_page.dart';
|
||
|
|
import 'package:ads_example/native_player_page.dart';
|
||
|
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
runApp(const MyApp());
|
||
|
|
}
|
||
|
|
|
||
|
|
class MyApp extends StatelessWidget {
|
||
|
|
const MyApp({super.key});
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return MaterialApp(
|
||
|
|
title: 'VAST WebView Ads',
|
||
|
|
theme: ThemeData(
|
||
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
||
|
|
),
|
||
|
|
home: const MyHomePage(title: 'VAST WebView Ads'),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
class MyHomePage extends StatefulWidget {
|
||
|
|
const MyHomePage({super.key, required this.title});
|
||
|
|
|
||
|
|
final String title;
|
||
|
|
|
||
|
|
@override
|
||
|
|
State<MyHomePage> createState() => _MyHomePageState();
|
||
|
|
}
|
||
|
|
|
||
|
|
class _MyHomePageState extends State<MyHomePage> {
|
||
|
|
int _selectedIndex = 0;
|
||
|
|
|
||
|
|
final List<Widget> _pages = [
|
||
|
|
// const VastWebViewPage(),
|
||
|
|
// const VastWebViewLocalPage(),
|
||
|
|
const NativePlayerPage(),
|
||
|
|
];
|
||
|
|
|
||
|
|
final List<String> _pageTitles = [
|
||
|
|
// 'VAST WebView (Пользовательский URL)',
|
||
|
|
// 'VAST WebView (Локальная)',
|
||
|
|
'Native Player',
|
||
|
|
];
|
||
|
|
|
||
|
|
void _onItemTapped(int index) {
|
||
|
|
setState(() {
|
||
|
|
_selectedIndex = index;
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return Scaffold(
|
||
|
|
body: _pages[_selectedIndex],
|
||
|
|
// bottomNavigationBar: BottomNavigationBar(
|
||
|
|
// type: BottomNavigationBarType.fixed,
|
||
|
|
// items: const <BottomNavigationBarItem>[
|
||
|
|
// // BottomNavigationBarItem(
|
||
|
|
// // icon: Icon(Icons.cloud),
|
||
|
|
// // label: 'Сервер',
|
||
|
|
// // ),
|
||
|
|
// // BottomNavigationBarItem(
|
||
|
|
// // icon: Icon(Icons.storage),
|
||
|
|
// // label: 'Локальная',
|
||
|
|
// // ),
|
||
|
|
// BottomNavigationBarItem(
|
||
|
|
// icon: Icon(Icons.play_circle_outline),
|
||
|
|
// label: 'Native',
|
||
|
|
// ),
|
||
|
|
// ],
|
||
|
|
// currentIndex: _selectedIndex,
|
||
|
|
// selectedItemColor: Colors.deepPurple,
|
||
|
|
// onTap: _onItemTapped,
|
||
|
|
// ),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|