Задать вопрос
@uyshaaaaaa

Column в dart распознаётся как функция, почему?

@override
  Widget build(BuildContext context) {
    if (_isLoading) {
      return const Scaffold(
        body: Center(child: CircularProgressIndicator()),
      );
    }

    if (_isLoggedIn) {
      return const homerscr.HomeScreen();
    }

    return Scaffold(
      body: Stack(
        
        children: [
          
          Container(
            decoration: BoxDecoration(
              image: DecorationImage(
                image: AssetImage('assets/image/backgr.jpg'),
                fit: BoxFit.cover,
              ),
            ),
          ),
          Column(
              children: [
                const Spacer(flex: 1),
                Padding(
                  padding: const EdgeInsets.only(left: 0),
                  child: Text(
                    "A look",
                    textAlign: TextAlign.center,
                    style: TextStyle(
                      color: HexColor('#A2000C'),
                      fontFamily: 'RoschaRegular',
                      fontSize: 47,
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                ),
                Padding(
                  padding: const EdgeInsets.only(left: 170),
                  child: Text(
                    'to',
                    textAlign: TextAlign.center,
                    style: TextStyle(
                      color: HexColor('#A2000C'),
                      fontFamily: 'RoschaRegular',
                      fontSize: 47,
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                ),
                Padding(
                  padding: const EdgeInsets.only(left: 100),
                  child: Text(
                    'the book',
                    style: TextStyle(
                      color: HexColor('#A2000C'),
                      fontSize: 47,
                      fontWeight: FontWeight.bold,
                      fontFamily: 'RoschaRegular',
                    ),
                  ),
                ),
                const Spacer(),
              ],
            ),
            
            Column(
              children: [
                const Spacer(),
                zareg(context),
                const SizedBox(height: 20),
                voiti(context),
              ],
            ),
          ],
      ),
    );
  }

  Widget zareg(BuildContext context) {
    return Align(
      alignment: Alignment.bottomCenter,
      child: GestureDetector(
        behavior: HitTestBehavior.opaque,
        onTap: () async {
          await Navigator.push(
            context,
            MaterialPageRoute(builder: (context) => const LogIn()),
          );
          // После возврата с регистрации - проверяем статус
          _checkLoginStatus();
        },
        child: Container(
          width: MediaQuery.sizeOf(context).width * 0.936,
          height: MediaQuery.sizeOf(context).width * 0.19,
          decoration: BoxDecoration(
            image: DecorationImage(
              image: AssetImage('assets/image/bgforbt.png'),
              fit: BoxFit.cover,
            ),
          ),
          child: const Center(
            child: Text(
              'Зарегистрироваться',
              style: TextStyle(
                color: Color(0xFFA2000C),
                fontFamily: 'RoschaRegular',
                fontSize: 27,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
        ),
      ),
    );
  }

  Widget voiti(BuildContext context) {
    return Align(
      alignment: Alignment.bottomCenter,
      child: GestureDetector(
        behavior: HitTestBehavior.opaque,
        onTap: () {
          Navigator.push(
            context,
            MaterialPageRoute(builder: (context) => const SignUp()),
          );
        },
        child: Container(
          width: MediaQuery.sizeOf(context).width * 0.936,
          height: MediaQuery.sizeOf(context).width * 0.19,
          decoration: BoxDecoration(
            image: DecorationImage(
              image: AssetImage('assets/image/bgforbt.png'),
              fit: BoxFit.cover,
            ),
          ),
          child: const Center(
            child: Text(
              'Войти',
              style: TextStyle(
                color: Color(0xFFA2000C),
                fontFamily: 'RoschaRegular',
                fontSize: 30,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
        ),
      ),
    );
  }
}
и выходит ошибка column isn't a function
  • Вопрос задан
  • 70 просмотров
Подписаться 1 Средний Комментировать
Помогут разобраться в теме Все курсы
  • Stepik
    Flutter Разработка (2025). От 🐣 базы до 😎 вайб кодинга
    1 месяц
    Далее
  • Merion Academy
    Разработка приложений на Flutter и Dart
    2 месяца
    Далее
  • МИПО
    Бакалавриат Интернет технологии и мобильные приложения
    54 месяца
    Далее
Решения вопроса 1
opium
@opium
Просто люблю качественно работать
Тут дело в импортах — drift/floor или другой БД-пакет тоже экспортирует Column и перекрывает флаттеровский виджет. Фикс:
import 'package:drift/drift.dart' hide Column;

(поменяй drift на свой пакет)
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы